aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_ide/src/imports_locator.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_ide/src/imports_locator.rs b/crates/ra_ide/src/imports_locator.rs
index cfd58aafe..23bf43b07 100644
--- a/crates/ra_ide/src/imports_locator.rs
+++ b/crates/ra_ide/src/imports_locator.rs
@@ -11,7 +11,7 @@ use ra_prof::profile;
11use ra_syntax::{ast, AstNode, SyntaxKind::NAME}; 11use ra_syntax::{ast, AstNode, SyntaxKind::NAME};
12 12
13use crate::{ 13use crate::{
14 references::{classify_name, NameDefinition, NameKind}, 14 references::{classify_name, NameKind},
15 Query, 15 Query,
16}; 16};
17 17
@@ -28,7 +28,7 @@ impl<'a> ImportsLocatorIde<'a> {
28 &mut self, 28 &mut self,
29 db: &impl HirDatabase, 29 db: &impl HirDatabase,
30 import_candidate: &FileSymbol, 30 import_candidate: &FileSymbol,
31 ) -> Option<NameDefinition> { 31 ) -> Option<NameKind> {
32 let _p = profile("get_name_definition"); 32 let _p = profile("get_name_definition");
33 let file_id = import_candidate.file_id.into(); 33 let file_id = import_candidate.file_id.into();
34 let candidate_node = import_candidate.ptr.to_node(&db.parse_or_expand(file_id)?); 34 let candidate_node = import_candidate.ptr.to_node(&db.parse_or_expand(file_id)?);
@@ -41,6 +41,7 @@ impl<'a> ImportsLocatorIde<'a> {
41 &mut self.source_binder, 41 &mut self.source_binder,
42 hir::InFile { file_id, value: &ast::Name::cast(candidate_name_node)? }, 42 hir::InFile { file_id, value: &ast::Name::cast(candidate_name_node)? },
43 ) 43 )
44 .map(|it| it.kind)
44 } 45 }
45} 46}
46 47
@@ -67,7 +68,7 @@ impl ImportsLocator for ImportsLocatorIde<'_> {
67 .into_iter() 68 .into_iter()
68 .chain(lib_results.into_iter()) 69 .chain(lib_results.into_iter())
69 .filter_map(|import_candidate| self.get_name_definition(db, &import_candidate)) 70 .filter_map(|import_candidate| self.get_name_definition(db, &import_candidate))
70 .filter_map(|name_definition_to_import| match name_definition_to_import.kind { 71 .filter_map(|name_definition_to_import| match name_definition_to_import {
71 NameKind::Def(module_def) => Some(module_def), 72 NameKind::Def(module_def) => Some(module_def),
72 _ => None, 73 _ => None,
73 }) 74 })