We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 63093e4 commit 33aa565Copy full SHA for 33aa565
compiler/syntax/src/res_printer.ml
@@ -4469,6 +4469,23 @@ and print_jsx_children ~state (children_expr : Parsetree.expression) ~sep
4469
let acc = expr :: acc in
4470
acc
4471
in
4472
+ (* adjust for braces when we forward the current_loc to the recursion *)
4473
+ let current_loc =
4474
+ match expr with
4475
+ | {Parsetree.pexp_loc = loc}
4476
+ when loc.loc_start.pos_lnum == loc.loc_end.pos_lnum ->
4477
+ current_loc
4478
+ | _ when ParsetreeViewer.is_braced_expr expr ->
4479
+ {
4480
+ current_loc with
4481
+ loc_end =
4482
4483
+ current_loc.loc_end with
4484
+ pos_lnum = current_loc.loc_end.pos_lnum + 1;
4485
+ };
4486
+ }
4487
+ | _ -> current_loc
4488
+ in
4489
loop current_loc docs tails
4490
4491
let docs = loop loc [] children in
0 commit comments