@@ -550,16 +550,6 @@ module State = struct
550
550
let should_break_callback t = t.custom_layout > custom_layout_threshold
551
551
end
552
552
553
- let is_inline_record_definition attrs =
554
- attrs
555
- |> List. exists (fun (({txt} , _ ) : Parsetree. attribute ) ->
556
- txt = " res.inlineRecordDefinition" )
557
-
558
- let is_inline_record_reference attrs =
559
- attrs
560
- |> List. exists (fun (({txt} , _ ) : Parsetree. attribute ) ->
561
- txt = " res.inlineRecordReference" )
562
-
563
553
let rec print_structure ~state (s : Parsetree.structure ) t =
564
554
match s with
565
555
| [] -> print_comments_inside_file t
@@ -582,12 +572,14 @@ and print_structure_item ~state (si : Parsetree.structure_item) cmt_tbl =
582
572
| Pstr_type (Recursive , type_declarations)
583
573
when type_declarations
584
574
|> List. find_opt (fun (td : Parsetree.type_declaration ) ->
585
- is_inline_record_definition td.ptype_attributes)
575
+ Res_parsetree_viewer. has_inline_record_definition_attribute
576
+ td.ptype_attributes)
586
577
|> Option. is_some ->
587
578
let inline_record_definitions, regular_declarations =
588
579
type_declarations
589
580
|> List. partition (fun (td : Parsetree.type_declaration ) ->
590
- is_inline_record_definition td.ptype_attributes)
581
+ Res_parsetree_viewer. has_inline_record_definition_attribute
582
+ td.ptype_attributes)
591
583
in
592
584
print_type_declarations ~inline_record_definitions ~state
593
585
~rec_flag:
@@ -1722,7 +1714,8 @@ and print_typ_expr ?inline_record_definitions ~(state : State.t)
1722
1714
print_object ~state ~inline: false fields open_flag cmt_tbl
1723
1715
| Ptyp_arrow {arity} -> print_arrow ~arity typ_expr
1724
1716
| Ptyp_constr ({txt = Lident inline_record_name}, [] )
1725
- when is_inline_record_reference typ_expr.ptyp_attributes -> (
1717
+ when inline_record_definitions |> Option. is_some
1718
+ && String. contains inline_record_name '.' -> (
1726
1719
let inline_record_definitions =
1727
1720
match inline_record_definitions with
1728
1721
| None -> []
0 commit comments