1
0
forked from VimPlug/jedi

Finally get rid of the last get_definition.

This commit is contained in:
Dave Halter
2017-09-03 00:07:14 +02:00
parent 333babea39
commit fc8326bca1

View File

@@ -97,7 +97,11 @@ def _get_code_for_stack(code_lines, module_node, position):
if leaf == ';': if leaf == ';':
user_stmt = leaf.parent user_stmt = leaf.parent
else: else:
user_stmt = leaf.get_definition() user_stmt = leaf
while True:
if user_stmt.parent.type in ('file_input', 'suite'):
break
user_stmt = user_stmt.parent
if user_stmt.parent.type == 'simple_stmt': if user_stmt.parent.type == 'simple_stmt':
user_stmt = user_stmt.parent user_stmt = user_stmt.parent