1
0
forked from VimPlug/jedi

Fix __call__.

This commit is contained in:
Dave Halter
2016-10-24 00:39:59 +02:00
parent 0475bb5fd0
commit e34246eb00
12 changed files with 298 additions and 112 deletions

View File

@@ -64,8 +64,8 @@ def _is_on_comment(leaf, position):
return '#' in line
def _get_code_for_stack(code_lines, module, position):
leaf = module.get_leaf_for_position(position, include_prefixes=True)
def _get_code_for_stack(code_lines, module_node, position):
leaf = module_node.get_leaf_for_position(position, include_prefixes=True)
# It might happen that we're on whitespace or on a comment. This means
# that we would not get the right leaf.
if leaf.start_pos >= position:
@@ -111,7 +111,7 @@ def _get_code_for_stack(code_lines, module, position):
return _get_code(code_lines, user_stmt.get_start_pos_of_prefix(), position)
def get_stack_at_position(grammar, code_lines, module, pos):
def get_stack_at_position(grammar, code_lines, module_node, pos):
"""
Returns the possible node names (e.g. import_from, xor_test or yield_stmt).
"""
@@ -126,7 +126,7 @@ def get_stack_at_position(grammar, code_lines, module, pos):
else:
yield token_
code = _get_code_for_stack(code_lines, module, pos)
code = _get_code_for_stack(code_lines, module_node, pos)
# We use a word to tell Jedi when we have reached the start of the
# completion.
# Use Z as a prefix because it's not part of a number suffix.
@@ -196,7 +196,7 @@ def evaluate_goto_definition(evaluator, context, leaf):
if leaf.type == 'name':
# In case of a name we can just use goto_definition which does all the
# magic itself.
return evaluator.goto_definitions(leaf)
return evaluator.goto_definitions(context, leaf)
node = None
parent = leaf.parent