aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/expr.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-10 20:44:21 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-10 20:44:21 +0000
commit9bee2937b4289315714b778ba38ab0e7c2a623fe (patch)
treeec9a223b23f7675a8e0eb1d12c454adc9551baf2 /crates/ra_hir/src/expr.rs
parentdc2a8d5acc53054c86ad17260b69d4bf4f14dbc6 (diff)
parenta6590ce2318676210b6b5a197b76b5861a3407c9 (diff)
Merge #463
463: Use name resolution for goto definition r=matklad a=flodiebold This tries proper name resolution before falling back on the index. @matklad There was currently no way of getting the location of a `DefId` from outside `ra_hir`. I added something, but it's probably not the best API, maybe you have a better idea? Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/expr.rs')
-rw-r--r--crates/ra_hir/src/expr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir/src/expr.rs b/crates/ra_hir/src/expr.rs
index ebb83d084..e5596cbaa 100644
--- a/crates/ra_hir/src/expr.rs
+++ b/crates/ra_hir/src/expr.rs
@@ -762,7 +762,7 @@ pub(crate) fn body_syntax_mapping(
762 let def = def_id.resolve(db)?; 762 let def = def_id.resolve(db)?;
763 763
764 let body_syntax_mapping = match def { 764 let body_syntax_mapping = match def {
765 Def::Function(f) => collect_fn_body_syntax(&f.source(db)), 765 Def::Function(f) => collect_fn_body_syntax(&f.source(db)?.1),
766 // TODO: consts, etc. 766 // TODO: consts, etc.
767 _ => panic!("Trying to get body for item type without body"), 767 _ => panic!("Trying to get body for item type without body"),
768 }; 768 };