mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Always use the parser of the environment
This commit is contained in:
@@ -12,7 +12,6 @@ arguments.
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import parso
|
|
||||||
from parso.python import tree
|
from parso.python import tree
|
||||||
from parso import python_bytes_to_unicode, split_lines
|
from parso import python_bytes_to_unicode, split_lines
|
||||||
|
|
||||||
@@ -113,7 +112,6 @@ class Script(object):
|
|||||||
debug.reset_time()
|
debug.reset_time()
|
||||||
|
|
||||||
# Load the Python grammar of the current interpreter.
|
# Load the Python grammar of the current interpreter.
|
||||||
self._grammar = parso.load_grammar()
|
|
||||||
project = Project(sys_path=sys_path)
|
project = Project(sys_path=sys_path)
|
||||||
self._evaluator = Evaluator(project, environment)
|
self._evaluator = Evaluator(project, environment)
|
||||||
project.add_script_path(self.path)
|
project.add_script_path(self.path)
|
||||||
@@ -121,7 +119,7 @@ class Script(object):
|
|||||||
|
|
||||||
@cache.memoize_method
|
@cache.memoize_method
|
||||||
def _get_module_node(self):
|
def _get_module_node(self):
|
||||||
return self._grammar.parse(
|
return self._evaluator.grammar.parse(
|
||||||
code=self._source,
|
code=self._source,
|
||||||
path=self.path,
|
path=self.path,
|
||||||
cache=False, # No disk cache, because the current script often changes.
|
cache=False, # No disk cache, because the current script often changes.
|
||||||
|
|||||||
Reference in New Issue
Block a user