File tree Expand file tree Collapse file tree 7 files changed +28
-21
lines changed
Expand file tree Collapse file tree 7 files changed +28
-21
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ profile. This started with version 0.26.0.
1616- \* Janestreet profile: do not break ` fun _ -> function ` (#2460 , @tdelvecchio-jsc )
1717- \* Reduce the indentation of (polytype) type constraints (#2437 , @gpetiot )
1818- \* Consistent indentation of polymorphic variant arguments (#2427 , @Julow )
19+ - \* Don't align breaking module arguments (#2505 , @Julow )
1920
2021### Fixed
2122
Original file line number Diff line number Diff line change @@ -3820,16 +3820,20 @@ and fmt_module c ctx ?rec_ ?epi ?(can_sparse = false) keyword ?(eqty = "=")
38203820 ; psp= fmt_if (Option. is_none blk.pro) " @;<1 2>" $ blk.psp } )
38213821 in
38223822 let blk_b = Option. value_map xbody ~default: empty ~f: (fmt_module_expr c) in
3823+ let args_p = Params.Mod. get_args c.conf xargs in
38233824 let fmt_name_and_mt ~pro ~loc name mt =
38243825 let xmt = sub_mty ~ctx mt in
38253826 let blk = fmt_module_type c ?rec_ xmt in
3827+ let align_opn, align_cls =
3828+ if args_p.align then (open_hvbox 0 , close_box) else (noop, noop)
3829+ in
38263830 let pro =
3827- pro $ Cmts. fmt_before c loc $ str " (" $ fmt_str_loc_opt c name
3828- $ str " : "
3829- and epi = str " )" $ Cmts. fmt_after c loc in
3831+ pro $ Cmts. fmt_before c loc $ str " (" $ align_opn
3832+ $ fmt_str_loc_opt c name $ str " :"
3833+ $ fmt_or_k (Option. is_some blk.pro) (str " " ) (break 1 2 )
3834+ and epi = str " )" $ Cmts. fmt_after c loc $ align_cls in
38303835 compose_module' ~box: false ~pro ~epi blk
38313836 in
3832- let args_p = Params.Mod. get_args c.conf xargs in
38333837 (* Carry the [epi] to be placed in the next argument's box. *)
38343838 let fmt_arg ~pro {loc; txt} =
38353839 let pro = pro $ args_p.arg_psp in
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ module Mod = struct
123123 else List. for_all ~f: arg_is_sig args
124124 in
125125 let arg_psp = if dock then str " " else break 1 psp_indent in
126- let align = ocp c in
126+ let align = ( not dock) && ocp c in
127127 {dock; arg_psp; indent; align}
128128
129129 let break_constraint c ~rhs =
Original file line number Diff line number Diff line change @@ -71,10 +71,11 @@ module type KV_MAKER = functor (G : Irmin_git.G) (C : Irmin.Contents.S) ->
7171module Make
7272 (TT : TableFormat.TABLES )
7373 (IT : InspectionTableFormat.TABLES with type 'a lr1state = int )
74- (ET : EngineTypes. TABLE
75- with type terminal = int
76- and type nonterminal = int
77- and type semantic_value = Obj. t)
74+ (ET :
75+ EngineTypes. TABLE
76+ with type terminal = int
77+ and type nonterminal = int
78+ and type semantic_value = Obj. t)
7879 (E : sig
7980 type 'a env = (ET .state , ET .semantic_value , ET .token ) EngineTypes .env
8081 end ) =
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ Warning: tests/js_source.ml:9537 exceeds the margin
33Warning: tests/js_source.ml:9640 exceeds the margin
44Warning: tests/js_source.ml:9699 exceeds the margin
55Warning: tests/js_source.ml:9781 exceeds the margin
6+ Warning: tests/js_source.ml:10290 exceeds the margin
Original file line number Diff line number Diff line change @@ -10287,10 +10287,10 @@ type t =
1028710287
1028810288module Test_gen
1028910289 (For_tests : For_tests_gen)
10290- (Tested : S_gen
10291- with type 'a src := 'a For_tests.Src.t
10292- with type 'a dst := 'a For_tests.Dst.t)
10293- (Tested : S_gen
10290+ (Tested :
10291+ S_gen with type 'a src := 'a For_tests.Src.t with type 'a dst := 'a For_tests.Dst.t)
10292+ (Tested :
10293+ S_gen
1029410294 with type 'a src := 'a For_tests.Src.t
1029510295 with type 'a dst := 'a For_tests.Dst.t
1029610296 and type 'a dst := 'a For_tests.Dst.t
Original file line number Diff line number Diff line change @@ -10287,14 +10287,14 @@ type t =
1028710287
1028810288module Test_gen
1028910289 (For_tests : For_tests_gen)
10290- (Tested : S_gen
10291- with type 'a src := 'a For_tests.Src.t
10292- with type 'a dst := 'a For_tests.Dst.t)
10293- (Tested : S_gen
10294- with type 'a src := 'a For_tests.Src.t
10295- with type 'a dst := 'a For_tests.Dst.t
10296- and type 'a dst := 'a For_tests.Dst.t
10297- and type 'a dst := 'a For_tests.Dst.t) =
10290+ (Tested :
10291+ S_gen with type 'a src := 'a For_tests.Src.t with type 'a dst := 'a For_tests.Dst.t)
10292+ (Tested :
10293+ S_gen
10294+ with type 'a src := 'a For_tests.Src.t
10295+ with type 'a dst := 'a For_tests.Dst.t
10296+ and type 'a dst := 'a For_tests.Dst.t
10297+ and type 'a dst := 'a For_tests.Dst.t) =
1029810298struct
1029910299 open Tested
1030010300 open For_tests
You can’t perform that action at this time.
0 commit comments