File tree 2 files changed +10
-6
lines changed
pgt_completions/src/context
pgt_workspace/src/workspace
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ pub enum WrappingClause<'a> {
24
24
Update ,
25
25
Delete ,
26
26
PolicyName ,
27
- ToRole ,
27
+ ToRoleAssignment ,
28
28
}
29
29
30
30
/// We can map a few nodes, such as the "update" node, to actual SQL clauses.
@@ -200,7 +200,7 @@ impl<'a> CompletionContext<'a> {
200
200
"policy_name" if policy_context. statement_kind != PolicyStmtKind :: Create => {
201
201
Some ( WrappingClause :: PolicyName )
202
202
}
203
- "policy_role" => Some ( WrappingClause :: ToRole ) ,
203
+ "policy_role" => Some ( WrappingClause :: ToRoleAssignment ) ,
204
204
"policy_table" => Some ( WrappingClause :: From ) ,
205
205
_ => None ,
206
206
} ;
Original file line number Diff line number Diff line change @@ -481,7 +481,6 @@ impl Workspace for WorkspaceServer {
481
481
Some ( pool) => pool,
482
482
None => {
483
483
tracing:: debug!( "No connection to database. Skipping completions." ) ;
484
- tracing:: warn!( "No connection to database." ) ;
485
484
return Ok ( CompletionsResult :: default ( ) ) ;
486
485
}
487
486
} ;
@@ -490,11 +489,10 @@ impl Workspace for WorkspaceServer {
490
489
491
490
match get_statement_for_completions ( & parsed_doc, params. position ) {
492
491
None => {
493
- tracing:: warn !( "No statement found." ) ;
492
+ tracing:: debug !( "No statement found." ) ;
494
493
Ok ( CompletionsResult :: default ( ) )
495
494
}
496
- Some ( ( _id, range, content, cst) ) => {
497
- tracing:: warn!( "found matching statement, content: {}" , content) ;
495
+ Some ( ( id, range, content, cst) ) => {
498
496
let position = params. position - range. start ( ) ;
499
497
500
498
let items = pgt_completions:: complete ( pgt_completions:: CompletionParams {
@@ -504,6 +502,12 @@ impl Workspace for WorkspaceServer {
504
502
text : content,
505
503
} ) ;
506
504
505
+ tracing:: debug!(
506
+ "Found {} completion items for statement with id {}" ,
507
+ items. len( ) ,
508
+ id. raw( )
509
+ ) ;
510
+
507
511
Ok ( CompletionsResult { items } )
508
512
}
509
513
}
You can’t perform that action at this time.
0 commit comments