@@ -151,7 +151,10 @@ fn walk_and_build(
151151 | SyntaxKind :: cte_list
152152 | SyntaxKind :: name_list
153153 | 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) => {
155158 if parent_kind == child_kind {
156159 // [Node: Flatten]
157160 //
@@ -466,5 +469,32 @@ FROM
466469
467470 assert_no_direct_nested_kind ( & new_root, SyntaxKind :: set_target_list) ;
468471 }
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+ }
469499 }
470500}
0 commit comments