diff --git a/jedi/inference/__init__.py b/jedi/inference/__init__.py index 3e5414c9..d7926ef3 100644 --- a/jedi/inference/__init__.py +++ b/jedi/inference/__init__.py @@ -62,7 +62,6 @@ I need to mention now that lazy type inference is really good because it only *inferes* what needs to be *inferred*. All the statements and modules that are not used are just being ignored. """ -from parso.python import tree import parso from parso import python_bytes_to_unicode from jedi.file_io import FileIO diff --git a/jedi/inference/names.py b/jedi/inference/names.py index b2a3ff99..0e7f6cee 100644 --- a/jedi/inference/names.py +++ b/jedi/inference/names.py @@ -119,13 +119,13 @@ class AbstractTreeName(AbstractNameDefinition): # a name it's something you can "goto" again. is_simple_name = name.parent.type not in ('power', 'trailer') if is_simple_name: - return [TreeNameDefinition(context, name)] + return [self] elif type_ in ('import_from', 'import_name'): from jedi.inference.imports import goto_import module_names = goto_import(context, name) return module_names else: - return [TreeNameDefinition(context, name)] + return [self] else: from jedi.inference.imports import follow_error_node_imports_if_possible values = follow_error_node_imports_if_possible(context, name)