From 0bdcc968e33478fa6451a145de8eff8b9a9d198a Mon Sep 17 00:00:00 2001 From: David Halter Date: Sat, 22 Sep 2012 00:29:03 +0200 Subject: [PATCH] removed statement_path/goto_names --- jedi/evaluate.py | 20 +------------------- jedi/imports.py | 2 -- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/jedi/evaluate.py b/jedi/evaluate.py index 6733b9fe..449f8e29 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -31,9 +31,7 @@ import helpers import dynamic memoize_caches = [] -statement_path = [] faked_scopes = [] -goto_names = None class DecoratorNotFound(LookupError): @@ -75,7 +73,7 @@ def clear_caches(): that should be completed after each completion finishes. The only things that stays is the module cache (which is not deleted here). """ - global memoize_caches, statement_path, faked_scopes, goto_names + global memoize_caches, faked_scopes for m in memoize_caches: m.clear() @@ -85,20 +83,11 @@ def clear_caches(): # memorize_caches must never be deleted, because the dicts will get lost in # the wrappers. - statement_path = [] faked_scopes = [] - goto_names = None follow_statement.reset() -def statement_path_check(function): - def wrapper(stmt, *args, **kwargs): - statement_path.append(stmt) - return function(stmt, *args, **kwargs) - return wrapper - - def memoize_default(default=None): """ This is a typical memoization decorator, BUT there is one difference: @@ -1026,7 +1015,6 @@ def get_scopes_for_name(scope, name_str, position=None, search_global=False, and r.position_nr > 0: # 0 would be self r = func.var.params[r.position_nr] if not r.is_generated: - statement_path.append(r) res_new += dynamic.search_params(r) if not r.assignment_details: # this means that there are no default params, @@ -1092,7 +1080,6 @@ def get_scopes_for_name(scope, name_str, position=None, search_global=False, # place, if the var_args are clear. But sometimes the class is # not known. Therefore add a new instance for self. Otherwise # take the existing. - statement_path.append(par) if isinstance(scope, InstanceElement): inst = scope.instance else: @@ -1145,8 +1132,6 @@ def get_scopes_for_name(scope, name_str, position=None, search_global=False, and isinstance(p.var, parsing.Class): p = p.var if name_str == name.get_code() and p not in break_scopes: - if goto_names is not None: - goto_names.append(name) r, no_break_scope = process(name) if is_goto: result.append(name) @@ -1185,8 +1170,6 @@ def get_scopes_for_name(scope, name_str, position=None, search_global=False, res_new.append(r) return res_new - if goto_names: - return [] # goto has already been used. if search_global: scope_generator = get_names_for_scope(scope, position=position) else: @@ -1314,7 +1297,6 @@ def assign_tuples(tup, results, seek_name): @helpers.RecursionDecorator -@statement_path_check @memoize_default(default=[]) def follow_statement(stmt, seek_name=None): """ diff --git a/jedi/imports.py b/jedi/imports.py index af893614..b7887840 100644 --- a/jedi/imports.py +++ b/jedi/imports.py @@ -237,8 +237,6 @@ def strip_imports(scopes): result = [] for s in scopes: if isinstance(s, parsing.Import): - # this is something like a statement following. - evaluate.statement_path.append(s) result += ImportPath(s).follow() else: result.append(s)