1
0
forked from VimPlug/jedi

Fix: Nested flows user scope detection was wrong.

This commit is contained in:
Dave Halter
2015-11-25 21:36:17 +01:00
parent 17ab7bbc3d
commit 9dbfb90c20
2 changed files with 3 additions and 4 deletions

View File

@@ -301,7 +301,7 @@ class Script(object):
return []
scopes = [i]
else:
# just parse one statement, take it and evaluate it
# Just parse one statement, take it and evaluate it.
eval_stmt = self._get_under_cursor_stmt(goto_path)
if eval_stmt is None:
return []

View File

@@ -325,11 +325,10 @@ class UserContextParser(object):
for s in scope.children:
if s.start_pos <= self._position <= s.end_pos:
if isinstance(s, (tree.Scope, tree.Flow)):
if isinstance(s, tree.Flow):
return s
return scan(s) or s
elif s.type in ('suite', 'decorated'):
return scan(s)
return None
return scan(self.module()) or self.module()
else: