From 07cc047b4ffe3049dfe95fc5cd59383336976e2d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 11 Apr 2019 15:58:00 +0300 Subject: minimize the API --- crates/ra_ide_api/src/goto_definition.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index 1f1a8d126..abcc682e7 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs @@ -90,10 +90,8 @@ pub(crate) fn reference_definition( match resolved { hir::PathResolution::Def(def) => return Exact(NavigationTarget::from_def(db, def)), hir::PathResolution::LocalBinding(pat) => { - if let Some(pat) = analyzer.pat_syntax(db, pat) { - let nav = NavigationTarget::from_pat(db, file_id, pat); - return Exact(nav); - } + let nav = NavigationTarget::from_pat(db, file_id, pat); + return Exact(nav); } hir::PathResolution::GenericParam(..) => { // FIXME: go to the generic param def -- cgit v1.2.3