Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: missing break before attributes of Pmty_with #1103

Merged
merged 3 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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