aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/references.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/references.rs')
-rw-r--r--crates/ra_ide/src/references.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs
index 7f790a62d..aadc2dbcb 100644
--- a/crates/ra_ide/src/references.rs
+++ b/crates/ra_ide/src/references.rs
@@ -25,7 +25,7 @@ use ra_syntax::{
25 match_ast, AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, TextUnit, TokenAtOffset, 25 match_ast, AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, TextUnit, TokenAtOffset,
26}; 26};
27 27
28use crate::{display::ToNav, FilePosition, FileRange, NavigationTarget, RangeInfo}; 28use crate::{display::TryToNav, FilePosition, FileRange, NavigationTarget, RangeInfo};
29 29
30pub(crate) use self::{ 30pub(crate) use self::{
31 classify::{classify_name, classify_name_ref}, 31 classify::{classify_name, classify_name_ref},
@@ -125,15 +125,7 @@ pub(crate) fn find_all_refs(
125 }; 125 };
126 126
127 let RangeInfo { range, info: (name, def) } = find_name(db, &syntax, position, opt_name)?; 127 let RangeInfo { range, info: (name, def) } = find_name(db, &syntax, position, opt_name)?;
128 128 let declaration = def.try_to_nav(db)?;
129 let declaration = match def {
130 NameDefinition::Macro(mac) => mac.to_nav(db),
131 NameDefinition::StructField(field) => field.to_nav(db),
132 NameDefinition::ModuleDef(def) => NavigationTarget::from_def(db, def)?,
133 NameDefinition::SelfType(imp) => imp.to_nav(db),
134 NameDefinition::Local(local) => local.to_nav(db),
135 NameDefinition::TypeParam(_) => return None,
136 };
137 129
138 let search_scope = { 130 let search_scope = {
139 let base = SearchScope::for_def(&def, db); 131 let base = SearchScope::for_def(&def, db);