From 063eef3eafbede00d3dd085777d00e8b9b55689e Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 17 May 2019 12:37:02 +0200 Subject: [PATCH] Call goto_definitions for goto_assigments if we're on a name --- jedi/api/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jedi/api/__init__.py b/jedi/api/__init__.py index ff46b43c..f6e57fcb 100644 --- a/jedi/api/__init__.py +++ b/jedi/api/__init__.py @@ -293,7 +293,9 @@ class Script(object): tree_name = self._module_node.get_name_of_position(self._pos) if tree_name is None: - return [] + # Without a name we really just want to jump to the result e.g. + # executed by `foo()`, if we the cursor is after `)`. + return self.goto_definitions() context = self._evaluator.create_context(self._get_module(), tree_name) names = list(self._evaluator.goto(context, tree_name))