Simplify goto_definition in case it done on a function.

This commit is contained in:
Dave Halter
2014-08-18 15:00:14 +02:00
parent 00d15da143
commit 7619bf27d1

View File

@@ -379,16 +379,9 @@ class Script(object):
else:
# Fetch definition of callee, if there's no path otherwise.
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:
while call.next is not None:
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()
definitions = set(self._evaluator.eval_call(call))
if not definitions:
if goto_path: