1
0
forked from VimPlug/jedi

Get the tests passing again

This commit is contained in:
Dave Halter
2019-04-14 19:02:43 +02:00
parent 2f562040ac
commit 3afcfccba8
2 changed files with 21 additions and 1 deletions

View File

@@ -340,7 +340,19 @@ class BaseDefinition(object):
if tree_name is None or parent_context is None or isinstance(self._name, ParamName):
context_set = self._name.infer()
else:
context_set = self._evaluator.goto_definitions(parent_context, tree_name)
# TODO remove this paragraph, it's ugly and shouldn't be needed
inferred = self._name.infer()
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
context_set = self._evaluator.goto_definitions(c, tree_name)
return [Definition(self._evaluator, d.name) for d in context_set]
@property