aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/goto_definition.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/goto_definition.rs')
-rw-r--r--crates/ra_ide_api/src/goto_definition.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs
index 325a5a4f3..63ba6cf9d 100644
--- a/crates/ra_ide_api/src/goto_definition.rs
+++ b/crates/ra_ide_api/src/goto_definition.rs
@@ -59,10 +59,10 @@ pub(crate) fn reference_definition(
59 let analyzer = hir::SourceAnalyzer::new(db, file_id, name_ref.syntax(), None); 59 let analyzer = hir::SourceAnalyzer::new(db, file_id, name_ref.syntax(), None);
60 60
61 match classify_name_ref(db, &analyzer, name_ref) { 61 match classify_name_ref(db, &analyzer, name_ref) {
62 Some(Method(func)) => return Exact(NavigationTarget::from_function(db, func)),
63 Some(Macro(mac)) => return Exact(NavigationTarget::from_macro_def(db, mac)), 62 Some(Macro(mac)) => return Exact(NavigationTarget::from_macro_def(db, mac)),
64 Some(FieldAccess(field)) => return Exact(NavigationTarget::from_field(db, field)), 63 Some(FieldAccess(field)) => return Exact(NavigationTarget::from_field(db, field)),
65 Some(AssocItem(assoc)) => return Exact(NavigationTarget::from_impl_item(db, assoc)), 64 Some(AssocItem(assoc)) => return Exact(NavigationTarget::from_impl_item(db, assoc)),
65 Some(Method(func)) => return Exact(NavigationTarget::from_def_source(db, func)),
66 Some(Def(def)) => match NavigationTarget::from_def(db, def) { 66 Some(Def(def)) => match NavigationTarget::from_def(db, def) {
67 Some(nav) => return Exact(nav), 67 Some(nav) => return Exact(nav),
68 None => return Approximate(vec![]), 68 None => return Approximate(vec![]),
@@ -253,12 +253,12 @@ mod tests {
253 //- /foo/lib.rs 253 //- /foo/lib.rs
254 #[macro_export] 254 #[macro_export]
255 macro_rules! foo { 255 macro_rules! foo {
256 () => { 256 () => {
257 {} 257 {}
258 }; 258 };
259 } 259 }
260 ", 260 ",
261 "foo MACRO_CALL FileId(2) [0; 79) [29; 32)", 261 "foo MACRO_CALL FileId(2) [0; 66) [29; 32)",
262 ); 262 );
263 } 263 }
264 264