]> git.lizzy.rs Git - rust.git/blobdiff - crates/ide_completion/src/patterns.rs
Refine functional update completion some more
[rust.git] / crates / ide_completion / src / patterns.rs
index ac34a3fac81c445a0be8c2881b56f27de14b3457..bcbd63b43adc261b455c83f2efd5c174fa53c5ff 100644 (file)
@@ -63,6 +63,9 @@ pub(crate) enum ImmediateLocation {
     /// The record expr of the field name we are completing
     RecordExpr(ast::RecordExpr),
     // Original file ast node
+    /// The record expr of the functional update syntax we are completing
+    RecordExprUpdate(ast::RecordExpr),
+    // Original file ast node
     /// The record pat of the field name we are completing
     RecordPat(ast::RecordPat),
 }
@@ -209,7 +212,7 @@ pub(crate) fn determine_location(
             },
             ast::RecordExprFieldList(_it) => sema
                 .find_node_at_offset_with_macros(original_file, offset)
-                .map(ImmediateLocation::RecordExpr)?,
+                .map(ImmediateLocation::RecordExprUpdate)?,
             ast::TupleField(_it) => ImmediateLocation::TupleField,
             ast::TupleFieldList(_it) => ImmediateLocation::TupleField,
             ast::TypeBound(_it) => ImmediateLocation::TypeBound,