mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
fixed multi level import issue, includes parts of a patch by Lubos Trilety <ltrilety@redhat.com>
This commit is contained in:
@@ -13,7 +13,8 @@ Aldo Stracquadanio (@Astrac)
|
||||
Jean-Louis Fuchs (@ganwell)
|
||||
tek (@tek)
|
||||
Yasha Borevich (@jjay)
|
||||
Aaron Griffin
|
||||
Aaron Griffin <aaronmgriffin@gmail.com>
|
||||
andviro (@andviro)
|
||||
Mike Gilbert (@floppym)
|
||||
Aaron Meurer (@asmeurer)
|
||||
Lubos Trilety <ltrilety@redhat.com>
|
||||
|
||||
@@ -376,6 +376,9 @@ def find_name(scope, name_str, position=None, search_global=False,
|
||||
|
||||
result.append(par)
|
||||
else:
|
||||
# TODO multi-level import non-breakable
|
||||
if isinstance(par, pr.Import) and len(par.namespace) > 1:
|
||||
no_break_scope = True
|
||||
result.append(par)
|
||||
return result, no_break_scope
|
||||
|
||||
|
||||
@@ -56,6 +56,17 @@ def scope_nested():
|
||||
#? set
|
||||
import_tree.random.a
|
||||
|
||||
def scope_nested2():
|
||||
"""Multiple modules should be indexable, if imported"""
|
||||
import import_tree.mod1
|
||||
import import_tree.pkg
|
||||
#? ['mod1']
|
||||
import_tree.mod1
|
||||
#? ['pkg']
|
||||
import_tree.pkg
|
||||
#? []
|
||||
import_tree.rename1
|
||||
|
||||
# -----------------
|
||||
# std lib modules
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user