From d221ff4f9e0e270939a2944a2471bc3f027a674b Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 23 Mar 2020 00:19:55 +0200 Subject: Auto import macros --- crates/ra_ide_db/src/imports_locator.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'crates/ra_ide_db') diff --git a/crates/ra_ide_db/src/imports_locator.rs b/crates/ra_ide_db/src/imports_locator.rs index c96351982..24b6e4ad0 100644 --- a/crates/ra_ide_db/src/imports_locator.rs +++ b/crates/ra_ide_db/src/imports_locator.rs @@ -1,7 +1,7 @@ //! This module contains an import search funcionality that is provided to the ra_assists module. //! Later, this should be moved away to a separate crate that is accessible from the ra_assists module. -use hir::{ModuleDef, Semantics}; +use hir::Semantics; use ra_prof::profile; use ra_syntax::{ast, AstNode, SyntaxKind::NAME}; @@ -20,7 +20,7 @@ impl<'a> ImportsLocator<'a> { Self { sema: Semantics::new(db) } } - pub fn find_imports(&mut self, name_to_import: &str) -> Vec { + pub fn find_imports(&mut self, name_to_import: &str) -> Vec { let _p = profile("search_for_imports"); let db = self.sema.db; @@ -42,10 +42,6 @@ impl<'a> ImportsLocator<'a> { .into_iter() .chain(lib_results.into_iter()) .filter_map(|import_candidate| self.get_name_definition(&import_candidate)) - .filter_map(|name_definition_to_import| match name_definition_to_import { - Definition::ModuleDef(module_def) => Some(module_def), - _ => None, - }) .collect() } -- cgit v1.2.3