From b8262099cc51065259daf10b4b23ff49ce74434f Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 May 2021 23:54:35 +0200 Subject: Get rid of field_type again --- crates/ide_completion/src/context.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ide_completion') diff --git a/crates/ide_completion/src/context.rs b/crates/ide_completion/src/context.rs index efaf4792f..1ec59ff80 100644 --- a/crates/ide_completion/src/context.rs +++ b/crates/ide_completion/src/context.rs @@ -339,13 +339,12 @@ impl<'a> CompletionContext<'a> { cov_mark::hit!(expected_type_struct_field_without_leading_char); // wouldn't try {} be nice... (|| { - let record_ty = self.sema.type_of_expr(&ast::Expr::cast(node.parent()?)?)?; let expr_field = self.token.prev_sibling_or_token()? - .into_node() + .into_node() .and_then(|node| ast::RecordExprField::cast(node))?; - let field = self.sema.resolve_record_field(&expr_field)?.0; + let (_, _, ty) = self.sema.resolve_record_field(&expr_field)?; Some(( - record_ty.field_type(self.db, field), + Some(ty), expr_field.field_name().map(NameOrNameRef::NameRef), )) })().unwrap_or((None, None)) -- cgit v1.2.3