Try to get some more stub to definitions working and vice versa

This commit is contained in:
Dave Halter
2019-04-14 17:37:48 +02:00
parent ad0000886d
commit 6ced926db0
4 changed files with 31 additions and 6 deletions

View File

@@ -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