mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Apparently a change we made does not seem to be needed
This commit is contained in:
@@ -9,13 +9,11 @@ from parso.python.parser import Parser
|
|||||||
from parso.python import tree
|
from parso.python import tree
|
||||||
|
|
||||||
from jedi._compatibility import u
|
from jedi._compatibility import u
|
||||||
from jedi.evaluate.base_context import NO_CONTEXTS, ContextSet
|
from jedi.evaluate.base_context import NO_CONTEXTS
|
||||||
from jedi.evaluate.syntax_tree import eval_atom
|
from jedi.evaluate.syntax_tree import eval_atom
|
||||||
from jedi.evaluate.helpers import evaluate_call_of_leaf
|
from jedi.evaluate.helpers import evaluate_call_of_leaf
|
||||||
from jedi.evaluate.compiled import get_string_context_set
|
from jedi.evaluate.compiled import get_string_context_set
|
||||||
from jedi.cache import call_signature_time_cache
|
from jedi.cache import call_signature_time_cache
|
||||||
from jedi.evaluate.gradual.conversion import convert_names
|
|
||||||
from jedi.evaluate.names import TreeNameDefinition
|
|
||||||
|
|
||||||
|
|
||||||
CompletionParts = namedtuple('CompletionParts', ['path', 'has_dot', 'name'])
|
CompletionParts = namedtuple('CompletionParts', ['path', 'has_dot', 'name'])
|
||||||
@@ -143,13 +141,7 @@ def evaluate_goto_definition(evaluator, context, leaf):
|
|||||||
if leaf.type == 'name':
|
if leaf.type == 'name':
|
||||||
# In case of a name we can just use goto_definition which does all the
|
# In case of a name we can just use goto_definition which does all the
|
||||||
# magic itself.
|
# magic itself.
|
||||||
print(leaf.parent)
|
return evaluator.goto_definitions(context, leaf)
|
||||||
if leaf.parent.type in ('trailer', 'error_node', 'dotted_name'):
|
|
||||||
return evaluator.goto_definitions(context, leaf)
|
|
||||||
name = TreeNameDefinition(context, leaf)
|
|
||||||
return ContextSet.from_sets(
|
|
||||||
name.infer() for name in convert_names([name], prefer_stubs=True)
|
|
||||||
)
|
|
||||||
|
|
||||||
parent = leaf.parent
|
parent = leaf.parent
|
||||||
definitions = NO_CONTEXTS
|
definitions = NO_CONTEXTS
|
||||||
|
|||||||
Reference in New Issue
Block a user