aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2021-11-24 19:35:07 +0100
committerDaniel Gavin <danielgavin5@hotmail.com>2021-11-24 19:35:07 +0100
commit4d5b12e399f5384d0e7bb3e7b213d04cea32c32b (patch)
tree5cd8e406b5b221e7ed282c27d9b2809f88384ae9 /src
parentbc23b7651e19f8e176f961f152686c800523211e (diff)
Fix out of bounds error with implicit completion
Diffstat (limited to 'src')
-rw-r--r--src/server/completion.odin4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/completion.odin b/src/server/completion.odin
index cca5fe3..791f971 100644
--- a/src/server/completion.odin
+++ b/src/server/completion.odin
@@ -775,6 +775,10 @@ get_implicit_completion :: proc(ast_context: ^analysis.AstContext, position_cont
if proc_value, ok := symbol.value.(index.SymbolProcedureValue); ok {
+ if len(proc_value.arg_types) <= parameter_index {
+ return;
+ }
+
if enum_value, ok := unwrap_enum(ast_context, proc_value.arg_types[parameter_index].type); ok {
for name in enum_value.names {