aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-13 19:56:30 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-13 19:56:30 -0400
commite17b225fe055e2eb5ddd4a5b89f2b13d6001884b (patch)
treedb90be7649acaf5e7317c205440aa0badda3752a /src/server
parenta697921c2556eb14f10fb54117f83dca4fffd027 (diff)
Resolve selector completions when a selector expr within a selector call expr
Diffstat (limited to 'src/server')
-rw-r--r--src/server/completion.odin2
-rw-r--r--src/server/position_context.odin5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin
index aceff60..7e789f0 100644
--- a/src/server/completion.odin
+++ b/src/server/completion.odin
@@ -101,6 +101,8 @@ get_completion_list :: proc(
if !position_in_node(selector_call.call, position_context.position) {
completion_type = .Selector
}
+ } else if selector, ok := position_context.selector_expr.derived.(^ast.Selector_Expr); ok {
+ completion_type = .Selector
}
} else if _, ok := position_context.selector.derived.(^ast.Implicit_Selector_Expr); !ok {
// variadic args seem to work by setting it as an implicit selector expr, in that case
diff --git a/src/server/position_context.odin b/src/server/position_context.odin
index d5e7d33..0417df8 100644
--- a/src/server/position_context.odin
+++ b/src/server/position_context.odin
@@ -649,7 +649,10 @@ get_document_position_node :: proc(node: ^ast.Node, position_context: ^DocumentP
}
}
case ^Selector_Expr:
- if position_context.hint == .Definition || position_context.hint == .Hover && n.field != nil {
+ if position_context.hint == .Definition ||
+ position_context.hint == .Hover ||
+ position_context.hint == .SignatureHelp ||
+ position_context.hint == .Completion {
position_context.selector = n.expr
position_context.field = n.field
position_context.selector_expr = node