mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-22 03:42:05 +08:00
Goto bug fix.
This commit is contained in:
@@ -407,7 +407,11 @@ class Script(object):
|
||||
if last_name is None:
|
||||
last_name = stmt
|
||||
while not isinstance(last_name, pr.Name):
|
||||
last_name = last_name.children[-1]
|
||||
try:
|
||||
last_name = last_name.children[-1]
|
||||
except AttributeError:
|
||||
# Doesn't have a name in it.
|
||||
return []
|
||||
|
||||
if next(context) in ('class', 'def'):
|
||||
# The cursor is on a class/function name.
|
||||
|
||||
@@ -101,10 +101,11 @@ def test_completion_on_complex_literals():
|
||||
assert api.Script('4j').completions() == []
|
||||
|
||||
|
||||
def test_goto_assignments_on_non_statement():
|
||||
def test_goto_assignments_on_non_name():
|
||||
assert api.Script('for').goto_assignments() == []
|
||||
|
||||
assert api.Script('assert').goto_assignments() == []
|
||||
assert api.Script('True').goto_assignments() == []
|
||||
|
||||
|
||||
def test_goto_definition_not_multiple():
|
||||
|
||||
Reference in New Issue
Block a user