aboutsummaryrefslogtreecommitdiff
path: root/src/server/hover.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-07 09:54:04 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-07 09:54:04 -0400
commit3bf249dc5d684995c9dcbd6045dd0b68595b4b0d (patch)
treeeb3d0cbbb9a6f9cd50017899d4db4ea9e2c9a5c9 /src/server/hover.odin
parentb0074c3a0df4f6ccf145b8348b172a16fb13553a (diff)
Only show cast hover info if hovering over the `cast` keyword
Diffstat (limited to 'src/server/hover.odin')
-rw-r--r--src/server/hover.odin4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/hover.odin b/src/server/hover.odin
index af83d0b..4941b87 100644
--- a/src/server/hover.odin
+++ b/src/server/hover.odin
@@ -78,7 +78,9 @@ get_hover_information :: proc(document: ^Document, position: common.Position) ->
return {}, false, true
}
- if position_context.type_cast != nil {
+ if position_context.type_cast != nil && // check that we're actually on the 'cast' word
+ !position_in_node(position_context.type_cast.type, position_context.position) &&
+ !position_in_node(position_context.type_cast.expr, position_context.position) {
if str, ok := keywords_docs[position_context.type_cast.tok.text]; ok {
hover.contents.kind = "markdown"
hover.contents.value = str