1
0
forked from VimPlug/jedi

many tests and fixes for instance element renamings

This commit is contained in:
David Halter
2012-12-26 22:56:56 +01:00
parent 2534269cce
commit 45c9fe16b8
4 changed files with 71 additions and 11 deletions

View File

@@ -327,7 +327,7 @@ class Script(object):
and self.pos < user_stmt.get_assignment_calls().start_pos:
# the search_name might be before `=`
definitions = [v for v in user_stmt.set_vars
if unicode(v) == search_name]
if unicode(v.names[-1]) == search_name]
if not isinstance(user_stmt, parsing.Import):
# import case is looked at with add_import_name option
definitions = dynamic.related_name_add_import_modules(definitions,
@@ -341,7 +341,7 @@ class Script(object):
if isinstance(d, parsing.Module):
names.append(api_classes.RelatedName(d, d))
else:
names.append(api_classes.RelatedName(d.names[0], d))
names.append(api_classes.RelatedName(d.names[-1], d))
return sorted(set(names), key=lambda x: (x.module_path, x.start_pos),
reverse=True)