1
0
forked from VimPlug/jedi

clean up caches clearing

This commit is contained in:
Dave Halter
2013-12-26 02:10:30 +01:00
parent 947e616da0
commit 8f564a301f
4 changed files with 9 additions and 24 deletions

View File

@@ -17,18 +17,13 @@ from jedi import keywords
from jedi.evaluate import dynamic
def _clear_caches():
def clear_caches():
"""
Clear all caches of this and related modules. The only cache that will not
be deleted is the module cache.
"""
cache.clear_caches()
dynamic.search_param_cache.clear()
recursion.ExecutionRecursionDecorator.reset()
evaluate.follow_statement.reset()
imports.imports_processed = 0
def _clear_caches_after_call(func):
@@ -38,7 +33,7 @@ def _clear_caches_after_call(func):
@functools.wraps(func)
def wrapper(*args, **kwds):
result = func(*args, **kwds)
_clear_caches()
clear_caches()
return result
return wrapper
@@ -416,7 +411,7 @@ class Completion(BaseDefinition):
self._followed_definitions = \
[BaseDefinition(d, d.start_pos) for d in defs]
_clear_caches()
clear_caches()
return self._followed_definitions