forked from VimPlug/jedi
Only resolve names for actual modules
A name can be part of an import statement without being a module.
This commit is contained in:
@@ -14,8 +14,9 @@ def usages(evaluator, definition_names, mods):
|
||||
if name.api_type == 'module':
|
||||
found = False
|
||||
for context in name.infer():
|
||||
found = True
|
||||
yield context.name
|
||||
if isinstance(context, ModuleContext):
|
||||
found = True
|
||||
yield context.name
|
||||
if not found:
|
||||
yield name
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user