mirror of
https://github.com/davidhalter/jedi.git
synced 2026-03-01 07:46:50 +08:00
dynamic param completion bugfixes
This commit is contained in:
@@ -122,8 +122,10 @@ def search_params(param):
|
|||||||
calls = _scan_array(stmt.get_assignment_calls(), func_name)
|
calls = _scan_array(stmt.get_assignment_calls(), func_name)
|
||||||
for c in calls:
|
for c in calls:
|
||||||
# no execution means that params cannot be set
|
# no execution means that params cannot be set
|
||||||
if c.execution:
|
call_path = c.generate_call_path()
|
||||||
evaluate.follow_call(c)
|
pos = c.start_pos
|
||||||
|
scope = stmt.parent()
|
||||||
|
evaluate.follow_call_path(call_path, scope, pos)
|
||||||
return listener.param_possibilities
|
return listener.param_possibilities
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
@@ -184,14 +186,15 @@ def _scan_array(arr, search_name):
|
|||||||
if isinstance(s, parsing.Array):
|
if isinstance(s, parsing.Array):
|
||||||
result += _scan_array(s, search_name)
|
result += _scan_array(s, search_name)
|
||||||
elif isinstance(s, parsing.Call):
|
elif isinstance(s, parsing.Call):
|
||||||
while s is not None:
|
s_new = s
|
||||||
n = s.name
|
while s_new is not None:
|
||||||
|
n = s_new.name
|
||||||
if isinstance(n, parsing.Name) and search_name in n.names:
|
if isinstance(n, parsing.Name) and search_name in n.names:
|
||||||
result.append(s)
|
result.append(s)
|
||||||
|
|
||||||
if s.execution is not None:
|
if s_new.execution is not None:
|
||||||
result += _scan_array(s.execution, search_name)
|
result += _scan_array(s_new.execution, search_name)
|
||||||
s = s.next
|
s_new = s_new.next
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user