1
0
forked from VimPlug/jedi

make the invalidate_star_import stuff easier

This commit is contained in:
Dave Halter
2014-01-05 10:18:04 +01:00
parent 1b40414d90
commit 4fdfbcd7e4
2 changed files with 19 additions and 12 deletions

View File

@@ -77,14 +77,10 @@ class ModuleWithCursor(object):
def parser(self):
""" get the parser lazy """
if not self._parser:
with common.ignored(KeyError):
parser = cache.parser_cache[self.path].parser
cache.invalidate_star_import_cache(parser.module)
# Call the parser already here, because it will be used anyways.
# Also, the position is here important (which will not be used by
# default), therefore fill the cache here.
cache.invalidate_star_import_cache(self.path)
self._parser = fast.FastParser(self.source, self.path, self.position)
# don't pickle that module, because it's changing fast
# don't pickle that module, because the main module is changing
# quickly usually.
cache.save_parser(self.path, self.name, self._parser,
pickling=False)
return self._parser