Skip to content
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
- Fix issue in `Js.Promise2` where `then` and `catch` were returning `undefined` https://github.com/rescript-lang/rescript-compiler/pull/5996
- Fix issue in the compiler back-end where async functions passed to an `@uncurry` external would be inlined and transformed in a way that loses async https://github.com/rescript-lang/rescript-compiler/pull/6011
- Fix location issue for the treatment of `async` functions where hovering on the body with a type error would show `'a => promise<'a>` everywhere https://github.com/rescript-lang/rescript-compiler/pull/6014
- 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

#### :rocket: New Feature

Expand Down
2 changes: 2 additions & 0 deletions jscomp/napkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
- Fix support for recursive components in JSX V4 https://github.com/rescript-lang/syntax/pull/733
- 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

Expand Down
15 changes: 12 additions & 3 deletions lib/4.06.1/unstable/js_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50599,7 +50599,13 @@ let getLoc node =
let open Parsetree in
match node with
| Case case ->
{case.pc_lhs.ppat_loc with loc_end = case.pc_rhs.pexp_loc.loc_end}
{
case.pc_lhs.ppat_loc with
loc_end =
(match ParsetreeViewer.processBracesAttr case.pc_rhs with
| None, _ -> case.pc_rhs.pexp_loc.loc_end
| Some ({loc}, _), _ -> loc.Location.loc_end);
}
| CoreType ct -> ct.ptyp_loc
| ExprArgument expr -> (
match expr.Parsetree.pexp_attributes with
Expand Down Expand Up @@ -57439,7 +57445,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
Expand Down Expand Up @@ -57845,7 +57851,10 @@ and printCases ~customLayout (cases : Parsetree.case list) cmtTbl =
~getLoc:(fun n ->
{
n.Parsetree.pc_lhs.ppat_loc with
loc_end = n.pc_rhs.pexp_loc.loc_end;
loc_end =
(match ParsetreeViewer.processBracesAttr n.pc_rhs with
| None, _ -> n.pc_rhs.pexp_loc.loc_end
| Some ({loc}, _), _ -> loc.Location.loc_end);
})
~print:(printCase ~customLayout) ~nodes:cases cmtTbl;
];
Expand Down
15 changes: 12 additions & 3 deletions lib/4.06.1/unstable/js_playground_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -50599,7 +50599,13 @@ let getLoc node =
let open Parsetree in
match node with
| Case case ->
{case.pc_lhs.ppat_loc with loc_end = case.pc_rhs.pexp_loc.loc_end}
{
case.pc_lhs.ppat_loc with
loc_end =
(match ParsetreeViewer.processBracesAttr case.pc_rhs with
| None, _ -> case.pc_rhs.pexp_loc.loc_end
| Some ({loc}, _), _ -> loc.Location.loc_end);
}
| CoreType ct -> ct.ptyp_loc
| ExprArgument expr -> (
match expr.Parsetree.pexp_attributes with
Expand Down Expand Up @@ -57439,7 +57445,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
Expand Down Expand Up @@ -57845,7 +57851,10 @@ and printCases ~customLayout (cases : Parsetree.case list) cmtTbl =
~getLoc:(fun n ->
{
n.Parsetree.pc_lhs.ppat_loc with
loc_end = n.pc_rhs.pexp_loc.loc_end;
loc_end =
(match ParsetreeViewer.processBracesAttr n.pc_rhs with
| None, _ -> n.pc_rhs.pexp_loc.loc_end
| Some ({loc}, _), _ -> loc.Location.loc_end);
})
~print:(printCase ~customLayout) ~nodes:cases cmtTbl;
];
Expand Down
15 changes: 12 additions & 3 deletions lib/4.06.1/whole_compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -226571,7 +226571,13 @@ let getLoc node =
let open Parsetree in
match node with
| Case case ->
{case.pc_lhs.ppat_loc with loc_end = case.pc_rhs.pexp_loc.loc_end}
{
case.pc_lhs.ppat_loc with
loc_end =
(match ParsetreeViewer.processBracesAttr case.pc_rhs with
| None, _ -> case.pc_rhs.pexp_loc.loc_end
| Some ({loc}, _), _ -> loc.Location.loc_end);
}
| CoreType ct -> ct.ptyp_loc
| ExprArgument expr -> (
match expr.Parsetree.pexp_attributes with
Expand Down Expand Up @@ -233411,7 +233417,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
Expand Down Expand Up @@ -233817,7 +233823,10 @@ and printCases ~customLayout (cases : Parsetree.case list) cmtTbl =
~getLoc:(fun n ->
{
n.Parsetree.pc_lhs.ppat_loc with
loc_end = n.pc_rhs.pexp_loc.loc_end;
loc_end =
(match ParsetreeViewer.processBracesAttr n.pc_rhs with
| None, _ -> n.pc_rhs.pexp_loc.loc_end
| Some ({loc}, _), _ -> loc.Location.loc_end);
})
~print:(printCase ~customLayout) ~nodes:cases cmtTbl;
];
Expand Down