mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Usages on syntax should not return anything.
This commit is contained in:
@@ -466,7 +466,11 @@ class Script(object):
|
|||||||
# For not defined imports (goto doesn't find something, we take
|
# For not defined imports (goto doesn't find something, we take
|
||||||
# the name as a definition. This is enough, because every name
|
# the name as a definition. This is enough, because every name
|
||||||
# points to it.
|
# points to it.
|
||||||
definitions = [user_stmt.name_for_position(self._pos)]
|
name = user_stmt.name_for_position(self._pos)
|
||||||
|
if name is None:
|
||||||
|
# Must be syntax
|
||||||
|
return []
|
||||||
|
definitions = [name]
|
||||||
|
|
||||||
if not definitions:
|
if not definitions:
|
||||||
# Without a definition for a name we cannot find references.
|
# Without a definition for a name we cannot find references.
|
||||||
|
|||||||
@@ -266,3 +266,10 @@ import _sre
|
|||||||
|
|
||||||
#< 0 (-3,7), (0,0), ('_sre', None, None)
|
#< 0 (-3,7), (0,0), ('_sre', None, None)
|
||||||
_sre
|
_sre
|
||||||
|
|
||||||
|
# -----------------
|
||||||
|
# on syntax
|
||||||
|
# -----------------
|
||||||
|
|
||||||
|
#< 0
|
||||||
|
import undefined
|
||||||
|
|||||||
Reference in New Issue
Block a user