forked from VimPlug/jedi
remove position argument of follow_path
This commit is contained in:
@@ -177,8 +177,7 @@ class Evaluator(object):
|
|||||||
for s in element))
|
for s in element))
|
||||||
call_path = element.generate_call_path()
|
call_path = element.generate_call_path()
|
||||||
next(call_path, None) # the first one has been used already
|
next(call_path, None) # the first one has been used already
|
||||||
return self.follow_path(call_path, r, element.parent,
|
return self.follow_path(call_path, r, element.parent)
|
||||||
position=element.start_pos)
|
|
||||||
elif isinstance(element, pr.ListComprehension):
|
elif isinstance(element, pr.ListComprehension):
|
||||||
loop = _evaluate_list_comprehension(element)
|
loop = _evaluate_list_comprehension(element)
|
||||||
# Caveat: parents are being changed, but this doesn't matter,
|
# Caveat: parents are being changed, but this doesn't matter,
|
||||||
@@ -227,9 +226,9 @@ class Evaluator(object):
|
|||||||
types = [compiled.create(current.value)]
|
types = [compiled.create(current.value)]
|
||||||
types = imports.strip_imports(self, types)
|
types = imports.strip_imports(self, types)
|
||||||
|
|
||||||
return self.follow_path(path, types, scope, position=position)
|
return self.follow_path(path, types, scope)
|
||||||
|
|
||||||
def follow_path(self, path, types, call_scope, position=None):
|
def follow_path(self, path, types, call_scope):
|
||||||
"""
|
"""
|
||||||
Follows a path like::
|
Follows a path like::
|
||||||
|
|
||||||
@@ -241,7 +240,7 @@ class Evaluator(object):
|
|||||||
iter_paths = itertools.tee(path, len(types))
|
iter_paths = itertools.tee(path, len(types))
|
||||||
|
|
||||||
for i, typ in enumerate(types):
|
for i, typ in enumerate(types):
|
||||||
fp = self._follow_path(iter_paths[i], typ, call_scope, position=position)
|
fp = self._follow_path(iter_paths[i], typ, call_scope)
|
||||||
if fp is not None:
|
if fp is not None:
|
||||||
results_new += fp
|
results_new += fp
|
||||||
else:
|
else:
|
||||||
@@ -249,7 +248,7 @@ class Evaluator(object):
|
|||||||
return types
|
return types
|
||||||
return results_new
|
return results_new
|
||||||
|
|
||||||
def _follow_path(self, path, typ, scope, position=None):
|
def _follow_path(self, path, typ, scope):
|
||||||
"""
|
"""
|
||||||
Uses a generator and tries to complete the path, e.g.::
|
Uses a generator and tries to complete the path, e.g.::
|
||||||
|
|
||||||
@@ -285,9 +284,9 @@ class Evaluator(object):
|
|||||||
# This is the typical lookup while chaining things.
|
# This is the typical lookup while chaining things.
|
||||||
if filter_private_variable(typ, scope, current):
|
if filter_private_variable(typ, scope, current):
|
||||||
return []
|
return []
|
||||||
types = self.find_types(typ, current, position=None)
|
types = self.find_types(typ, current)
|
||||||
result = imports.strip_imports(self, types)
|
result = imports.strip_imports(self, types)
|
||||||
return self.follow_path(path, set(result), scope, position=position)
|
return self.follow_path(path, set(result), scope)
|
||||||
|
|
||||||
@debug.increase_indent
|
@debug.increase_indent
|
||||||
def execute(self, obj, params=(), evaluate_generator=False):
|
def execute(self, obj, params=(), evaluate_generator=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user