forked from VimPlug/jedi
Refactor things so goto is working in both directions
This commit is contained in:
@@ -19,18 +19,13 @@ def load_proper_stub_module(evaluator, path, import_names, module_node):
|
||||
import_names = import_names[:-1]
|
||||
|
||||
if import_names is not None:
|
||||
actual_context_set = evaluator.import_module(import_names)
|
||||
actual_context_set = evaluator.import_module(import_names, prefer_stubs=False)
|
||||
if not actual_context_set:
|
||||
return None
|
||||
|
||||
context_set = create_stub_module(
|
||||
stub = create_stub_module(
|
||||
evaluator, actual_context_set, module_node, path, import_names
|
||||
)
|
||||
for m in context_set:
|
||||
# Try to load the modules in a way where they are loaded
|
||||
# correctly as stubs and not as actual modules (which is what
|
||||
# will happen if this condition isn't True).
|
||||
if m.stub_context.py__file__() == path:
|
||||
evaluator.module_cache.add(import_names, context_set)
|
||||
return m.stub_context
|
||||
evaluator.stub_module_cache[import_names] = stub
|
||||
return stub
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user