minimize the API

This commit is contained in:
Aleksey Kladov 2019-04-11 15:58:00 +03:00
parent b6809b6695
commit 07cc047b4f
2 changed files with 11 additions and 23 deletions

View file

@ -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