forked from VimPlug/jedi
Removed base in completions
This commit is contained in:
@@ -205,18 +205,17 @@ class Script(object):
|
|||||||
if settings.case_insensitive_completion \
|
if settings.case_insensitive_completion \
|
||||||
and n.lower().startswith(like.lower()) \
|
and n.lower().startswith(like.lower()) \
|
||||||
or n.startswith(like):
|
or n.startswith(like):
|
||||||
if True: # TODO reinstate! not filter_private_variable(s, user_stmt or self._parser.user_scope(), n):
|
if isinstance(c.parent, (pr.Function, pr.Class)):
|
||||||
if isinstance(c.parent, (pr.Function, pr.Class)):
|
# TODO I think this is a hack. It should be an
|
||||||
# TODO I think this is a hack. It should be an
|
# er.Function/er.Class before that.
|
||||||
# er.Function/er.Class before that.
|
c = er.wrap(self._evaluator, c.parent).name
|
||||||
c = er.wrap(self._evaluator, c.parent).name
|
new = classes.Completion(self._evaluator, c, needs_dot, len(like))
|
||||||
new = classes.Completion(self._evaluator, c, needs_dot, len(like), s)
|
k = (new.name, new.complete) # key
|
||||||
k = (new.name, new.complete) # key
|
if k in comp_dct and settings.no_completion_duplicates:
|
||||||
if k in comp_dct and settings.no_completion_duplicates:
|
comp_dct[k]._same_name_completions.append(new)
|
||||||
comp_dct[k]._same_name_completions.append(new)
|
else:
|
||||||
else:
|
comp_dct[k] = new
|
||||||
comp_dct[k] = new
|
comps.append(new)
|
||||||
comps.append(new)
|
|
||||||
|
|
||||||
debug.speed('completions end')
|
debug.speed('completions end')
|
||||||
|
|
||||||
|
|||||||
@@ -365,12 +365,11 @@ class Completion(BaseDefinition):
|
|||||||
`Completion` objects are returned from :meth:`api.Script.completions`. They
|
`Completion` objects are returned from :meth:`api.Script.completions`. They
|
||||||
provide additional information about a completion.
|
provide additional information about a completion.
|
||||||
"""
|
"""
|
||||||
def __init__(self, evaluator, name, needs_dot, like_name_length, base):
|
def __init__(self, evaluator, name, needs_dot, like_name_length):
|
||||||
super(Completion, self).__init__(evaluator, name)
|
super(Completion, self).__init__(evaluator, name)
|
||||||
|
|
||||||
self._needs_dot = needs_dot
|
self._needs_dot = needs_dot
|
||||||
self._like_name_length = like_name_length
|
self._like_name_length = like_name_length
|
||||||
self._base = base
|
|
||||||
|
|
||||||
# Completion objects with the same Completion name (which means
|
# Completion objects with the same Completion name (which means
|
||||||
# duplicate items in the completion)
|
# duplicate items in the completion)
|
||||||
@@ -384,9 +383,9 @@ class Completion(BaseDefinition):
|
|||||||
append = '('
|
append = '('
|
||||||
|
|
||||||
if settings.add_dot_after_module:
|
if settings.add_dot_after_module:
|
||||||
if isinstance(self._base, pr.Module):
|
if isinstance(self._definition, pr.Module):
|
||||||
append += '.'
|
append += '.'
|
||||||
if isinstance(self._base, pr.Param):
|
if isinstance(self._definition, pr.Param):
|
||||||
append += '='
|
append += '='
|
||||||
|
|
||||||
name = str(self._name)
|
name = str(self._name)
|
||||||
|
|||||||
Reference in New Issue
Block a user