use scope_names_generator in completion api as well. hopefully the last __file__ related issue :)

This commit is contained in:
Dave Halter
2014-07-02 13:12:37 +02:00
parent ea72b46fe8
commit 23008d8a19
2 changed files with 13 additions and 4 deletions

View File

@@ -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))

View File

@@ -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():