mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-16 21:44:56 +08:00
Simplify goto_definition in case it done on a function.
This commit is contained in:
@@ -379,16 +379,9 @@ class Script(object):
|
|||||||
else:
|
else:
|
||||||
# Fetch definition of callee, if there's no path otherwise.
|
# Fetch definition of callee, if there's no path otherwise.
|
||||||
if not goto_path:
|
if not goto_path:
|
||||||
(call, _, _) = search_call_signatures(user_stmt, self._pos)
|
call, _, _ = search_call_signatures(user_stmt, self._pos)
|
||||||
if call is not None:
|
if call is not None:
|
||||||
while call.next is not None:
|
definitions = set(self._evaluator.eval_call(call))
|
||||||
call = call.next
|
|
||||||
# reset cursor position:
|
|
||||||
(row, col) = call.name.end_pos
|
|
||||||
pos = (row, max(col - 1, 0))
|
|
||||||
self._user_context = UserContext(self.source, pos)
|
|
||||||
# then try to find the path again
|
|
||||||
goto_path = self._user_context.get_path_under_cursor()
|
|
||||||
|
|
||||||
if not definitions:
|
if not definitions:
|
||||||
if goto_path:
|
if goto_path:
|
||||||
|
|||||||
Reference in New Issue
Block a user