Skip to content

Commit 5f8e7b3

Browse files
a little bit of support
1 parent a4b03e9 commit 5f8e7b3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

crates/pgt_hover/src/hovered_node.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,16 @@ impl HoveredNode {
9393
}
9494
}
9595

96-
"identifier" if ctx.matches_one_of_ancestors(&["alter_role", "policy_to_role"]) => {
96+
"identifier"
97+
if ctx.matches_one_of_ancestors(&[
98+
"alter_role",
99+
"policy_to_role",
100+
"role_specification",
101+
]) || ctx.before_cursor_matches_kind(&["keyword_revoke"]) =>
102+
{
103+
Some(HoveredNode::Role(NodeIdentification::Name(node_content)))
104+
}
105+
"grant_role" | "policy_role" => {
97106
Some(HoveredNode::Role(NodeIdentification::Name(node_content)))
98107
}
99108

@@ -127,10 +136,6 @@ impl HoveredNode {
127136
}
128137
}
129138

130-
"grant_role" | "policy_role" => {
131-
Some(HoveredNode::Role(NodeIdentification::Name(node_content)))
132-
}
133-
134139
// quoted columns
135140
"literal" if ctx.matches_ancestor_history(&["select_expression", "term"]) => {
136141
Some(HoveredNode::Column(NodeIdentification::Name(node_content)))

0 commit comments

Comments
 (0)