mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
goto should work on globals
This commit is contained in:
@@ -160,7 +160,8 @@ class NameFinder(object):
|
|||||||
# it's kind of hard, because for Jedi it's not clear
|
# it's kind of hard, because for Jedi it's not clear
|
||||||
# that that name has not been defined, yet.
|
# that that name has not been defined, yet.
|
||||||
if n.tree_name == self._name:
|
if n.tree_name == self._name:
|
||||||
if self._name.get_definition().type == 'import_from':
|
def_ = self._name.get_definition()
|
||||||
|
if def_ is not None and def_.type == 'import_from':
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ ret()[0]
|
|||||||
# -----------------
|
# -----------------
|
||||||
|
|
||||||
def global_define():
|
def global_define():
|
||||||
|
#? int()
|
||||||
global global_var_in_func
|
global global_var_in_func
|
||||||
global_var_in_func = 3
|
global_var_in_func = 3
|
||||||
|
|
||||||
@@ -168,6 +169,7 @@ def funct1():
|
|||||||
global global_dict_var
|
global global_dict_var
|
||||||
global_dict_var = dict()
|
global_dict_var = dict()
|
||||||
def funct2():
|
def funct2():
|
||||||
|
#! ['global_dict_var', 'global_dict_var']
|
||||||
global global_dict_var
|
global global_dict_var
|
||||||
#? dict()
|
#? dict()
|
||||||
global_dict_var
|
global_dict_var
|
||||||
|
|||||||
Reference in New Issue
Block a user