Skip to content

Commit b85c068

Browse files
fixie fixie
1 parent 83934ed commit b85c068

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crates/pgt_hover/src/hovered_node.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ impl HoveredNode {
2424
pub(crate) fn get(ctx: &pgt_treesitter::context::TreesitterContext) -> Option<Self> {
2525
let node_content = ctx.get_node_under_cursor_content()?;
2626

27+
if looks_like_sql_param(node_content.as_str()) {
28+
return None;
29+
}
30+
2731
let under_cursor = ctx.node_under_cursor.as_ref()?;
2832

2933
match under_cursor.kind() {
@@ -114,3 +118,10 @@ impl HoveredNode {
114118
}
115119
}
116120
}
121+
122+
fn looks_like_sql_param(content: &str) -> bool {
123+
(content.starts_with("$") && !content.starts_with("$$"))
124+
|| (content.starts_with(":") && !content.starts_with("::"))
125+
|| (content.starts_with("@"))
126+
|| content.starts_with("?")
127+
}

0 commit comments

Comments
 (0)