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.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs
index 88efcea2a..681f36623 100644
--- a/crates/ra_ide_api/src/goto_definition.rs
+++ b/crates/ra_ide_api/src/goto_definition.rs
@@ -89,7 +89,11 @@ pub(crate) fn reference_definition(
89 .and_then(hir::Path::from_ast) 89 .and_then(hir::Path::from_ast)
90 { 90 {
91 let resolved = resolver.resolve_path(db, &path); 91 let resolved = resolver.resolve_path(db, &path);
92 match resolved.clone().take_types().or(resolved.take_values()) { 92 match resolved
93 .clone()
94 .take_types()
95 .or_else(|| resolved.take_values())
96 {
93 Some(Resolution::Def(def)) => return Exact(NavigationTarget::from_def(db, def)), 97 Some(Resolution::Def(def)) => return Exact(NavigationTarget::from_def(db, def)),
94 Some(Resolution::LocalBinding(pat)) => { 98 Some(Resolution::LocalBinding(pat)) => {
95 let body = resolver.body().expect("no body for local binding"); 99 let body = resolver.body().expect("no body for local binding");