mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-16 02:27:06 +08:00
goto should always goto definitions, fixes #1304
This commit is contained in:
@@ -318,11 +318,11 @@ class Evaluator(object):
|
||||
return [TreeNameDefinition(context, name)]
|
||||
elif type_ == 'param':
|
||||
return [ParamName(context, name)]
|
||||
elif type_ in ('funcdef', 'classdef'):
|
||||
return [TreeNameDefinition(context, name)]
|
||||
elif type_ in ('import_from', 'import_name'):
|
||||
module_names = imports.infer_import(context, name, is_goto=True)
|
||||
return module_names
|
||||
else:
|
||||
return [TreeNameDefinition(context, name)]
|
||||
else:
|
||||
contexts = self._follow_error_node_imports_if_possible(context, name)
|
||||
if contexts is not None:
|
||||
|
||||
@@ -203,9 +203,10 @@ for key, value in [(1,2)]:
|
||||
#! ['for key, value in [(1,2)]: key']
|
||||
key
|
||||
|
||||
for i in []:
|
||||
#! ['for i in []: i']
|
||||
i
|
||||
#! 4 ['for y in [1]: y']
|
||||
for y in [1]:
|
||||
#! ['for y in [1]: y']
|
||||
y
|
||||
|
||||
# -----------------
|
||||
# decorator
|
||||
|
||||
Reference in New Issue
Block a user