We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f100b63 commit 9823662Copy full SHA for 9823662
compiler/syntax/src/res_printer.ml
@@ -4463,6 +4463,23 @@ and print_jsx_children ~state (children_expr : Parsetree.expression) ~sep
4463
let acc = expr :: acc in
4464
acc
4465
in
4466
+ (* adjust for braces when we forward the current_loc to the recursion *)
4467
+ let current_loc =
4468
+ match expr with
4469
+ | {Parsetree.pexp_loc = loc}
4470
+ when loc.loc_start.pos_lnum == loc.loc_end.pos_lnum ->
4471
+ current_loc
4472
+ | _ when ParsetreeViewer.is_braced_expr expr ->
4473
+ {
4474
+ current_loc with
4475
+ loc_end =
4476
4477
+ current_loc.loc_end with
4478
+ pos_lnum = current_loc.loc_end.pos_lnum + 1;
4479
+ };
4480
+ }
4481
+ | _ -> current_loc
4482
+ in
4483
loop current_loc docs tails
4484
4485
let docs = loop loc [] children in
0 commit comments