File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 31
31
- Fix dropped attributes on a begin-end in a match case (#2421 , @Julow )
32
32
- Fix non-stabilizing comments before a functor type argument (#2420 , @Julow )
33
33
- Fix crash caused by module types with nested ` with module ` (#2419 , @Julow )
34
+ - Fix ';;' formatting between doc-comments and toplevel directives (#2432 , @gpetiot )
34
35
35
36
## 0.26.0 (2023-07-18)
36
37
Original file line number Diff line number Diff line change @@ -4449,6 +4449,7 @@ let fmt_toplevel ?(force_semisemi = false) c ctx itms =
4449
4449
let semisemi =
4450
4450
match (itm, next) with
4451
4451
| _ , Some (`Item {pstr_desc = Pstr_eval _ ; _} , _ ) -> true
4452
+ | `Item {pstr_desc = Pstr_attribute _ ; _} , _ -> false
4452
4453
| `Item _ , Some (`Directive _ , _ ) -> true
4453
4454
| _ -> force_semisemi && last
4454
4455
in
Original file line number Diff line number Diff line change 1586
1586
(package ocamlformat)
1587
1587
(action (diff tests/ doc_repl.mld.err doc_repl.mld.stderr)))
1588
1588
1589
+ (rule
1590
+ (deps tests/ .ocamlformat )
1591
+ (package ocamlformat)
1592
+ (action
1593
+ (with- stdout- to docstrings_toplevel_directives.mlt.stdout
1594
+ (with- stderr- to docstrings_toplevel_directives.mlt.stderr
1595
+ (run % {bin: ocamlformat} -- margin- check % {dep: tests/ docstrings_toplevel_directives.mlt})))))
1596
+
1597
+ (rule
1598
+ (alias runtest)
1599
+ (package ocamlformat)
1600
+ (action (diff tests/ docstrings_toplevel_directives.mlt docstrings_toplevel_directives.mlt.stdout)))
1601
+
1602
+ (rule
1603
+ (alias runtest)
1604
+ (package ocamlformat)
1605
+ (action (diff tests/ docstrings_toplevel_directives.mlt.err docstrings_toplevel_directives.mlt.stderr)))
1606
+
1589
1607
(rule
1590
1608
(deps tests/ .ocamlformat )
1591
1609
(package ocamlformat)
Original file line number Diff line number Diff line change
1
+ (** Header *)
2
+
3
+ #use "something"
4
+
5
+ let two = 2
6
+
7
+ [@@@warning "-labels-omitted"] ;;
8
+
9
+ Clflags.strict_sequence := false
10
+
11
+ let f () = x
You can’t perform that action at this time.
0 commit comments