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.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs
index 4f8554625..97b367115 100644
--- a/crates/ra_ide_api/src/goto_definition.rs
+++ b/crates/ra_ide_api/src/goto_definition.rs
@@ -62,7 +62,10 @@ pub(crate) fn reference_definition(
62 Some(Macro(mac)) => return Exact(NavigationTarget::from_macro_def(db, mac)), 62 Some(Macro(mac)) => return Exact(NavigationTarget::from_macro_def(db, mac)),
63 Some(FieldAccess(field)) => return Exact(NavigationTarget::from_field(db, field)), 63 Some(FieldAccess(field)) => return Exact(NavigationTarget::from_field(db, field)),
64 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(Def(def)) => return Exact(NavigationTarget::from_def(db, def)), 65 Some(Def(def)) => match NavigationTarget::from_def(db, def) {
66 Some(nav) => return Exact(nav),
67 None => return Approximate(vec![]),
68 },
66 Some(SelfType(ty)) => { 69 Some(SelfType(ty)) => {
67 if let Some((def_id, _)) = ty.as_adt() { 70 if let Some((def_id, _)) = ty.as_adt() {
68 return Exact(NavigationTarget::from_adt_def(db, def_id)); 71 return Exact(NavigationTarget::from_adt_def(db, def_id));