forked from VimPlug/jedi
don't use SubModule's in the scope list if it has a parent
This commit is contained in:
@@ -159,6 +159,10 @@ def get_names_of_scope(scope, position=None, star_search=True,
|
|||||||
in_func_scope = scope
|
in_func_scope = scope
|
||||||
non_flow = scope.get_parent_until(pr.Flow, reverse=True)
|
non_flow = scope.get_parent_until(pr.Flow, reverse=True)
|
||||||
while scope:
|
while scope:
|
||||||
|
if isinstance(scope, pr.SubModule) and scope.parent:
|
||||||
|
# we don't want submodules to report if we have modules.
|
||||||
|
scope = scope.parent
|
||||||
|
continue
|
||||||
# `pr.Class` is used, because the parent is never `Class`.
|
# `pr.Class` is used, because the parent is never `Class`.
|
||||||
# Ignore the Flows, because the classes and functions care for that.
|
# Ignore the Flows, because the classes and functions care for that.
|
||||||
# InstanceElement of Class is ignored, if it is not the start scope.
|
# InstanceElement of Class is ignored, if it is not the start scope.
|
||||||
|
|||||||
@@ -392,6 +392,7 @@ class FastParser(use_metaclass(CachedFastParser)):
|
|||||||
p = parsing.Parser(parser_code, self.module_path,
|
p = parsing.Parser(parser_code, self.module_path,
|
||||||
self.user_position, offset=(line_offset, 0),
|
self.user_position, offset=(line_offset, 0),
|
||||||
is_fast_parser=True, top_module=self.module)
|
is_fast_parser=True, top_module=self.module)
|
||||||
|
p.module.parent = self.module
|
||||||
else:
|
else:
|
||||||
node = nodes.pop(index)
|
node = nodes.pop(index)
|
||||||
p = node.parser
|
p = node.parser
|
||||||
|
|||||||
Reference in New Issue
Block a user