diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-30 14:13:06 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-05-30 14:13:06 +0100 |
commit | 3cf841e1bc2bf354c180dc80fb394c0e0a843965 (patch) | |
tree | f01cf9c3589ae920c50696ce244c98b2454834b3 /crates/ra_ide_api/src/goto_definition.rs | |
parent | 6b88735fe6cd3b259816c7c90a2675ee057c9e4c (diff) | |
parent | b6a854e161cc122e6d9ae12084b6a1d1f4d0f241 (diff) |
Merge #1352
1352: Builtins r=matklad a=matklad
closes #1340
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/goto_definition.rs')
-rw-r--r-- | crates/ra_ide_api/src/goto_definition.rs | 5 |
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)); |