Fix dict completions for inherited dicts, fixes #1631

This commit is contained in:
Dave Halter
2020-07-14 17:50:12 +02:00
parent 7f3a7db7e6
commit 9957374508
2 changed files with 13 additions and 0 deletions

View File

@@ -594,12 +594,18 @@ def test_param_annotation_completion(class_is_findable):
('mixed[Non', 9, ['e']),
('implicit[10', None, ['00']),
('inherited["', None, ['blablu"']),
]
)
def test_dict_completion(code, column, expected):
strs = {'asdf': 1, u"""foo""": 2, r'fbar': 3}
mixed = {1: 2, 1.10: 4, None: 6, r'a\sdf': 8, b'foo': 9}
class Inherited(dict):
pass
inherited = Inherited(blablu=3)
namespaces = [locals(), {'implicit': {1000: 3}}]
comps = jedi.Interpreter(code, namespaces).complete(column=column)
if Ellipsis in expected: