forked from VimPlug/jedi
Fix a few remaining issues about the current branch
This commit is contained in:
@@ -320,13 +320,15 @@ class BaseDefinition(object):
|
||||
|
||||
# TODO remove this paragraph, it's ugly and shouldn't be needed
|
||||
inferred = self._name.infer()
|
||||
if not inferred:
|
||||
return None
|
||||
inferred = next(iter(inferred))
|
||||
if isinstance(inferred, MethodContext):
|
||||
c = inferred.class_context
|
||||
if inferred:
|
||||
inferred = next(iter(inferred))
|
||||
if isinstance(inferred, MethodContext):
|
||||
c = inferred.class_context
|
||||
else:
|
||||
c = self._name.parent_context
|
||||
else:
|
||||
c = self._name.parent_context
|
||||
|
||||
names = self._evaluator.goto(c, self._name.tree_name)
|
||||
return [Definition(self._evaluator, n) for n in names]
|
||||
|
||||
|
||||
@@ -439,12 +439,9 @@ class Evaluator(object):
|
||||
if parent_was_class:
|
||||
parent_context = AnonymousInstance(
|
||||
self, parent_context.parent_context, parent_context)
|
||||
cls = MethodContext
|
||||
else:
|
||||
cls = FunctionContext
|
||||
|
||||
func = cls.from_context(parent_context, scope_node)
|
||||
func = next(iter(stubify(func)))
|
||||
func = FunctionContext.from_context(parent_context, scope_node)
|
||||
func = next(iter(stubify(parent_context, func)))
|
||||
|
||||
if parent_was_class:
|
||||
func = BoundMethod(
|
||||
|
||||
@@ -266,6 +266,8 @@ def _add_stub_if_possible(parent_context, actual_context, stub_contexts):
|
||||
|
||||
|
||||
def with_stub_context_if_possible(actual_context):
|
||||
if actual_context.tree_node.type == 'lambdef':
|
||||
return ContextSet([actual_context])
|
||||
assert actual_context.tree_node.type in ('classdef', 'funcdef')
|
||||
qualified_names = actual_context.get_qualified_names()
|
||||
stub_module = actual_context.get_root_context().stub_context
|
||||
|
||||
Reference in New Issue
Block a user