forked from VimPlug/jedi
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)
|
Jean-Louis Fuchs (@ganwell)
|
||||||
tek (@tek)
|
tek (@tek)
|
||||||
Yasha Borevich (@jjay)
|
Yasha Borevich (@jjay)
|
||||||
Aaron Griffin
|
Aaron Griffin <aaronmgriffin@gmail.com>
|
||||||
andviro (@andviro)
|
andviro (@andviro)
|
||||||
Mike Gilbert (@floppym)
|
Mike Gilbert (@floppym)
|
||||||
Aaron Meurer (@asmeurer)
|
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)
|
result.append(par)
|
||||||
else:
|
else:
|
||||||
|
# TODO multi-level import non-breakable
|
||||||
|
if isinstance(par, pr.Import) and len(par.namespace) > 1:
|
||||||
|
no_break_scope = True
|
||||||
result.append(par)
|
result.append(par)
|
||||||
return result, no_break_scope
|
return result, no_break_scope
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,17 @@ def scope_nested():
|
|||||||
#? set
|
#? set
|
||||||
import_tree.random.a
|
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
|
# std lib modules
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user