goto should work on globals

This commit is contained in:
Dave Halter
2019-05-31 17:41:34 +02:00
parent d9332aec8c
commit d6c89ced99
2 changed files with 4 additions and 1 deletions

View File

@@ -160,7 +160,8 @@ class NameFinder(object):
# it's kind of hard, because for Jedi it's not clear
# that that name has not been defined, yet.
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
break

View File

@@ -153,6 +153,7 @@ ret()[0]
# -----------------
def global_define():
#? int()
global global_var_in_func
global_var_in_func = 3
@@ -168,6 +169,7 @@ def funct1():
global global_dict_var
global_dict_var = dict()
def funct2():
#! ['global_dict_var', 'global_dict_var']
global global_dict_var
#? dict()
global_dict_var