aboutsummaryrefslogtreecommitdiff
path: root/src/server/completion.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-04-06 14:36:07 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-04-06 14:36:07 +0200
commit7ca20296e16ab36c196140e34a47afea0a64b805 (patch)
treef0312a2a103c61d2400b41bfb03ca5ee56ccf758 /src/server/completion.odin
parent9652ef501f0085fd5e335427de95482625b2d1ea (diff)
Call expression should always increment the current argument counter, since argument 1 is always the struct type.
Diffstat (limited to 'src/server/completion.odin')
-rw-r--r--src/server/completion.odin10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin
index e09aa0a..eabac77 100644
--- a/src/server/completion.odin
+++ b/src/server/completion.odin
@@ -1099,8 +1099,14 @@ get_implicit_completion :: proc(
ok && parameter_ok {
ast_context.current_package = symbol.pkg
- if .ObjC in symbol.flags {
- parameter_index += 1
+ //Selector call expression always set the first argument to be the type of struct called, so increment it.
+ if position_context.selector_expr != nil {
+ if selector_call, ok := position_context.selector_expr.derived.(^ast.Selector_Call_Expr);
+ ok {
+ if selector_call.call == position_context.call {
+ parameter_index += 1
+ }
+ }
}
if proc_value, ok := symbol.value.(SymbolProcedureValue); ok {