forked from VimPlug/jedi
Fix some fstring issues for now
This commit is contained in:
@@ -11,6 +11,8 @@ from parso.python import tree
|
||||
from jedi._compatibility import u
|
||||
from jedi.evaluate.syntax_tree import eval_atom
|
||||
from jedi.evaluate.helpers import evaluate_call_of_leaf
|
||||
from jedi.evaluate.compiled import get_string_context_set
|
||||
from jedi.evaluate.base_context import ContextSet
|
||||
from jedi.cache import time_cache
|
||||
|
||||
|
||||
@@ -193,6 +195,8 @@ def evaluate_goto_definition(evaluator, context, leaf):
|
||||
return evaluate_call_of_leaf(context, leaf)
|
||||
elif isinstance(leaf, tree.Literal):
|
||||
return eval_atom(context, leaf)
|
||||
elif leaf.type == 'fstring_string':
|
||||
return get_string_context_set(evaluator)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,10 @@ def get_special_object(evaluator, identifier):
|
||||
)
|
||||
|
||||
|
||||
def get_string_context_set(evaluator):
|
||||
return builtin_from_name(evaluator, u'str').execute_evaluated()
|
||||
|
||||
|
||||
def load_module(evaluator, **kwargs):
|
||||
access_path = evaluator.compiled_subprocess.load_module(**kwargs)
|
||||
if access_path is None:
|
||||
|
||||
@@ -23,8 +23,7 @@ class _ModuleAttributeName(AbstractNameDefinition):
|
||||
self.string_name = string_name
|
||||
|
||||
def infer(self):
|
||||
ctx = compiled.builtin_from_name(self.parent_context.evaluator, u'str')
|
||||
return ctx.execute_evaluated()
|
||||
return compiled.get_string_context_set(self.parent_context.evaluator)
|
||||
|
||||
|
||||
class ModuleName(ContextNameMixin, AbstractNameDefinition):
|
||||
|
||||
Reference in New Issue
Block a user