aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/source_binder.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-24 17:08:16 +0000
committerGitHub <[email protected]>2019-11-24 17:08:16 +0000
commita58db5712f4fc82845e9397f728815d389c3c38b (patch)
tree8f4d416bad74f75e43924981b1d2c2099ea50edc /crates/ra_hir/src/source_binder.rs
parentac9ba5eb32073c16608acaa04324e7dc46d303d6 (diff)
parent63e3ea38d3ff7ab69b968e8962f33e82a4f978fb (diff)
Merge #2389
2389: Don't redo field resolution in the IDE r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r--crates/ra_hir/src/source_binder.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs
index cfc4bd326..9e5ce5508 100644
--- a/crates/ra_hir/src/source_binder.rs
+++ b/crates/ra_hir/src/source_binder.rs
@@ -216,6 +216,11 @@ impl SourceAnalyzer {
216 self.infer.as_ref()?.field_resolution(expr_id) 216 self.infer.as_ref()?.field_resolution(expr_id)
217 } 217 }
218 218
219 pub fn resolve_record_field(&self, field: &ast::RecordField) -> Option<crate::StructField> {
220 let expr_id = self.expr_id(&field.expr()?)?;
221 self.infer.as_ref()?.record_field_resolution(expr_id)
222 }
223
219 pub fn resolve_record_literal(&self, record_lit: &ast::RecordLit) -> Option<crate::VariantDef> { 224 pub fn resolve_record_literal(&self, record_lit: &ast::RecordLit) -> Option<crate::VariantDef> {
220 let expr_id = self.expr_id(&record_lit.clone().into())?; 225 let expr_id = self.expr_id(&record_lit.clone().into())?;
221 self.infer.as_ref()?.variant_resolution_for_expr(expr_id) 226 self.infer.as_ref()?.variant_resolution_for_expr(expr_id)