File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -4448,10 +4448,15 @@ and print_jsx_children ~state (children_expr : Parsetree.expression) ~sep
4448
4448
| Braced braces_loc ->
4449
4449
print_comments (add_parens_or_braces expr_doc) cmt_tbl braces_loc
4450
4450
in
4451
+ let get_first_leading_comment loc =
4452
+ match get_first_leading_comment cmt_tbl loc with
4453
+ | None -> loc
4454
+ | Some comment -> Comment. loc comment
4455
+ in
4451
4456
let get_loc expr =
4452
4457
match ParsetreeViewer. process_braces_attr expr with
4453
- | None , _ -> expr.pexp_loc
4454
- | Some ({loc} , _ ), _ -> loc
4458
+ | None , _ -> get_first_leading_comment expr.pexp_loc
4459
+ | Some ({loc} , _ ), _ -> get_first_leading_comment loc
4455
4460
in
4456
4461
let rec loop prev acc exprs =
4457
4462
match exprs with
You can’t perform that action at this time.
0 commit comments