1
0
forked from VimPlug/jedi

NamePart doesn't have an __eq__ method anymore

This commit is contained in:
Dave Halter
2014-04-18 14:36:10 +02:00
parent c2bdda339b
commit 240b0c9581
11 changed files with 46 additions and 52 deletions

View File

@@ -17,6 +17,7 @@ It works as follows:
- execute these calls and check the input. This work with a ``ParamListener``.
"""
from jedi._compatibility import unicode
from jedi.parser import representation as pr
from jedi import settings
from jedi.evaluate import helpers
@@ -86,9 +87,11 @@ def search_params(evaluator, param):
# Need to take right index, because there could be a
# func usage before.
i = listRightIndex(call_path, func_name)
call_path_simple = [unicode(d) if isinstance(d, pr.NamePart)
else d for d in call_path]
i = listRightIndex(call_path_simple, func_name)
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_simple.index(func_name) != i:
continue
scopes = [scope]
if first:
@@ -119,10 +122,10 @@ def search_params(evaluator, param):
func = param.get_parent_until(pr.Function)
current_module = param.get_parent_until()
func_name = str(func.name)
func_name = unicode(func.name)
compare = func
if func_name == '__init__' and isinstance(func.parent, pr.Class):
func_name = str(func.parent.name)
func_name = unicode(func.parent.name)
compare = func.parent
# get the param name