diff --git a/jedi/api/helpers.py b/jedi/api/helpers.py index f00f60d4..dba84dc8 100644 --- a/jedi/api/helpers.py +++ b/jedi/api/helpers.py @@ -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: diff --git a/jedi/evaluate/__init__.py b/jedi/evaluate/__init__.py index 10315b6e..3655ef47 100644 --- a/jedi/evaluate/__init__.py +++ b/jedi/evaluate/__init__.py @@ -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 diff --git a/jedi/parser/representation.py b/jedi/parser/representation.py index f1719703..438903a1 100644 --- a/jedi/parser/representation.py +++ b/jedi/parser/representation.py @@ -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