mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
use scope_names_generator in completion api as well. hopefully the last __file__ related issue :)
This commit is contained in:
@@ -230,7 +230,14 @@ class Script(object):
|
||||
continue
|
||||
names = s.get_defined_names(on_import_stmt=True)
|
||||
else:
|
||||
names = s.get_defined_names()
|
||||
try:
|
||||
sng = s.scope_names_generator
|
||||
except AttributeError:
|
||||
names = s.get_defined_names()
|
||||
else:
|
||||
names = []
|
||||
for _, new_names in sng():
|
||||
names += new_names
|
||||
|
||||
for c in names:
|
||||
completions.append((c, s))
|
||||
|
||||
@@ -19,8 +19,6 @@ def scope_basic():
|
||||
#? str()
|
||||
import_tree.a
|
||||
|
||||
#? []
|
||||
import_tree.mod1
|
||||
|
||||
def scope_pkg():
|
||||
import import_tree.mod1
|
||||
@@ -64,7 +62,11 @@ def scope_nested2():
|
||||
import_tree.mod1
|
||||
#? ['pkg']
|
||||
import_tree.pkg
|
||||
#? []
|
||||
|
||||
# With the latest changes this completion also works, because submodules
|
||||
# are always included (some nested import structures lead to this,
|
||||
# typically).
|
||||
#? ['rename1']
|
||||
import_tree.rename1
|
||||
|
||||
def from_names():
|
||||
|
||||
Reference in New Issue
Block a user