forked from VimPlug/jedi
Fix: Nested flows user scope detection was wrong.
This commit is contained in:
@@ -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 []
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user