File tree 3 files changed +40
-3
lines changed
3 files changed +40
-3
lines changed Original file line number Diff line number Diff line change @@ -4018,7 +4018,7 @@ and printPexpApply ~state expr cmtTbl =
4018
4018
argsDoc;
4019
4019
]
4020
4020
else
4021
- let argsDoc = printArguments ~state ~dotted args cmtTbl in
4021
+ let argsDoc = printArguments ~state ~dotted ~partial args cmtTbl in
4022
4022
Doc. concat [printAttributes ~state attrs cmtTbl; callExprDoc; argsDoc]
4023
4023
| _ -> assert false
4024
4024
@@ -4524,7 +4524,7 @@ and printArgumentsWithCallbackInLastPosition ~state ~dotted args cmtTbl =
4524
4524
Lazy. force breakAllArgs;
4525
4525
]
4526
4526
4527
- and printArguments ~state ~dotted
4527
+ and printArguments ~state ~dotted ?( partial = false )
4528
4528
(args : (Asttypes.arg_label * Parsetree.expression) list ) cmtTbl =
4529
4529
match args with
4530
4530
| [
@@ -4564,7 +4564,7 @@ and printArguments ~state ~dotted
4564
4564
~sep: (Doc. concat [Doc. comma; Doc. line])
4565
4565
(List. map (fun arg -> printArgument ~state arg cmtTbl) args);
4566
4566
]);
4567
- Doc. trailingComma;
4567
+ ( if partial then Doc. nil else Doc. trailingComma) ;
4568
4568
Doc. softLine;
4569
4569
Doc. rparen;
4570
4570
])
Original file line number Diff line number Diff line change @@ -159,3 +159,20 @@ let aU = (() => "foo")->Ok
159
159
Ok ("_" )-> Belt .Result .map (concatStrings (_ , "foo" ))
160
160
161
161
let ptl1 = add (1 , ... )
162
+
163
+ let fn = (
164
+ i ,
165
+ ~hello ,
166
+ ~moreGoesHere ,
167
+ ~provikingMultilineFormattingaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ,
168
+ ) => {
169
+ i + hello + moreGoesHere + provikingMultilineFormattingaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
170
+ }
171
+
172
+ let partial =
173
+ fn (
174
+ ~hello = 1 ,
175
+ ~moreGoesHere = 1 ,
176
+ ~provikingMultilineFormattingaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = 1 ,
177
+ ...
178
+ )
Original file line number Diff line number Diff line change @@ -159,3 +159,23 @@ let aU = (() => "foo")->Ok
159
159
Ok("_")->Belt.Result.map(concatStrings(_, "foo"))
160
160
161
161
let ptl1 = add(1, ...)
162
+
163
+ let fn = (
164
+ i,
165
+ ~hello,
166
+ ~moreGoesHere,
167
+ ~provikingMultilineFormattingaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
168
+ ) => {
169
+ i +
170
+ hello +
171
+ moreGoesHere +
172
+ provikingMultilineFormattingaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
173
+ }
174
+
175
+ let partial =
176
+ fn(
177
+ ~hello=1,
178
+ ~moreGoesHere=1,
179
+ ~provikingMultilineFormattingaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=1,
180
+ ...
181
+ )
You can’t perform that action at this time.
0 commit comments