forked from VimPlug/jedi
Fix issues with buggy trailers in dynamic params.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user