1
0
forked from VimPlug/jedi

Fix the issues with added equals after params in the wrong places. Fixes #643.

This commit is contained in:
Dave Halter
2016-07-20 23:19:05 +02:00
parent a2d66579d7
commit f20df95074
3 changed files with 21 additions and 11 deletions

View File

@@ -366,10 +366,11 @@ class Completion(BaseDefinition):
`Completion` objects are returned from :meth:`api.Script.completions`. They
provide additional information about a completion.
"""
def __init__(self, evaluator, name, like_name_length):
def __init__(self, evaluator, name, stack, like_name_length):
super(Completion, self).__init__(evaluator, name)
self._like_name_length = like_name_length
self.stack = stack
# Completion objects with the same Completion name (which means
# duplicate items in the completion)
@@ -381,8 +382,11 @@ class Completion(BaseDefinition):
and self.type == 'Function':
append = '('
if isinstance(self._definition, tree.Param):
append += '='
if self.stack is not None:
node_names = list(self.stack.get_node_names(self._evaluator.grammar))
print(node_names)
if 'trailer' in node_names and 'argument' not in node_names:
append += '='
name = str(self._name)
if like_name: