forked from VimPlug/jedi
Remove Import.alias_name_part, it was simply an alias for another lookup.
This commit is contained in:
@@ -29,7 +29,7 @@ def get_on_import_stmt(evaluator, user_context, user_stmt, is_like_search=False)
|
||||
kill_count = -1
|
||||
cur_name_part = None
|
||||
for name in import_names:
|
||||
if user_stmt.alias_name_part == name:
|
||||
if user_stmt.alias == name:
|
||||
continue
|
||||
|
||||
if name.end_pos >= user_context.position:
|
||||
|
||||
@@ -320,11 +320,11 @@ class Evaluator(object):
|
||||
def goto(self, stmt, call_path):
|
||||
if isinstance(stmt, pr.Import):
|
||||
# Nowhere to goto for aliases
|
||||
if stmt.alias_name_part == call_path[0]:
|
||||
if stmt.alias == call_path[0]:
|
||||
return [call_path[0]]
|
||||
|
||||
names = stmt.get_all_import_names()
|
||||
if stmt.alias_name_part:
|
||||
if stmt.alias:
|
||||
names = names[:-1]
|
||||
# Filter names that are after our Name
|
||||
removed_names = len(names) - names.index(call_path[0]) - 1
|
||||
|
||||
@@ -861,14 +861,6 @@ class Import(Simple):
|
||||
n.append(self.alias)
|
||||
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):
|
||||
"""
|
||||
This checks for the special case of nested imports, without aliases and
|
||||
|
||||
Reference in New Issue
Block a user