Fix completion/definition.py tests.

This commit is contained in:
Dave Halter
2014-12-07 14:13:59 +01:00
parent e1e5c3a6c7
commit ea4f7053d6

View File

@@ -411,7 +411,6 @@ class Script(object):
scopes.update(resolve_import_paths(set(s.follow()))) scopes.update(resolve_import_paths(set(s.follow())))
return scopes return scopes
user_stmt = self._parser.user_stmt_with_whitespace()
goto_path = self._user_context.get_path_under_cursor() goto_path = self._user_context.get_path_under_cursor()
context = self._user_context.get_context() context = self._user_context.get_context()
definitions = set() definitions = set()
@@ -420,9 +419,8 @@ 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:
node, _, _ = search_call_signatures(user_stmt, self._pos) definitions = set(signature._definition
if node is not None: for signature in self.call_signatures())
definitions = set(self._evaluator.eval_element(node))
if not definitions: if not definitions:
if goto_path: if goto_path:
@@ -577,7 +575,7 @@ class Script(object):
if call_txt is None: if call_txt is None:
return [] return []
print(call_txt, call_index) #print(call_txt, call_index)
stmt = self._get_under_cursor_stmt(call_txt) stmt = self._get_under_cursor_stmt(call_txt)
#user_stmt = self._parser.user_stmt_with_whitespace() #user_stmt = self._parser.user_stmt_with_whitespace()
#call, trailer, index = search_call_signatures(user_stmt, self._pos) #call, trailer, index = search_call_signatures(user_stmt, self._pos)