Skip to content

Commit d7ba92c

Browse files
Copilottsnobip
andcommitted
Remove JSXChildrenSpreading variant and update all related code
Co-authored-by: tsnobip <[email protected]>
1 parent 0fdd480 commit d7ba92c

File tree

18 files changed

+8
-134
lines changed

18 files changed

+8
-134
lines changed

analysis/src/CompletionFrontEnd.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor
14131413
{
14141414
jsx_container_element_closing_tag = None;
14151415
jsx_container_element_children =
1416-
JSXChildrenSpreading _ | JSXChildrenItems (_ :: _);
1416+
JSXChildrenItems (_ :: _);
14171417
}) ) ->
14181418
None
14191419
| Some jsxProps, _ ->

analysis/src/CompletionJsx.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ let extractJsxProps ~(compName : Longident.t Location.loc) ~props ~children =
461461
let childrenStart =
462462
match children with
463463
| JSXChildrenItems [] -> None
464-
| JSXChildrenSpreading child | JSXChildrenItems (child :: _) ->
464+
| JSXChildrenItems (child :: _) ->
465465
if child.pexp_loc.loc_ghost then None else Some (Loc.start child.pexp_loc)
466466
in
467467
let props =

analysis/src/SemanticTokens.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ let command ~debug ~emitter ~path =
312312

313313
(* children *)
314314
(match children with
315-
| Parsetree.JSXChildrenSpreading child -> iterator.expr iterator child
316315
| Parsetree.JSXChildrenItems children ->
317316
List.iter (iterator.expr iterator) children);
318317

compiler/frontend/bs_ast_mapper.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ end
293293

294294
module E = struct
295295
let map_jsx_children sub = function
296-
| JSXChildrenSpreading e -> JSXChildrenSpreading (sub.expr sub e)
297296
| JSXChildrenItems xs -> JSXChildrenItems (List.map (sub.expr sub) xs)
298297

299298
let map_jsx_prop sub = function

compiler/ml/ast_iterator.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ end
268268

269269
module E = struct
270270
let iter_jsx_children sub = function
271-
| JSXChildrenSpreading e -> sub.expr sub e
272271
| JSXChildrenItems xs -> List.iter (sub.expr sub) xs
273272

274273
let iter_jsx_prop sub = function

compiler/ml/ast_mapper.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ end
264264

265265
module E = struct
266266
let map_jsx_children sub = function
267-
| JSXChildrenSpreading e -> JSXChildrenSpreading (sub.expr sub e)
268267
| JSXChildrenItems xs -> JSXChildrenItems (List.map (sub.expr sub) xs)
269268

270269
let map_jsx_prop sub = function

compiler/ml/ast_mapper_from0.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ module E = struct
327327
| Pexp_construct ({txt = Longident.Lident "[]" | Longident.Lident "::"}, _)
328328
->
329329
JSXChildrenItems (visit e)
330-
| _ -> JSXChildrenSpreading (sub.expr sub e)
330+
| _ -> JSXChildrenItems [sub.expr sub e]
331331

332332
let try_map_jsx_prop (sub : mapper) (lbl : Asttypes.Noloc.arg_label)
333333
(e : expression) : Parsetree.jsx_prop option =

compiler/ml/ast_mapper_to0.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ module E = struct
340340

341341
let map_jsx_children sub loc children =
342342
match children with
343-
| JSXChildrenSpreading e -> sub.expr sub e
344343
| JSXChildrenItems xs ->
345344
let list_expr = Ast_helper.Exp.make_list_expression loc xs None in
346345
sub.expr sub list_expr

compiler/ml/depend.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ let rec add_expr bv exp =
313313
add_jsx_children bv children
314314

315315
and add_jsx_children bv = function
316-
| JSXChildrenSpreading e -> add_expr bv e
317316
| JSXChildrenItems xs -> List.iter (add_expr bv) xs
318317

319318
and add_jsx_prop bv = function

compiler/ml/parsetree.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ and jsx_prop =
373373
* expression
374374

375375
and jsx_children =
376-
| JSXChildrenSpreading of expression
377376
| JSXChildrenItems of expression list
378377

379378
and jsx_props = jsx_prop list

0 commit comments

Comments
 (0)