Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit e913c4c

Browse files
authored
Fix another missing comment in JSX case (#555)
1 parent 4c5dcca commit e913c4c

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/res_printer.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3925,8 +3925,8 @@ and printJsxExpression lident args cmtTbl =
39253925
formattedProps;
39263926
match children with
39273927
| Some ({Parsetree.pexp_desc = Pexp_construct ({txt = Longident.Lident "[]"}, None); pexp_loc = loc}) ->
3928-
let doc = printComments (Doc.text "/>") cmtTbl loc in
3929-
Doc.concat [Doc.line; doc]
3928+
let doc = Doc.concat [printCommentsInside cmtTbl loc; Doc.text "/>"] in
3929+
Doc.concat [Doc.line; printComments doc cmtTbl loc]
39303930
| _ -> Doc.nil
39313931
]
39323932
);

tests/printer/comments/expected/jsx.res.txt

+4
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ module Cite = {
1313
/>
1414

1515
<A /* comment */ />
16+
17+
<A
18+
// Comment
19+
/>

tests/printer/comments/jsx.res

+4
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ module Cite = {
1515
/>
1616

1717
<A /* comment */ />
18+
19+
<A>
20+
// Comment
21+
</A>

0 commit comments

Comments
 (0)