From 95852f5e7f939d8025f370853639884420619106 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 3 Sep 2014 14:58:24 +0200 Subject: [PATCH] Clarify inner workings of Evaluator.goto --- jedi/evaluate/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jedi/evaluate/__init__.py b/jedi/evaluate/__init__.py index c05722a3..29d85d04 100644 --- a/jedi/evaluate/__init__.py +++ b/jedi/evaluate/__init__.py @@ -322,16 +322,16 @@ class Evaluator(object): def goto(self, stmt, call_path): scope = stmt.get_parent_scope() pos = stmt.start_pos - call_path, search_name_part = call_path[:-1], call_path[-1] + first_part, search_name_part = call_path[:-1], call_path[-1] - if call_path: - scopes = self.eval_call_path(iter(call_path), scope, pos) + if first_part: + scopes = self.eval_call_path(iter(first_part), scope, pos) search_global = False pos = None else: - # TODO does this exist? i don't think so scopes = [scope] search_global = True + follow_res = [] for s in scopes: follow_res += self.find_types(s, search_name_part, pos,