forked from VimPlug/jedi
fix broken goto_definition command for variables in the same statement
This commit is contained in:
@@ -236,8 +236,15 @@ class Script(object):
|
|||||||
user_stmt, is_completion)[0]]
|
user_stmt, is_completion)[0]]
|
||||||
else:
|
else:
|
||||||
# just parse one statement, take it and evaluate it
|
# just parse one statement, take it and evaluate it
|
||||||
stmt = self._get_under_cursor_stmt(goto_path)
|
eval_stmt = self._get_under_cursor_stmt(goto_path)
|
||||||
scopes = self._evaluator.eval_statement(stmt)
|
|
||||||
|
if not is_completion:
|
||||||
|
# goto_definition returns definitions of its statements if the
|
||||||
|
# cursor is on the assignee. By changing the start_pos of our
|
||||||
|
# "pseud" statement, the Jedi evaluator can find the assignees.
|
||||||
|
if user_stmt is not None:
|
||||||
|
eval_stmt.start_pos = user_stmt.end_pos
|
||||||
|
scopes = self._evaluator.eval_statement(eval_stmt)
|
||||||
return scopes
|
return scopes
|
||||||
|
|
||||||
def _get_under_cursor_stmt(self, cursor_txt):
|
def _get_under_cursor_stmt(self, cursor_txt):
|
||||||
|
|||||||
Reference in New Issue
Block a user