diff --git a/CHANGELOG.md b/CHANGELOG.md index 4abc98cf..14c3b02f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ - Fix issue with overlapping labelled argument with default value https://github.com/rescript-lang/syntax/pull/734 - Fix issue with using alias and default value together https://github.com/rescript-lang/syntax/pull/734 - Fix formatting of `switch` expressions that contain braced `cases` inside https://github.com/rescript-lang/syntax/pull/735 +- Fix formatting of props spread for multiline JSX expression https://github.com/rescript-lang/syntax/pull/736 #### :eyeglasses: Spec Compliance diff --git a/src/res_printer.ml b/src/res_printer.ml index f63bfa77..0ac8d4cc 100644 --- a/src/res_printer.ml +++ b/src/res_printer.ml @@ -4337,7 +4337,7 @@ and printJsxProp ~customLayout arg cmtTbl = | Optional _lbl -> Doc.concat [Doc.question; printIdentLike ident]) | Asttypes.Labelled "_spreadProps", expr -> let doc = printExpressionWithComments ~customLayout expr cmtTbl in - Doc.concat [Doc.lbrace; Doc.dotdotdot; Doc.softLine; doc; Doc.rbrace] + Doc.concat [Doc.lbrace; Doc.dotdotdot; doc; Doc.rbrace] | lbl, expr -> let argLoc, expr = match expr.pexp_attributes with diff --git a/tests/printer/expr/expected/jsx.res.txt b/tests/printer/expr/expected/jsx.res.txt index bdc104ff..4b9e5f97 100644 --- a/tests/printer/expr/expected/jsx.res.txt +++ b/tests/printer/expr/expected/jsx.res.txt @@ -410,3 +410,10 @@ let v = let x = + +// https://github.com/rescript-lang/rescript-compiler/issues/6002 +let x = props => + diff --git a/tests/printer/expr/jsx.res b/tests/printer/expr/jsx.res index 4b96f6c9..95a7e14c 100644 --- a/tests/printer/expr/jsx.res +++ b/tests/printer/expr/jsx.res @@ -402,4 +402,11 @@ let v = -let x = \ No newline at end of file +let x = + +// https://github.com/rescript-lang/rescript-compiler/issues/6002 +let x = props => + \ No newline at end of file