Skip to content
Browse files

Don't break if imports are found for a given prefix, continue scannin…

…g and merge additional results if available (necessary to provide complete import completions for Python packages sharing a common namespace).
1 parent 9e1b54f commit 38f0cc55e9d3b06b7ad592ac6844dea9fef9cd9d @fabiocorneti committed
Showing with 3 additions and 5 deletions.
  1. +3 −5 libs/codeintel2/database/langlib.py
View
8 libs/codeintel2/database/langlib.py
@@ -153,19 +153,17 @@ def get_blob_imports(self, prefix):
try:
if prefix not in self._blob_imports_from_prefix_cache:
if prefix:
+ imports = set()
for dir in self.dirs:
importables = self._importables_from_dir(dir)
if prefix[0] in importables:
sub_importables = self._importables_from_dir(
join(dir, *prefix))
- imports = set(
+ imports = imports.union(set(
(name, is_dir_import)
for name, (_, _, is_dir_import)
in sub_importables.items()
- )
- break
- else:
- imports = set()
+ ))
else:
imports = set()
for dir in self.dirs:

0 comments on commit 38f0cc5

Please sign in to comment.
Something went wrong with that request. Please try again.