mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
Fix an async funcdef issue, fixes 1092.
This commit is contained in:
@@ -88,10 +88,12 @@ def get_flow_branch_keyword(flow_node, node):
|
|||||||
keyword = first_leaf
|
keyword = first_leaf
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def get_statement_of_position(node, pos):
|
def get_statement_of_position(node, pos):
|
||||||
for c in node.children:
|
for c in node.children:
|
||||||
if c.start_pos <= pos <= c.end_pos:
|
if c.start_pos <= pos <= c.end_pos:
|
||||||
if c.type not in ('decorated', 'simple_stmt', 'suite') \
|
if c.type not in ('decorated', 'simple_stmt', 'suite',
|
||||||
|
'async_stmt', 'async_funcdef') \
|
||||||
and not isinstance(c, (tree.Flow, tree.ClassOrFunc)):
|
and not isinstance(c, (tree.Flow, tree.ClassOrFunc)):
|
||||||
return c
|
return c
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -73,3 +73,12 @@ async def wrapper():
|
|||||||
asgen().__ane
|
asgen().__ane
|
||||||
#? []
|
#? []
|
||||||
asgen().mro
|
asgen().mro
|
||||||
|
|
||||||
|
|
||||||
|
# Normal completion (#1092)
|
||||||
|
normal_var1 = 42
|
||||||
|
|
||||||
|
async def foo():
|
||||||
|
normal_var2 = False
|
||||||
|
#? ['normal_var1', 'normal_var2']
|
||||||
|
normal_var
|
||||||
|
|||||||
Reference in New Issue
Block a user