1
0
forked from VimPlug/jedi

don't use SubModule's in the scope list if it has a parent

This commit is contained in:
David Halter
2013-04-17 13:39:02 +04:30
parent 9181410c47
commit d82f315ea6
2 changed files with 5 additions and 0 deletions

View File

@@ -159,6 +159,10 @@ def get_names_of_scope(scope, position=None, star_search=True,
in_func_scope = scope
non_flow = scope.get_parent_until(pr.Flow, reverse=True)
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`.
# Ignore the Flows, because the classes and functions care for that.
# InstanceElement of Class is ignored, if it is not the start scope.

View File

@@ -392,6 +392,7 @@ class FastParser(use_metaclass(CachedFastParser)):
p = parsing.Parser(parser_code, self.module_path,
self.user_position, offset=(line_offset, 0),
is_fast_parser=True, top_module=self.module)
p.module.parent = self.module
else:
node = nodes.pop(index)
p = node.parser