forked from VimPlug/jedi
scan_statement -> scan_statement_for_calls
This commit is contained in:
@@ -766,7 +766,7 @@ def usages(evaluator, definitions, search_name, mods):
|
||||
if set(f) & set(definitions):
|
||||
names.append(api_classes.Usage(evaluator, name_part, stmt))
|
||||
else:
|
||||
for call in helpers.scan_statement(stmt, search_name,
|
||||
for call in helpers.scan_statements(stmt, search_name,
|
||||
assignment_details=True):
|
||||
names += check_call(call)
|
||||
return names
|
||||
|
||||
@@ -103,7 +103,7 @@ def search_params(evaluator, param):
|
||||
for stmt in possible_stmts:
|
||||
if isinstance(stmt, pr.Import):
|
||||
continue
|
||||
calls = helpers.scan_statement(stmt, func_name)
|
||||
calls = helpers.scan_statement_for_calls(stmt, func_name)
|
||||
for c in calls:
|
||||
# no execution means that params cannot be set
|
||||
call_path = list(c.generate_call_path())
|
||||
|
||||
@@ -170,17 +170,17 @@ def search_call_signatures(stmt, pos):
|
||||
return None, 0, False
|
||||
|
||||
|
||||
def scan_statement(stmt, search_name, assignment_details=False):
|
||||
""" Returns the function Call that match search_name in an Array. """
|
||||
def scan_statement_for_calls(stmt, search_name, assignment_details=False):
|
||||
""" Returns the function Calls that match search_name in an Array. """
|
||||
def scan_array(arr, search_name):
|
||||
result = []
|
||||
if arr.type == pr.Array.DICT:
|
||||
for key_stmt, value_stmt in arr.items():
|
||||
result += scan_statement(key_stmt, search_name)
|
||||
result += scan_statement(value_stmt, search_name)
|
||||
result += scan_statement_for_calls(key_stmt, search_name)
|
||||
result += scan_statement_for_calls(value_stmt, search_name)
|
||||
else:
|
||||
for stmt in arr:
|
||||
result += scan_statement(stmt, search_name)
|
||||
result += scan_statement_for_calls(stmt, search_name)
|
||||
return result
|
||||
|
||||
check = list(stmt.expression_list())
|
||||
|
||||
@@ -330,7 +330,7 @@ def _check_array_additions(evaluator, compare_array, module, is_list):
|
||||
# check recursion
|
||||
continue
|
||||
|
||||
res += check_calls(helpers.scan_statement(stmt, n), n)
|
||||
res += check_calls(helpers.scan_statement_for_calls(stmt, n), n)
|
||||
evaluator.recursion_detector.pop_stmt()
|
||||
# reset settings
|
||||
settings.dynamic_params_for_other_modules = temp_param_add
|
||||
|
||||
Reference in New Issue
Block a user