@@ -126,7 +126,7 @@ let rec extractType ~env ~package (t : Types.type_expr) =
126
126
(Tvariant
127
127
{env; constructors; variantName = name.txt; variantDecl = decl})
128
128
| Some (env , {item = {kind = Record fields } } ) ->
129
- Some (Trecord {env; fields; name = `TypeExpr t})
129
+ Some (Trecord {env; fields; definition = `TypeExpr t})
130
130
| _ -> None )
131
131
| Ttuple expressions -> Some (Tuple (env, expressions, t))
132
132
| Tvariant {row_fields} ->
@@ -245,7 +245,8 @@ let rec resolveTypeForPipeCompletion ~env ~package ~lhsLoc ~full
245
245
let extractTypeFromResolvedType (typ : Type.t ) ~env ~full =
246
246
match typ.kind with
247
247
| Tuple items -> Some (Tuple (env, items, Ctype. newty (Ttuple items)))
248
- | Record fields -> Some (Trecord {env; fields; name = `Str typ.name})
248
+ | Record fields ->
249
+ Some (Trecord {env; fields; definition = `NameOnly typ.name})
249
250
| Variant constructors ->
250
251
Some
251
252
(Tvariant
@@ -282,13 +283,14 @@ let rec resolveNested (typ : completionType) ~env ~full ~nested =
282
283
|> extractType ~env ~package: full.package
283
284
|> Utils.Option. flatMap (fun typ ->
284
285
typ |> resolveNested ~env ~full ~nested ))
285
- | NRecordBody {seenFields} , Trecord {env; name = `TypeExpr typeExpr } ->
286
+ | NRecordBody {seenFields}, Trecord {env; definition = `TypeExpr typeExpr}
287
+ ->
286
288
typeExpr
287
289
|> extractType ~env ~package: full.package
288
290
|> Option. map (fun typ ->
289
291
(typ, env, Some (Completable. RecordField {seenFields})))
290
- | NRecordBody {seenFields}, ( Trecord {env; name = `Str _} as extractedType)
291
- ->
292
+ | ( NRecordBody {seenFields},
293
+ ( Trecord {env; definition = `NameOnly _} as extractedType) ) ->
292
294
Some (extractedType, env, Some (Completable. RecordField {seenFields}))
293
295
| NRecordBody {seenFields} , TinlineRecord {env; fields} ->
294
296
Some
@@ -403,12 +405,13 @@ let extractedTypeToString = function
403
405
| Toption (_, typ)
404
406
| Tpolyvariant {typeExpr = typ}
405
407
| Tfunction {typ}
406
- | Trecord {name = `TypeExpr typ } ->
408
+ | Trecord {definition = `TypeExpr typ } ->
407
409
Shared. typeToString typ
408
410
| Tbool _ -> " bool"
409
411
| Tstring _ -> " string"
410
412
| Tarray (_ , innerTyp ) -> " array<" ^ Shared. typeToString innerTyp ^ " >"
411
413
| Tvariant {variantDecl; variantName} ->
412
414
Shared. declToString variantName variantDecl
413
- | Trecord {name = `Str name ; fields} -> printRecordFromFields ~name fields
415
+ | Trecord {definition = `NameOnly name ; fields} ->
416
+ printRecordFromFields ~name fields
414
417
| TinlineRecord {fields} -> printRecordFromFields fields
0 commit comments