mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-25 04:17:12 +08:00
goto_assignments and usages both working now with issues like #315
This commit is contained in:
@@ -249,12 +249,12 @@ class Script(object):
|
||||
except IndexError:
|
||||
raise NotFoundError()
|
||||
user_stmt = self._parser.user_stmt()
|
||||
if type(user_stmt) is pr.Statement:
|
||||
stmt.start_pos = user_stmt.start_pos
|
||||
else:
|
||||
if user_stmt is None:
|
||||
# Set the start_pos to a pseudo position, that doesn't exist but works
|
||||
# perfectly well (for both completions in docstrings and statements).
|
||||
stmt.start_pos = self._pos
|
||||
else:
|
||||
stmt.start_pos = user_stmt.start_pos
|
||||
stmt.parent = self._parser.user_scope()
|
||||
return stmt
|
||||
|
||||
@@ -437,7 +437,7 @@ class Script(object):
|
||||
for name in user_stmt.get_set_vars():
|
||||
if name.start_pos <= self._pos <= name.end_pos \
|
||||
and len(name.names) == 1:
|
||||
return user_stmt, name.names[-1]
|
||||
return name, name.names[-1]
|
||||
return None, None
|
||||
|
||||
lhs, search_name = test_lhs()
|
||||
|
||||
Reference in New Issue
Block a user