From f4b585a5e76651890ec5852ef132e7098e326c91 Mon Sep 17 00:00:00 2001 From: David Halter Date: Fri, 21 Dec 2012 18:00:21 +0100 Subject: [PATCH] added an option to disable get_in_function_call caching --- jedi/api.py | 12 +++++++----- jedi/settings.py | 5 +++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/jedi/api.py b/jedi/api.py index e3a49ce1..46407999 100644 --- a/jedi/api.py +++ b/jedi/api.py @@ -386,11 +386,12 @@ class Script(object): raise NotFoundError() debug.speed('func_call start') - try: - call, index = check_cache() - except NotFoundError: - return None - debug.speed('func_call parsed') + call = None + if settings.use_get_in_function_call_cache: + try: + call, index = check_cache() + except NotFoundError: + return None if call is None: # This is a backup, if the above is not successful. @@ -398,6 +399,7 @@ class Script(object): call, index = check_user_stmt(user_stmt) if call is None: return None + debug.speed('func_call parsed') debug.speed('func_call user_stmt') with common.scale_speed_settings(settings.scale_get_in_function_call): diff --git a/jedi/settings.py b/jedi/settings.py index 789ac955..736c561f 100644 --- a/jedi/settings.py +++ b/jedi/settings.py @@ -27,6 +27,11 @@ fast_parser = True # is basically useless. So don't use it. fast_parser_always_reparse = False +# Use the cache (full cache) to generate get_in_function_call's. This may fail +# with multiline docstrings (likely) and other complicated changes to the fail +# (unlikely). The goal is to move away from it by making the rest faster. +use_get_in_function_call_cache = True + # ---------------- # dynamic stuff # ----------------