1
0
forked from VimPlug/jedi

Some more extract improvements

This commit is contained in:
Dave Halter
2020-02-23 12:06:37 +01:00
parent cc8483a07a
commit da935baa99
2 changed files with 13 additions and 3 deletions

View File

@@ -442,8 +442,16 @@ def _find_non_global_names(context, nodes):
children = node.children
except AttributeError:
if node.type == 'name':
yield node.value
name_definitions = context.goto(node, node.start_pos)
if not name_definitions \
or any(not n.parent_context.is_module() or n.api_type == 'param'
for n in name_definitions):
yield node.value
else:
# We only want to check foo in foo.bar
if node.type == 'trailer' and node.children[0] == '.':
continue
for x in _find_non_global_names(context, children): # Python 2...
yield x