1
0
forked from VimPlug/jedi

Remove Import.alias_name_part, it was simply an alias for another lookup.

This commit is contained in:
Dave Halter
2014-09-26 16:32:36 +02:00
parent 03e01631cc
commit 27444ed64d
3 changed files with 3 additions and 11 deletions

View File

@@ -29,7 +29,7 @@ def get_on_import_stmt(evaluator, user_context, user_stmt, is_like_search=False)
kill_count = -1 kill_count = -1
cur_name_part = None cur_name_part = None
for name in import_names: for name in import_names:
if user_stmt.alias_name_part == name: if user_stmt.alias == name:
continue continue
if name.end_pos >= user_context.position: if name.end_pos >= user_context.position:

View File

@@ -320,11 +320,11 @@ class Evaluator(object):
def goto(self, stmt, call_path): def goto(self, stmt, call_path):
if isinstance(stmt, pr.Import): if isinstance(stmt, pr.Import):
# Nowhere to goto for aliases # Nowhere to goto for aliases
if stmt.alias_name_part == call_path[0]: if stmt.alias == call_path[0]:
return [call_path[0]] return [call_path[0]]
names = stmt.get_all_import_names() names = stmt.get_all_import_names()
if stmt.alias_name_part: if stmt.alias:
names = names[:-1] names = names[:-1]
# Filter names that are after our Name # Filter names that are after our Name
removed_names = len(names) - names.index(call_path[0]) - 1 removed_names = len(names) - names.index(call_path[0]) - 1

View File

@@ -861,14 +861,6 @@ class Import(Simple):
n.append(self.alias) n.append(self.alias)
return n return n
@property
def alias_name_part(self):
"""
TODO refactor and dont use this method, because NamePart will not exist in
the future.
"""
return self.alias
def is_nested(self): def is_nested(self):
""" """
This checks for the special case of nested imports, without aliases and This checks for the special case of nested imports, without aliases and