We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb8a22d commit 1ec6560Copy full SHA for 1ec6560
compiler/syntax/src/res_printer.ml
@@ -4482,6 +4482,23 @@ and print_jsx_children ~state (children_expr : Parsetree.expression) ~sep
4482
let acc = expr :: acc in
4483
acc
4484
in
4485
+ (* adjust for braces when we forward the current_loc to the recursion *)
4486
+ let current_loc =
4487
+ match expr with
4488
+ | {Parsetree.pexp_loc = loc}
4489
+ when loc.loc_start.pos_lnum == loc.loc_end.pos_lnum ->
4490
+ current_loc
4491
+ | _ when ParsetreeViewer.is_braced_expr expr ->
4492
+ {
4493
+ current_loc with
4494
+ loc_end =
4495
4496
+ current_loc.loc_end with
4497
+ pos_lnum = current_loc.loc_end.pos_lnum + 1;
4498
+ };
4499
+ }
4500
+ | _ -> current_loc
4501
+ in
4502
loop current_loc docs tails
4503
4504
let docs = loop loc [] children in
0 commit comments