1
0
forked from VimPlug/jedi

Remove needs_dot and settings.add_dot_after_module. Both are not really used anymore with context completions anymore.

Also the setting doesn't seem to be used anywhere as far as I can tell.
This commit is contained in:
Dave Halter
2016-06-22 22:52:10 +02:00
parent 1355ea01b3
commit cbef4235ff
3 changed files with 4 additions and 19 deletions

View File

@@ -365,10 +365,9 @@ class Completion(BaseDefinition):
`Completion` objects are returned from :meth:`api.Script.completions`. They
provide additional information about a completion.
"""
def __init__(self, evaluator, name, needs_dot, like_name_length):
def __init__(self, evaluator, name, like_name_length):
super(Completion, self).__init__(evaluator, name)
self._needs_dot = needs_dot
self._like_name_length = like_name_length
# Completion objects with the same Completion name (which means
@@ -376,22 +375,18 @@ class Completion(BaseDefinition):
self._same_name_completions = []
def _complete(self, like_name):
dot = '.' if self._needs_dot else ''
append = ''
if settings.add_bracket_after_function \
and self.type == 'Function':
append = '('
if settings.add_dot_after_module:
if isinstance(self._definition, tree.Module):
append += '.'
if isinstance(self._definition, tree.Param):
append += '='
name = str(self._name)
if like_name:
name = name[self._like_name_length:]
return dot + name + append
return name + append
@property
def complete(self):

View File

@@ -29,7 +29,7 @@ def get_call_signature_param_names(call_signatures):
yield p._name
def filter_names(evaluator, completion_names, needs_dot, like_name):
def filter_names(evaluator, completion_names, like_name):
comp_dct = {}
for name in set(completion_names):
if settings.case_insensitive_completion \
@@ -43,7 +43,6 @@ def filter_names(evaluator, completion_names, needs_dot, like_name):
new = classes.Completion(
evaluator,
name,
needs_dot,
len(like_name)
)
k = (new.name, new.complete) # key
@@ -74,10 +73,8 @@ class Completion:
call_signatures = self._call_signatures_method()
completion_names += get_call_signature_param_names(call_signatures)
needs_dot = not completion_parts.has_dot and completion_parts.path
completions = filter_names(self._evaluator, completion_names,
needs_dot, completion_parts.name)
completion_parts.name)
return sorted(completions, key=lambda x: (x.name.startswith('__'),
x.name.startswith('_'),

View File

@@ -86,13 +86,6 @@ case_insensitive_completion = True
The completion is by default case insensitive.
"""
add_dot_after_module = False
"""
Adds a dot after a module, because a module that is not accessed this way is
definitely not the normal case. However, in VIM this doesn't work, that's why
it isn't used at the moment.
"""
add_bracket_after_function = False
"""
Adds an opening bracket after a function, because that's normal behaviour.