1
0
forked from VimPlug/jedi

merged module_cache into parser_cache

This commit is contained in:
David Halter
2013-01-11 23:19:22 +01:00
parent 21ae8e4266
commit 2efb93273a
5 changed files with 19 additions and 23 deletions

View File

@@ -140,12 +140,13 @@ class CachedFastParser(type):
if not settings.fast_parser:
return parsing.PyFuzzyParser(source, module_path, user_position)
p = cache.parser_cache.get(module_path, None)
if p is None or isinstance(p, parsing.PyFuzzyParser):
pi = cache.parser_cache.get(module_path, None)
if pi is None or isinstance(pi.parser, parsing.PyFuzzyParser):
p = super(CachedFastParser, self).__call__(source, module_path,
user_position)
cache.parser_cache[module_path] = p
else:
p = pi.parser # pi is a `cache.ParserCacheItem`
p.update(source, user_position)
return p