File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
pgt_completions/src/relevance Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,10 @@ impl CompletionFilter<'_> {
9999 CompletionRelevanceData :: Table ( _) => match clause {
100100 WrappingClause :: From | WrappingClause :: Update => true ,
101101
102+ WrappingClause :: RevokeStatement => {
103+ ctx. matches_ancestor_history ( & [ "revoke_on_table" , "object_reference" ] )
104+ }
105+
102106 WrappingClause :: Join { on_node : None } => true ,
103107 WrappingClause :: Join { on_node : Some ( on) } => ctx
104108 . node_under_cursor
@@ -202,6 +206,12 @@ impl CompletionFilter<'_> {
202206 | WrappingClause :: Update
203207 | WrappingClause :: Delete => true ,
204208
209+ WrappingClause :: RevokeStatement => {
210+ ( ctx. matches_ancestor_history ( & [ "revoke_on_table" , "object_reference" ] )
211+ && ctx. schema_or_alias_name . is_none ( ) )
212+ || ctx. matches_ancestor_history ( & [ "revoke_on_all" ] )
213+ }
214+
205215 WrappingClause :: Where => {
206216 ctx. before_cursor_matches_kind ( & [ "keyword_and" , "keyword_where" ] )
207217 }
Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ impl HoveredNode {
3232 let under_cursor = ctx. node_under_cursor . as_ref ( ) ?;
3333
3434 match under_cursor. kind ( ) {
35- "identifier" if ctx. matches_ancestor_history ( & [ "relation" , "object_reference" ] ) => {
35+ "identifier"
36+ if ctx. matches_ancestor_history ( & [ "relation" , "object_reference" ] )
37+ || ctx. matches_ancestor_history ( & [ "revoke_on_table" , "object_reference" ] ) =>
38+ {
3639 let num_sibs = ctx. num_siblings ( ) ;
3740 if ctx. node_under_cursor_is_nth_child ( 1 ) && num_sibs > 0 {
3841 return Some ( HoveredNode :: Schema ( NodeIdentification :: Name ( node_content) ) ) ;
You can’t perform that action at this time.
0 commit comments