1
0
forked from VimPlug/jedi

Make get_module_names return top-level async functions when all_scopes=False.

This commit is contained in:
forest93
2019-04-11 23:38:55 +08:00
parent c801e24afc
commit 1e12e1e318
2 changed files with 23 additions and 4 deletions

View File

@@ -190,6 +190,9 @@ def get_module_names(module, all_scopes):
# but that would be a big change that could break type inference, whereas for now
# this discrepancy looks like only a problem for "get_module_names".
parent_scope = parent_scope.parent
# async functions have an extra wrapper. Strip it.
if parent_scope and parent_scope.type == 'async_stmt':
parent_scope = parent_scope.parent
return parent_scope in (module, None)
names = [n for n in names if is_module_scope_name(n)]