1
0
forked from VimPlug/jedi

move parser cache to cache.py - centralize all caches there

This commit is contained in:
David Halter
2013-01-08 12:44:32 +01:00
parent da34fc2358
commit be3d7f35cd
2 changed files with 11 additions and 5 deletions

View File

@@ -8,10 +8,16 @@ time_caches = []
star_import_cache = {}
# for fast_parser, should never be deleted
parser_cache = {}
def clear_caches(delete_all=False):
""" Jedi caches many things, that should be completed after each completion
finishes.
:param delete_all: Deletes also the cache that is normally not deleted,
like parser cache, which is important for faster parsing.
"""
global memoize_caches
@@ -31,6 +37,7 @@ def clear_caches(delete_all=False):
global time_caches
time_caches = []
star_import_cache.clear()
parser_cache.clear()
def memoize_default(default=None, cache=memoize_caches):