mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Fix an import names completion issue
This commit is contained in:
@@ -352,17 +352,24 @@ class Importer(object):
|
|||||||
if os.path.isdir(flaskext):
|
if os.path.isdir(flaskext):
|
||||||
names += self._get_module_names([flaskext])
|
names += self._get_module_names([flaskext])
|
||||||
|
|
||||||
for context in self.follow():
|
contexts = self.follow()
|
||||||
|
for context in contexts:
|
||||||
# Non-modules are not completable.
|
# Non-modules are not completable.
|
||||||
if context.api_type != 'module': # not a module
|
if context.api_type != 'module': # not a module
|
||||||
continue
|
continue
|
||||||
names += context.sub_modules_dict().values()
|
names += context.sub_modules_dict().values()
|
||||||
|
|
||||||
if only_modules:
|
if not only_modules:
|
||||||
continue
|
from jedi.evaluate.gradual.conversion import stub_to_actual_context_set
|
||||||
|
contexts = ContextSet([context])
|
||||||
for filter in context.get_filters(search_global=False):
|
both_contexts = ContextSet.from_sets(
|
||||||
names += filter.values()
|
stub_to_actual_context_set(context, ignore_compiled=True)
|
||||||
|
for context in contexts
|
||||||
|
if context.is_stub()
|
||||||
|
) | contexts
|
||||||
|
for c in both_contexts:
|
||||||
|
for filter in c.get_filters(search_global=False):
|
||||||
|
names += filter.values()
|
||||||
else:
|
else:
|
||||||
if self.level:
|
if self.level:
|
||||||
# We only get here if the level cannot be properly calculated.
|
# We only get here if the level cannot be properly calculated.
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ with_stub.in_
|
|||||||
#? ['in_with_stub_both', 'in_with_stub_python', 'in_with_stub_stub']
|
#? ['in_with_stub_both', 'in_with_stub_python', 'in_with_stub_stub']
|
||||||
from stub_folder.with_stub import in_
|
from stub_folder.with_stub import in_
|
||||||
|
|
||||||
#? ['with_stub', 'stub_only']
|
#? ['with_stub', 'stub_only', 'with_stub_folder', 'stub_only_folder']
|
||||||
from stub_folder.
|
from stub_folder.
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user