File tree Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Expand file tree Collapse file tree 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 =
40184018 argsDoc;
40194019 ]
40204020 else
4021- let argsDoc = printArguments ~state ~dotted args cmtTbl in
4021+ let argsDoc = printArguments ~state ~dotted ~partial args cmtTbl in
40224022 Doc. concat [printAttributes ~state attrs cmtTbl; callExprDoc; argsDoc]
40234023 | _ -> assert false
40244024
@@ -4524,7 +4524,7 @@ and printArgumentsWithCallbackInLastPosition ~state ~dotted args cmtTbl =
45244524 Lazy. force breakAllArgs;
45254525 ]
45264526
4527- and printArguments ~state ~dotted
4527+ and printArguments ~state ~dotted ?( partial = false )
45284528 (args : (Asttypes.arg_label * Parsetree.expression) list ) cmtTbl =
45294529 match args with
45304530 | [
@@ -4564,7 +4564,7 @@ and printArguments ~state ~dotted
45644564 ~sep: (Doc. concat [Doc. comma; Doc. line])
45654565 (List. map (fun arg -> printArgument ~state arg cmtTbl) args);
45664566 ]);
4567- Doc. trailingComma;
4567+ ( if partial then Doc. nil else Doc. trailingComma) ;
45684568 Doc. softLine;
45694569 Doc. rparen;
45704570 ])
Original file line number Diff line number Diff line change @@ -159,3 +159,20 @@ let aU = (() => "foo")->Ok
159159Ok ("_" )-> Belt .Result .map (concatStrings (_ , "foo" ))
160160
161161let 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
159159Ok("_")->Belt.Result.map(concatStrings(_, "foo"))
160160
161161let 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