From cc8a3f192d69b2e174235686ae718bca25318af0 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 23 Jan 2020 23:16:02 +0100 Subject: [PATCH] Removed settings.no_completion_duplicates --- CHANGELOG.rst | 2 ++ jedi/api/completion.py | 8 +++----- jedi/settings.py | 7 ------- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fe19f9f5..be2269c0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -29,6 +29,8 @@ Changelog ``Script.goto``. - **Python 2 support deprecated**. For this release it is best effort. Python 2 has reached the end of its life and now it's just about a smooth transition. +- Removed ``settings.no_completion_duplicates``. It wasn't tested and nobody + was probably using it anyway. 0.15.2 (2019-12-20) +++++++++++++++++++ diff --git a/jedi/api/completion.py b/jedi/api/completion.py index aff86fa9..f43b9b45 100644 --- a/jedi/api/completion.py +++ b/jedi/api/completion.py @@ -41,7 +41,7 @@ def get_signature_param_names(signatures): def filter_names(inference_state, completion_names, stack, like_name, fuzzy, cached_name): - comp_dct = {} + comp_dct = set() if settings.case_insensitive_completion: like_name = like_name.lower() for name in completion_names: @@ -62,10 +62,8 @@ def filter_names(inference_state, completion_names, stack, like_name, fuzzy, cac cached_name=cached_name, ) k = (new.name, new.complete) # key - if k in comp_dct and settings.no_completion_duplicates: - comp_dct[k]._same_name_completions.append(new) - else: - comp_dct[k] = new + if k not in comp_dct: + comp_dct.add(k) yield new diff --git a/jedi/settings.py b/jedi/settings.py index 4bff8cc5..4e4569f9 100644 --- a/jedi/settings.py +++ b/jedi/settings.py @@ -17,7 +17,6 @@ Completion output .. autodata:: case_insensitive_completion .. autodata:: add_bracket_after_function -.. autodata:: no_completion_duplicates Filesystem cache @@ -68,12 +67,6 @@ Adds an opening bracket after a function, because that's normal behaviour. Removed it again, because in VIM that is not very practical. """ -no_completion_duplicates = True -""" -If set, completions with the same name don't appear in the output anymore, -but are in the `same_name_completions` attribute. -""" - # ---------------- # Filesystem cache # ----------------