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
|
# TODO remove this paragraph, it's ugly and shouldn't be needed
|
||||||
inferred = self._name.infer()
|
inferred = self._name.infer()
|
||||||
if not inferred:
|
if inferred:
|
||||||
return None
|
inferred = next(iter(inferred))
|
||||||
inferred = next(iter(inferred))
|
if isinstance(inferred, MethodContext):
|
||||||
if isinstance(inferred, MethodContext):
|
c = inferred.class_context
|
||||||
c = inferred.class_context
|
else:
|
||||||
|
c = self._name.parent_context
|
||||||
else:
|
else:
|
||||||
c = self._name.parent_context
|
c = self._name.parent_context
|
||||||
|
|
||||||
names = self._evaluator.goto(c, self._name.tree_name)
|
names = self._evaluator.goto(c, self._name.tree_name)
|
||||||
return [Definition(self._evaluator, n) for n in names]
|
return [Definition(self._evaluator, n) for n in names]
|
||||||
|
|
||||||
|
|||||||
@@ -439,12 +439,9 @@ class Evaluator(object):
|
|||||||
if parent_was_class:
|
if parent_was_class:
|
||||||
parent_context = AnonymousInstance(
|
parent_context = AnonymousInstance(
|
||||||
self, parent_context.parent_context, parent_context)
|
self, parent_context.parent_context, parent_context)
|
||||||
cls = MethodContext
|
|
||||||
else:
|
|
||||||
cls = FunctionContext
|
|
||||||
|
|
||||||
func = cls.from_context(parent_context, scope_node)
|
func = FunctionContext.from_context(parent_context, scope_node)
|
||||||
func = next(iter(stubify(func)))
|
func = next(iter(stubify(parent_context, func)))
|
||||||
|
|
||||||
if parent_was_class:
|
if parent_was_class:
|
||||||
func = BoundMethod(
|
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):
|
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')
|
assert actual_context.tree_node.type in ('classdef', 'funcdef')
|
||||||
qualified_names = actual_context.get_qualified_names()
|
qualified_names = actual_context.get_qualified_names()
|
||||||
stub_module = actual_context.get_root_context().stub_context
|
stub_module = actual_context.get_root_context().stub_context
|
||||||
|
|||||||
Reference in New Issue
Block a user