diff --git a/jedi/api.py b/jedi/api.py index 7975e94e..1d44d203 100644 --- a/jedi/api.py +++ b/jedi/api.py @@ -502,9 +502,9 @@ class Script(object): return [] user_stmt = self._user_stmt() - with common.scale_speed_settings(settings.scale_function_definition): + with common.scale_speed_settings(settings.scale_call_signatures): _callable = lambda: evaluate.follow_call(call) - origins = cache.cache_function_definition(_callable, user_stmt) + origins = cache.cache_call_signatures(_callable, user_stmt) debug.speed('func_call followed') return [api_classes.CallDef(o, index, call) for o in origins @@ -516,7 +516,7 @@ class Script(object): if call is None: user_stmt = self._user_stmt() if user_stmt is not None and isinstance(user_stmt, pr.Statement): - call, index, _ = helpers.search_function_definition( + call, index, _ = helpers.search_call_signatures( user_stmt, self._pos) debug.speed('func_call parsed') return call, index diff --git a/jedi/cache.py b/jedi/cache.py index ba3c1fcc..485dfee8 100644 --- a/jedi/cache.py +++ b/jedi/cache.py @@ -141,8 +141,8 @@ def time_cache(time_add_setting): return _temp -@time_cache("function_definition_validity") -def cache_function_definition(stmt): +@time_cache("call_signatures_validity") +def cache_call_signatures(stmt): module_path = stmt.get_parent_until().path return None if module_path is None else (module_path, stmt.start_pos) diff --git a/jedi/helpers.py b/jedi/helpers.py index dc07d5dc..d8d2e1e4 100644 --- a/jedi/helpers.py +++ b/jedi/helpers.py @@ -111,7 +111,7 @@ def array_for_pos(stmt, pos, array_types=None): return None, 0 -def search_function_definition(stmt, pos): +def search_call_signatures(stmt, pos): """ Returns the function Call that matches the position before. """ diff --git a/jedi/settings.py b/jedi/settings.py index b2257aec..c8a335f8 100644 --- a/jedi/settings.py +++ b/jedi/settings.py @@ -64,14 +64,14 @@ definitely worse in some cases. But a completion should also be fast. .. autodata:: max_function_recursion_level .. autodata:: max_executions_without_builtins .. autodata:: max_executions -.. autodata:: scale_function_definition +.. autodata:: scale_call_signatures Caching ~~~~~~~ .. autodata:: star_import_cache_validity -.. autodata:: function_definition_validity +.. autodata:: call_signatures_validity """ @@ -211,9 +211,9 @@ max_executions = 250 A maximum amount of time, the completion may use. """ -scale_function_definition = 0.1 +scale_call_signatures = 0.1 """ -Because function_definition is normally used on every single key hit, it has +Because call_signatures is normally used on every single key hit, it has to be faster than a normal completion. This is the factor that is used to scale `max_executions` and `max_until_execution_unique`: """ @@ -229,7 +229,7 @@ might be slow, therefore we do a star import caching, that lasts a certain time span (in seconds). """ -function_definition_validity = 3.0 +call_signatures_validity = 3.0 """ Finding function calls might be slow (0.1-0.5s). This is not acceptible for normal writing. Therefore cache it for a short time.