forked from VimPlug/jedi
unicode issues in usage matching
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from jedi._compatibility import unicode
|
from jedi._compatibility import u
|
||||||
from jedi import common
|
from jedi import common
|
||||||
from jedi.api import classes
|
from jedi.api import classes
|
||||||
from jedi.parser import representation as pr
|
from jedi.parser import representation as pr
|
||||||
@@ -33,7 +33,7 @@ def usages(evaluator, definitions, search_name, mods):
|
|||||||
call_path = list(call.generate_call_path())
|
call_path = list(call.generate_call_path())
|
||||||
for i, name in enumerate(call_path):
|
for i, name in enumerate(call_path):
|
||||||
# name is `pr.NamePart`.
|
# name is `pr.NamePart`.
|
||||||
if unicode(name) == search_name:
|
if u(name) == search_name:
|
||||||
follow.append(call_path[:i + 1])
|
follow.append(call_path[:i + 1])
|
||||||
|
|
||||||
for call_path in follow:
|
for call_path in follow:
|
||||||
|
|||||||
@@ -182,8 +182,7 @@ def _literals_to_types(evaluator, result):
|
|||||||
# Literals are only valid as long as the operations are
|
# Literals are only valid as long as the operations are
|
||||||
# correct. Otherwise add a value-free instance.
|
# correct. Otherwise add a value-free instance.
|
||||||
cls = builtin.get_by_name(r.name)
|
cls = builtin.get_by_name(r.name)
|
||||||
from jedi.evaluate import representation as er
|
result[i] = evaluator.execute(cls)[0]
|
||||||
result[i] = er.Instance(evaluator, cls)
|
|
||||||
return list(set(result))
|
return list(set(result))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ def abc(): pass
|
|||||||
abc.d.a.bsaasd.abc.d
|
abc.d.a.bsaasd.abc.d
|
||||||
|
|
||||||
abc
|
abc
|
||||||
|
# unicode chars shouldn't be a problem.
|
||||||
|
x['smörbröd'].abc
|
||||||
|
|
||||||
if 1:
|
if 1:
|
||||||
abc =
|
abc =
|
||||||
|
|||||||
Reference in New Issue
Block a user