forked from VimPlug/jedi
Because of the change in dynamic params, we can now remove the decorator hack in the name finder.
This commit is contained in:
@@ -100,7 +100,7 @@ class Evaluator(object):
|
||||
self.analysis = []
|
||||
|
||||
def find_types(self, scope, name_str, position=None, search_global=False,
|
||||
is_goto=False, resolve_decorator=True):
|
||||
is_goto=False):
|
||||
"""
|
||||
This is the search function. The most important part to debug.
|
||||
`remove_statements` and `filter_statements` really are the core part of
|
||||
@@ -113,7 +113,7 @@ class Evaluator(object):
|
||||
scopes = f.scopes(search_global)
|
||||
if is_goto:
|
||||
return f.filter_name(scopes)
|
||||
return f.find(scopes, resolve_decorator, search_global)
|
||||
return f.find(scopes, search_global)
|
||||
|
||||
@memoize_default(default=[], evaluator_is_first_arg=True)
|
||||
@recursion.recursion_decorator
|
||||
|
||||
@@ -37,9 +37,9 @@ class NameFinder(object):
|
||||
self.position = position
|
||||
|
||||
@debug.increase_indent
|
||||
def find(self, scopes, resolve_decorator=True, search_global=False):
|
||||
def find(self, scopes, search_global=False):
|
||||
names = self.filter_name(scopes, search_global)
|
||||
types = self._names_to_types(names, resolve_decorator)
|
||||
types = self._names_to_types(names)
|
||||
|
||||
if not names and not types \
|
||||
and not (isinstance(self.name_str, pr.Name)
|
||||
@@ -274,7 +274,7 @@ class NameFinder(object):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _names_to_types(self, names, resolve_decorator):
|
||||
def _names_to_types(self, names):
|
||||
types = []
|
||||
evaluator = self._evaluator
|
||||
|
||||
@@ -319,7 +319,7 @@ class NameFinder(object):
|
||||
types = list(chain.from_iterable(
|
||||
evaluator.execute(t) for t in exceptions))
|
||||
else:
|
||||
if typ.isinstance(er.Function) and resolve_decorator:
|
||||
if typ.isinstance(er.Function):
|
||||
typ = typ.get_decorated_func()
|
||||
types.append(typ)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user