forked from VimPlug/jedi
The parser_cache contents have changed. Therefore adapt.
This commit is contained in:
@@ -389,7 +389,7 @@ class BaseDefinition(object):
|
|||||||
return ''
|
return ''
|
||||||
|
|
||||||
path = self._name.get_root_context().py__file__()
|
path = self._name.get_root_context().py__file__()
|
||||||
lines = parser_cache[path].lines
|
lines = parser_cache[self._evaluator.grammar._hashed][path].lines
|
||||||
|
|
||||||
line_nr = self._name.start_pos[0]
|
line_nr = self._name.start_pos[0]
|
||||||
start_line_nr = line_nr - before
|
start_line_nr = line_nr - before
|
||||||
|
|||||||
@@ -13,9 +13,10 @@ from parso import cache
|
|||||||
def test_preload_modules():
|
def test_preload_modules():
|
||||||
def check_loaded(*modules):
|
def check_loaded(*modules):
|
||||||
# +1 for None module (currently used)
|
# +1 for None module (currently used)
|
||||||
assert len(parser_cache) == len(modules) + 1
|
grammar_cache = next(iter(parser_cache.values()))
|
||||||
|
assert len(grammar_cache) == len(modules) + 1
|
||||||
for i in modules:
|
for i in modules:
|
||||||
assert [i in k for k in parser_cache.keys() if k is not None]
|
assert [i in k for k in grammar_cache.keys() if k is not None]
|
||||||
|
|
||||||
temp_cache, cache.parser_cache = cache.parser_cache, {}
|
temp_cache, cache.parser_cache = cache.parser_cache, {}
|
||||||
parser_cache = cache.parser_cache
|
parser_cache = cache.parser_cache
|
||||||
|
|||||||
Reference in New Issue
Block a user