@@ -151,7 +151,10 @@ fn walk_and_build(
151
151
| SyntaxKind :: cte_list
152
152
| SyntaxKind :: name_list
153
153
| SyntaxKind :: set_clause_list
154
- | SyntaxKind :: set_target_list) => {
154
+ | SyntaxKind :: set_target_list
155
+ | SyntaxKind :: insert_column_list
156
+ | SyntaxKind :: index_params
157
+ | SyntaxKind :: values_clause) => {
155
158
if parent_kind == child_kind {
156
159
// [Node: Flatten]
157
160
//
@@ -466,5 +469,32 @@ FROM
466
469
467
470
assert_no_direct_nested_kind ( & new_root, SyntaxKind :: set_target_list) ;
468
471
}
472
+
473
+ #[ test]
474
+ fn no_nested_insert_column_list ( ) {
475
+ let input = "insert into t (a, b, c) values (1, 2, 3);" ;
476
+ let root = cst:: parse ( input) . unwrap ( ) ;
477
+ let ( new_root, _) = get_ts_tree_and_range_map ( & input, & root) ;
478
+
479
+ assert_no_direct_nested_kind ( & new_root, SyntaxKind :: insert_column_list) ;
480
+ }
481
+
482
+ #[ test]
483
+ fn no_nested_index_params ( ) {
484
+ let input = "insert into t (a, b, c) values (1, 2, 3) on conflict (a, b) do nothing;" ;
485
+ let root = cst:: parse ( input) . unwrap ( ) ;
486
+ let ( new_root, _) = get_ts_tree_and_range_map ( & input, & root) ;
487
+
488
+ assert_no_direct_nested_kind ( & new_root, SyntaxKind :: index_params) ;
489
+ }
490
+
491
+ #[ test]
492
+ fn no_nested_values_clause ( ) {
493
+ let input = "values (1,2,3), (4,5,6), (7,8,9);" ;
494
+ let root = cst:: parse ( input) . unwrap ( ) ;
495
+ let ( new_root, _) = get_ts_tree_and_range_map ( & input, & root) ;
496
+
497
+ assert_no_direct_nested_kind ( & new_root, SyntaxKind :: values_clause) ;
498
+ }
469
499
}
470
500
}
0 commit comments