mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +08:00
same problem with KeywordStatement
This commit is contained in:
@@ -266,7 +266,7 @@ class Script(object):
|
|||||||
stmt = r.module.statements[-1]
|
stmt = r.module.statements[-1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
raise NotFoundError()
|
raise NotFoundError()
|
||||||
if isinstance(stmt, pr.Flow):
|
if not isinstance(stmt, pr.Statement):
|
||||||
raise NotFoundError()
|
raise NotFoundError()
|
||||||
|
|
||||||
user_stmt = self._parser.user_stmt()
|
user_stmt = self._parser.user_stmt()
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ def test_completion_on_complex_literals():
|
|||||||
assert api.Script('4j').completions() == []
|
assert api.Script('4j').completions() == []
|
||||||
|
|
||||||
|
|
||||||
def test_goto_assignments_on_for():
|
def test_goto_assignments_on_non_statement():
|
||||||
with raises(api.NotFoundError):
|
with raises(api.NotFoundError):
|
||||||
api.Script('for').goto_assignments()
|
api.Script('for').goto_assignments()
|
||||||
|
|
||||||
|
with raises(api.NotFoundError):
|
||||||
|
api.Script('assert').goto_assignments()
|
||||||
|
|||||||
Reference in New Issue
Block a user