From b6a854e161cc122e6d9ae12084b6a1d1f4d0f241 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 May 2019 16:10:07 +0300 Subject: update ra_ide_api to use builtins --- crates/ra_ide_api/src/goto_definition.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide_api/src/goto_definition.rs') 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( Some(Macro(mac)) => return Exact(NavigationTarget::from_macro_def(db, mac)), Some(FieldAccess(field)) => return Exact(NavigationTarget::from_field(db, field)), Some(AssocItem(assoc)) => return Exact(NavigationTarget::from_impl_item(db, assoc)), - Some(Def(def)) => return Exact(NavigationTarget::from_def(db, def)), + Some(Def(def)) => match NavigationTarget::from_def(db, def) { + Some(nav) => return Exact(nav), + None => return Approximate(vec![]), + }, Some(SelfType(ty)) => { if let Some((def_id, _)) = ty.as_adt() { return Exact(NavigationTarget::from_adt_def(db, def_id)); -- cgit v1.2.3