1
0
forked from VimPlug/jedi

Make sure to avoid duplicates in completions

This commit is contained in:
Dave Halter
2019-12-31 11:15:23 +01:00
parent 94a97ff8e8
commit ca13c44788
3 changed files with 27 additions and 18 deletions

View File

@@ -55,12 +55,12 @@ def _completions_for_dicts(inference_state, dicts, literal_string, cut_end_quote
dict_key_str = _create_repr_string(literal_string, dict_key)
if dict_key_str.startswith(literal_string):
n = dict_key_str[len(literal_string):-len(cut_end_quote) or None]
name = StringName(inference_state, n)
name = StringName(inference_state, dict_key_str[:-len(cut_end_quote) or None])
yield Completion(
inference_state,
name,
stack=None,
like_name_length=0,
like_name_length=len(literal_string),
is_fuzzy=fuzzy
)