1
0
forked from VimPlug/jedi

Rename goto_definition to goto_definitions.

This commit is contained in:
Dave Halter
2016-06-11 23:15:55 +02:00
parent c82691a12b
commit a485412af0
4 changed files with 5 additions and 6 deletions

View File

@@ -374,7 +374,7 @@ class Script(object):
# Iterate tuples. # Iterate tuples.
unpack_tuple_to_dict(self._evaluator, types, testlist) unpack_tuple_to_dict(self._evaluator, types, testlist)
else: else:
try_iter_content(self._evaluator.goto_definition(node)) try_iter_content(self._evaluator.goto_definitions(node))
self._evaluator.reset_recursion_limitations() self._evaluator.reset_recursion_limitations()
ana = [a for a in self._evaluator.analysis if self.path == a.path] ana = [a for a in self._evaluator.analysis if self.path == a.path]

View File

@@ -234,7 +234,7 @@ class ContextResults():
name = self._module.name_for_position(self._pos) name = self._module.name_for_position(self._pos)
if name is not None: if name is not None:
return self._evaluator.goto_definition(name) return self._evaluator.goto_definitions(name)
leaf = self._module.get_leaf_for_position(self._pos) leaf = self._module.get_leaf_for_position(self._pos)
if leaf is None: if leaf is None:

View File

@@ -215,7 +215,7 @@ class Evaluator(object):
str_element_names = [str(e) for e in element_names] str_element_names = [str(e) for e in element_names]
if any(str(i) in str_element_names for i in if_names): if any(str(i) in str_element_names for i in if_names):
for if_name in if_names: for if_name in if_names:
definitions = self.goto_definition(if_name) definitions = self.goto_definitions(if_name)
# Every name that has multiple different definitions # Every name that has multiple different definitions
# causes the complexity to rise. The complexity should # causes the complexity to rise. The complexity should
# never fall below 1. # never fall below 1.
@@ -438,8 +438,7 @@ class Evaluator(object):
debug.dbg('execute result: %s in %s', types, obj) debug.dbg('execute result: %s in %s', types, obj)
return types return types
def goto_definition(self, name): def goto_definitions(self, name):
# TODO rename to goto_definitions
def_ = name.get_definition() def_ = name.get_definition()
is_simple_name = name.parent.type not in ('power', 'trailer') is_simple_name = name.parent.type not in ('power', 'trailer')
if is_simple_name: if is_simple_name:

View File

@@ -97,7 +97,7 @@ def search_function_call(evaluator, func):
trailer = t trailer = t
break break
if trailer is not None: if trailer is not None:
types = evaluator.goto_definition(name) types = evaluator.goto_definitions(name)
# We have to remove decorators, because they are not the # We have to remove decorators, because they are not the
# "original" functions, this way we can easily compare. # "original" functions, this way we can easily compare.