forked from VimPlug/jedi
fix list comprehension issues in nested parentheses.
This commit is contained in:
@@ -476,8 +476,10 @@ def get_names_of_scope(evaluator, scope, position=None, star_search=True, includ
|
|||||||
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.
|
||||||
# we don't want submodules to report if we have modules.
|
# As well as some non-scopes, which are parents of list comprehensions.
|
||||||
|
if isinstance(scope, pr.SubModule) and scope.parent \
|
||||||
|
or not isinstance(scope, pr.IsScope):
|
||||||
scope = scope.parent
|
scope = scope.parent
|
||||||
continue
|
continue
|
||||||
# `pr.Class` is used, because the parent is never `Class`.
|
# `pr.Class` is used, because the parent is never `Class`.
|
||||||
|
|||||||
@@ -151,6 +151,10 @@ def listen(arg):
|
|||||||
x
|
x
|
||||||
|
|
||||||
listen(['' for x in [1]])
|
listen(['' for x in [1]])
|
||||||
|
#? str()
|
||||||
|
([str for x in []])[0]
|
||||||
|
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# nested list comprehensions
|
# nested list comprehensions
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user