1
0
forked from VimPlug/jedi

Fix issues with buggy trailers in dynamic params.

This commit is contained in:
Dave Halter
2014-11-17 17:49:34 +01:00
parent b57e4c4e7c
commit ae3ff35674

View File

@@ -73,11 +73,19 @@ def search_params(evaluator, param):
stmt = name.get_definition() stmt = name.get_definition()
if not isinstance(stmt, pr.ExprStmt): if not isinstance(stmt, pr.ExprStmt):
continue continue
try: parent = name.parent
trailer = name.parent.children[1] if pr.is_node(parent, 'trailer'):
except IndexError: parent = parent.parent
continue
else: trailer = None
if pr.is_node(parent, 'power'):
for t in parent.children[1:]:
if t == '**':
break
if t.start_pos > name.start_pos and t.children[0] == '(':
trailer = t
break
if trailer is not None:
types = evaluator.goto_definition(name) types = evaluator.goto_definition(name)
# TODO why not a direct comparison? functions seem to be # TODO why not a direct comparison? functions seem to be