Skip to content

Commit

Permalink
Fix: missing break before attributes of Pmty_with (ocaml-ppx#1103)
Browse files Browse the repository at this point in the history
  • Loading branch information
jberdine authored and bogdan2412 committed Mar 28, 2020
1 parent ee65f17 commit b8f95b8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### (master)

+ Fix: missing break before attributes of Pmty_with (#1103) (Josh Berdine)
+ Fix: Fix closing quote exceeding the margin (#1096) (Jules Aguillon)
+ Improve: add a message when a config value is removed (#1089) (Etienne Millon)
+ API: optional names for formatting boxes (#1083) (Guillaume Petiot)
Expand Down
2 changes: 1 addition & 1 deletion src/Fmt_ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3255,7 +3255,7 @@ and fmt_module_type c ({ast= mty; _} as xmty) =
let fmt_cstrs ~first:_ ~last:_ (wcs_and, loc, attr) =
Cmts.fmt c loc
( list_fl wcs_and fmt_cstr
$ fmt_attributes c ~pre:(str " ") ~key:"@" attr )
$ fmt_attributes c ~pre:(fmt "@;<1 -1>") ~key:"@" attr )
in
let {pro; psp; bdy; esp; epi; opn= _; cls= _} = fmt_module_type c mt in
{ empty with
Expand Down
3 changes: 2 additions & 1 deletion test/passing/attributes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ module type M = sig
with type t = t
and type u := u
and module R = R
and module S := S [@test])
and module S := S
[@test])

module T : module type of X [@test5]

Expand Down
12 changes: 8 additions & 4 deletions test/passing/module_attributes.ml.ref
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ include (
include (
List :
(module type of Foo
with module A := A [@warning "-3"] [@warning "-3"]
with module B := B [@warning "-3"]) )
with module A := A
[@warning "-3"] [@warning "-3"]
with module B := B
[@warning "-3"]) )

include (
List :
(module type of Pervasives
with module A := A [@warning "-3"] [@warning "-3"]
with module B := B [@warning "-3"] [@warning "-3"]) ) [@warning "-3"]
with module A := A
[@warning "-3"] [@warning "-3"]
with module B := B
[@warning "-3"] [@warning "-3"]) ) [@warning "-3"]

module My_module_name : sig end = struct end
(* some arbitrary comment *)
Expand Down

0 comments on commit b8f95b8

Please sign in to comment.