mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-27 09:32:18 +08:00
Try to get some more stub to definitions working and vice versa
This commit is contained in:
@@ -85,7 +85,8 @@ from jedi.evaluate.context.iterable import CompForContext
|
||||
from jedi.evaluate.syntax_tree import eval_trailer, eval_expr_stmt, \
|
||||
eval_node, check_tuple_assignments
|
||||
from jedi.evaluate.gradual.stub_context import with_stub_context_if_possible, \
|
||||
stub_to_actual_context_set, goto_with_stubs_if_possible, goto_non_stub
|
||||
stub_to_actual_context_set, goto_with_stubs_if_possible, goto_non_stub, \
|
||||
stubify
|
||||
|
||||
|
||||
def _execute(context, arguments):
|
||||
@@ -443,6 +444,7 @@ class Evaluator(object):
|
||||
cls = FunctionContext
|
||||
|
||||
func = cls.from_context(parent_context, scope_node)
|
||||
func = next(iter(stubify(func)))
|
||||
|
||||
if parent_was_class:
|
||||
func = BoundMethod(
|
||||
@@ -453,7 +455,10 @@ class Evaluator(object):
|
||||
return func.get_function_execution()
|
||||
return func
|
||||
elif scope_node.type == 'classdef':
|
||||
return ClassContext(self, parent_context, scope_node)
|
||||
return next(iter(stubify(
|
||||
parent_context,
|
||||
ClassContext(self, parent_context, scope_node)
|
||||
)))
|
||||
elif scope_node.type == 'comp_for':
|
||||
if node.start_pos >= scope_node.children[-1].start_pos:
|
||||
return parent_context
|
||||
|
||||
Reference in New Issue
Block a user