forked from VimPlug/jedi
fix a problem found by sith with dynamic params (includes tests)
This commit is contained in:
@@ -194,7 +194,6 @@ def search_params(param):
|
|||||||
first, last = call_path[:i], call_path[i+1:]
|
first, last = call_path[:i], call_path[i+1:]
|
||||||
if not last and not call_path.index(func_name) != i:
|
if not last and not call_path.index(func_name) != i:
|
||||||
continue
|
continue
|
||||||
#print first, second, func
|
|
||||||
scopes = [scope]
|
scopes = [scope]
|
||||||
if first:
|
if first:
|
||||||
scopes = evaluate.follow_call_path(iter(first), scope, pos)
|
scopes = evaluate.follow_call_path(iter(first), scope, pos)
|
||||||
@@ -203,10 +202,12 @@ def search_params(param):
|
|||||||
s = evaluate.find_name(scope, func_name, position=pos,
|
s = evaluate.find_name(scope, func_name, position=pos,
|
||||||
search_global=not first,
|
search_global=not first,
|
||||||
resolve_decorator=False)
|
resolve_decorator=False)
|
||||||
#print s, pos, compare, func.parent
|
|
||||||
comparisons = [getattr(escope, 'base_func', None) or escope.base
|
c = [getattr(escope, 'base_func', None) or escope.base
|
||||||
for escope in s]
|
for escope in s
|
||||||
if compare in comparisons:
|
if escope.isinstance(er.Function, er.Class)
|
||||||
|
]
|
||||||
|
if compare in c:
|
||||||
# only if we have the correct function we execute
|
# only if we have the correct function we execute
|
||||||
# it, otherwise just ignore it.
|
# it, otherwise just ignore it.
|
||||||
evaluate.follow_paths(iter(last), s, scope)
|
evaluate.follow_paths(iter(last), s, scope)
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ def func(c=1):
|
|||||||
|
|
||||||
func(1.0)
|
func(1.0)
|
||||||
|
|
||||||
|
# Needs to be here, because in this case func is an import -> shouldn't lead to
|
||||||
|
# exceptions.
|
||||||
|
import sys as func
|
||||||
|
func.sys
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# classes
|
# classes
|
||||||
# -----------------
|
# -----------------
|
||||||
|
|||||||
Reference in New Issue
Block a user