File tree 2 files changed +26
-2
lines changed
crates/pgt_completions/src 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -379,4 +379,28 @@ mod tests {
379
379
)
380
380
. await ;
381
381
}
382
+
383
+ #[ tokio:: test]
384
+ async fn suggests_tables_in_insert_into ( ) {
385
+ let setup = r#"
386
+ create schema auth;
387
+
388
+ create table auth.users (
389
+ uid serial primary key,
390
+ name text not null,
391
+ email text unique not null
392
+ );
393
+ "# ;
394
+
395
+ assert_complete_results (
396
+ format ! ( "insert into {}" , CURSOR_POS ) . as_str ( ) ,
397
+ vec ! [
398
+ CompletionAssertion :: LabelAndKind ( "public" . into( ) , CompletionItemKind :: Schema ) ,
399
+ CompletionAssertion :: LabelAndKind ( "auth" . into( ) , CompletionItemKind :: Schema ) ,
400
+ CompletionAssertion :: LabelAndKind ( "users" . into( ) , CompletionItemKind :: Table ) ,
401
+ ] ,
402
+ setup,
403
+ )
404
+ . await ;
405
+ }
382
406
}
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ impl CompletionFilter<'_> {
81
81
WrappingClause :: Insert => {
82
82
ctx. wrapping_node_kind
83
83
. as_ref ( )
84
- . is_some_and ( |n| n != & WrappingNode :: List )
84
+ . is_none_or ( |n| n != & WrappingNode :: List )
85
85
&& ctx. before_cursor_matches_kind ( & [ "keyword_into" ] )
86
86
}
87
87
@@ -148,7 +148,7 @@ impl CompletionFilter<'_> {
148
148
WrappingClause :: Insert => {
149
149
ctx. wrapping_node_kind
150
150
. as_ref ( )
151
- . is_some_and ( |n| n != & WrappingNode :: List )
151
+ . is_none_or ( |n| n != & WrappingNode :: List )
152
152
&& ctx. before_cursor_matches_kind ( & [ "keyword_into" ] )
153
153
}
154
154
You can’t perform that action at this time.
0 commit comments