From 3d4b48e481da35f19366514c0e22ed42fef037a0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 20 Dec 2019 14:47:01 +0100 Subject: Fix resolve for field init shorthand --- crates/ra_hir_def/src/body.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/ra_hir_def/src') diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 92c32b080..401fe0b9b 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs @@ -229,6 +229,11 @@ impl BodySourceMap { self.expr_map.get(&src).cloned() } + pub fn field_init_shorthand_expr(&self, node: InFile<&ast::RecordField>) -> Option { + let src = node.map(|it| Either::Right(AstPtr::new(it))); + self.expr_map.get(&src).cloned() + } + pub fn pat_syntax(&self, pat: PatId) -> Option { self.pat_map_back.get(pat).copied() } -- cgit v1.2.3