mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-15 01:57:06 +08:00
_clear_caches is now __del__
This commit is contained in:
9
api.py
9
api.py
@@ -194,7 +194,6 @@ class Script(object):
|
|||||||
completions = set(completions)
|
completions = set(completions)
|
||||||
c = [Completion(c, needs_dot, len(like), s) for c, s in completions]
|
c = [Completion(c, needs_dot, len(like), s) for c, s in completions]
|
||||||
|
|
||||||
_clear_caches()
|
|
||||||
return c
|
return c
|
||||||
|
|
||||||
def _prepare_goto(self, goto_path, is_like_search=False):
|
def _prepare_goto(self, goto_path, is_like_search=False):
|
||||||
@@ -266,7 +265,6 @@ class Script(object):
|
|||||||
scopes |= keywords.get_keywords(string=goto_path, pos=self.pos)
|
scopes |= keywords.get_keywords(string=goto_path, pos=self.pos)
|
||||||
|
|
||||||
d = set([Definition(s) for s in scopes])
|
d = set([Definition(s) for s in scopes])
|
||||||
_clear_caches()
|
|
||||||
return sorted(d, key=lambda x: (x.module_path, x.start_pos))
|
return sorted(d, key=lambda x: (x.module_path, x.start_pos))
|
||||||
|
|
||||||
def goto(self):
|
def goto(self):
|
||||||
@@ -288,7 +286,6 @@ class Script(object):
|
|||||||
definitions = evaluate.goto(scopes, search_name_new)
|
definitions = evaluate.goto(scopes, search_name_new)
|
||||||
|
|
||||||
d = [Definition(d) for d in set(definitions)]
|
d = [Definition(d) for d in set(definitions)]
|
||||||
_clear_caches()
|
|
||||||
return sorted(d, key=lambda x: (x.module_path, x.start_pos))
|
return sorted(d, key=lambda x: (x.module_path, x.start_pos))
|
||||||
|
|
||||||
def related_names(self):
|
def related_names(self):
|
||||||
@@ -353,7 +350,6 @@ class Script(object):
|
|||||||
else:
|
else:
|
||||||
names.append(dynamic.RelatedName(d.name.names[0], d))
|
names.append(dynamic.RelatedName(d.name.names[0], d))
|
||||||
|
|
||||||
_clear_caches()
|
|
||||||
return sorted(names, key=lambda x: (x.module_path, x.start_pos))
|
return sorted(names, key=lambda x: (x.module_path, x.start_pos))
|
||||||
|
|
||||||
def get_in_function_call(self):
|
def get_in_function_call(self):
|
||||||
@@ -413,9 +409,8 @@ class Script(object):
|
|||||||
match = re.match(r'^(.*?)(\.|)(\w?[\w\d]*)$', path, flags=re.S)
|
match = re.match(r'^(.*?)(\.|)(\w?[\w\d]*)$', path, flags=re.S)
|
||||||
return match.groups()
|
return match.groups()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
def _clear_caches():
|
evaluate.clear_caches()
|
||||||
evaluate.clear_caches()
|
|
||||||
|
|
||||||
|
|
||||||
def set_debug_function(func_cb):
|
def set_debug_function(func_cb):
|
||||||
|
|||||||
Reference in New Issue
Block a user