forked from VimPlug/jedi
cast pr.Function to er.Function even in the api.
This commit is contained in:
@@ -298,6 +298,11 @@ class BaseDefinition(object):
|
|||||||
stripped = self._definition
|
stripped = self._definition
|
||||||
if isinstance(stripped, pr.Name):
|
if isinstance(stripped, pr.Name):
|
||||||
stripped = stripped.parent
|
stripped = stripped.parent
|
||||||
|
# We should probably work in `Finder._names_to_types` here.
|
||||||
|
if isinstance(stripped, pr.Function):
|
||||||
|
stripped = er.Function(self._evaluator, stripped)
|
||||||
|
elif isinstance(stripped, pr.Class):
|
||||||
|
stripped = er.Class(self._evaluator, stripped)
|
||||||
|
|
||||||
if stripped.isinstance(pr.Statement):
|
if stripped.isinstance(pr.Statement):
|
||||||
return self._evaluator.eval_statement(stripped)
|
return self._evaluator.eval_statement(stripped)
|
||||||
|
|||||||
@@ -139,3 +139,4 @@ def test_signature_params():
|
|||||||
check(Script(s).goto_definitions())
|
check(Script(s).goto_definitions())
|
||||||
|
|
||||||
check(Script(s).goto_assignments())
|
check(Script(s).goto_assignments())
|
||||||
|
check(Script(s + '\nbar=foo\nbar').goto_assignments())
|
||||||
|
|||||||
Reference in New Issue
Block a user