aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2025-05-22 20:59:53 +0200
committerDanielGavin <danielgavin5@hotmail.com>2025-05-22 20:59:53 +0200
commitf9980e385ffb2ae0b2cefd6dda239d547ef1fb05 (patch)
tree0d6b9f5ca66b6b8c2f6bb885fd0eccd60f501213 /src/server
parent07ea39ecdcf02dba84c82d90b028055463f6562c (diff)
Fix issue with setting the ast_context.call in hover and file resolve
Diffstat (limited to 'src/server')
-rw-r--r--src/server/file_resolve.odin3
-rw-r--r--src/server/hover.odin4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/server/file_resolve.odin b/src/server/file_resolve.odin
index c8ca4e7..dd2eabb 100644
--- a/src/server/file_resolve.odin
+++ b/src/server/file_resolve.odin
@@ -332,11 +332,12 @@ resolve_node :: proc(node: ^ast.Node, data: ^FileResolveData) {
defer {
data.position_context.call = old_call
- data.ast_context.call = old_call
}
resolve_node(n.expr, data)
+ data.ast_context.call = old_call
+
for arg in n.args {
data.position_context.position = arg.pos.offset
resolve_node(arg, data)
diff --git a/src/server/hover.odin b/src/server/hover.odin
index 2edc331..9e4e20c 100644
--- a/src/server/hover.odin
+++ b/src/server/hover.odin
@@ -250,7 +250,9 @@ get_hover_information :: proc(document: ^Document, position: common.Position) ->
if position_context.call != nil {
if call, ok := position_context.call.derived.(^ast.Call_Expr); ok {
- ast_context.call = call
+ if !position_in_exprs(call.args, position_context.position) {
+ ast_context.call = call
+ }
}
}