diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-20 13:50:44 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-20 13:50:44 +0000 |
commit | 890ec6f7987af9fee0675502db1d419a12f9071c (patch) | |
tree | 9e4ff021db736a76bc82555886d868cd7429f021 /crates/ra_hir_def | |
parent | a0571359f3ea5361f1676b0777b578c6deefdc7d (diff) | |
parent | 3d4b48e481da35f19366514c0e22ed42fef037a0 (diff) |
Merge #2612
2612: Fix resolve for field init shorthand r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r-- | crates/ra_hir_def/src/body.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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 { | |||
229 | self.expr_map.get(&src).cloned() | 229 | self.expr_map.get(&src).cloned() |
230 | } | 230 | } |
231 | 231 | ||
232 | pub fn field_init_shorthand_expr(&self, node: InFile<&ast::RecordField>) -> Option<ExprId> { | ||
233 | let src = node.map(|it| Either::Right(AstPtr::new(it))); | ||
234 | self.expr_map.get(&src).cloned() | ||
235 | } | ||
236 | |||
232 | pub fn pat_syntax(&self, pat: PatId) -> Option<PatSource> { | 237 | pub fn pat_syntax(&self, pat: PatId) -> Option<PatSource> { |
233 | self.pat_map_back.get(pat).copied() | 238 | self.pat_map_back.get(pat).copied() |
234 | } | 239 | } |