aboutsummaryrefslogtreecommitdiff
path: root/src/server/completion.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-06 14:10:10 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-11-02 16:43:11 -0500
commit5001367cbca3b456501ec5cd80032ece388cccca (patch)
tree5967e916ed9d38e9396bbd0fce9e68c9d639ccc4 /src/server/completion.odin
parent5163a1a307b920b5ba4bc26131536f97546c7052 (diff)
Remove fallback code with selector completions (requires odin parser changes)
Diffstat (limited to 'src/server/completion.odin')
-rw-r--r--src/server/completion.odin25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin
index f3c0d56..ae14d4e 100644
--- a/src/server/completion.odin
+++ b/src/server/completion.odin
@@ -98,6 +98,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
@@ -1017,23 +1019,18 @@ get_selector_completion :: proc(
if symbol, ok := resolve_type_expression(ast_context, v.types[i]); ok {
if expr, ok := position_context.selector.derived.(^ast.Selector_Expr); ok {
- if expr.op.text == "->" && symbol.type != .Function {
- continue
- }
- }
-
- if position_context.arrow {
- if symbol.type != .Function && symbol.type != .Type_Function {
- continue
- }
- if .ObjCIsClassMethod in symbol.flags {
- assert(.ObjC in symbol.flags)
+ if expr.op.kind == .Arrow_Right {
+ if symbol.type != .Function && symbol.type != .Type_Function {
+ continue
+ }
+ if .ObjCIsClassMethod in symbol.flags {
+ assert(.ObjC in symbol.flags)
+ continue
+ }
+ } else if .ObjC in selector.flags {
continue
}
}
- if !position_context.arrow && .ObjC in selector.flags {
- continue
- }
construct_struct_field_symbol(&symbol, selector.name, v, i)
append(results, CompletionResult{symbol = symbol})