mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-09 21:42:20 +08:00
Fix a globals context issue, fixes #1435
This commit is contained in:
@@ -188,6 +188,14 @@ def init_global_var_predefined():
|
||||
global_var_predefined
|
||||
|
||||
|
||||
def global_as_import():
|
||||
from import_tree import globals
|
||||
#? ['foo']
|
||||
globals.foo
|
||||
#? int()
|
||||
globals.foo
|
||||
|
||||
|
||||
# -----------------
|
||||
# within docstrs
|
||||
# -----------------
|
||||
|
||||
5
test/completion/import_tree/globals.py
Normal file
5
test/completion/import_tree/globals.py
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
def something():
|
||||
global foo
|
||||
foo = 3
|
||||
@@ -75,7 +75,7 @@ from import_tree.pkg.mod1 import not_existant, # whitespace before
|
||||
from import_tree.pkg.mod1 import not_existant,
|
||||
#? 22 ['mod1']
|
||||
from import_tree.pkg. import mod1
|
||||
#? 17 ['mod1', 'mod2', 'random', 'pkg', 'rename1', 'rename2', 'classes', 'recurse_class1', 'recurse_class2', 'invisible_pkg', 'flow_import']
|
||||
#? 17 ['mod1', 'mod2', 'random', 'pkg', 'rename1', 'rename2', 'classes', 'globals', 'recurse_class1', 'recurse_class2', 'invisible_pkg', 'flow_import']
|
||||
from import_tree. import pkg
|
||||
|
||||
#? 18 ['pkg']
|
||||
|
||||
Reference in New Issue
Block a user