1
0
forked from VimPlug/jedi

NamePart is now no str subclass anymore. They are separated, which makes us save a lot of dicts

This commit is contained in:
Dave Halter
2014-02-13 19:22:36 +01:00
parent 660a29ef93
commit 600371632f
7 changed files with 34 additions and 18 deletions

View File

@@ -148,7 +148,7 @@ class Script(object):
comps = []
comp_dct = {}
for c, s in set(completions):
n = c.names[-1]
n = str(c.names[-1])
if settings.case_insensitive_completion \
and n.lower().startswith(like.lower()) \
or n.startswith(like):

View File

@@ -323,7 +323,7 @@ class Completion(BaseDefinition):
if isinstance(self._base, pr.Param):
append += '='
name = self._name.names[-1]
name = str(self._name.names[-1])
if like_name:
name = name[self._like_name_length:]
return dot + name + append

View File

@@ -44,14 +44,14 @@ class LazyName(helpers.FakeName):
else:
try:
o = obj.__objclass__
parser_path.append(pr.NamePart(obj.__name__, None, None))
parser_path.append(pr.NamePart(obj.__name__, None, (None, None)))
obj = o
except AttributeError:
pass
try:
module_name = obj.__module__
parser_path.insert(0, pr.NamePart(obj.__name__, None, None))
parser_path.insert(0, pr.NamePart(obj.__name__, None, (None, None)))
except AttributeError:
# Unfortunately in some cases like `int` there's no __module__
module = builtins

View File

@@ -71,7 +71,7 @@ def usages(evaluator, definitions, search_name, mods):
compare_definitions = compare_array(definitions)
mods |= set([d.get_parent_until() for d in definitions])
names = []
for m in imports.get_modules_containing_name(mods, search_name):
for m in imports.get_modules_containing_name(mods, str(search_name)):
try:
stmts = m.used_names[search_name]
except KeyError: