From fc61cb706555c41d8b5afe1cf2bc93d343d960e4 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Tue, 16 Sep 2025 14:52:54 -0400 Subject: Correctly resolve variadic args as a slice --- src/server/analysis.odin | 10 +++++++++- tests/hover_test.odin | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 570a035..856f0ae 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -1124,7 +1124,15 @@ internal_resolve_type_expression :: proc(ast_context: ^AstContext, node: ^ast.Ex case ^Helper_Type: return internal_resolve_type_expression(ast_context, v.type, out) case ^Ellipsis: - return internal_resolve_type_expression(ast_context, v.expr, out) + out.range = common.get_token_range(v.node, ast_context.file.src) + out.type = .Type + out.pkg = get_package_from_node(v.node) + out.name = ast_context.field_name.name + out.uri = common.create_uri(v.pos.file, ast_context.allocator).uri + out.value = SymbolSliceValue { + expr = v.expr, + } + return true case ^Implicit: ident := new_type(Ident, v.node.pos, v.node.end, ast_context.allocator) ident.name = v.tok.text diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 37d0362..f1577c8 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -4738,6 +4738,28 @@ ast_hover_proc_group_parapoly_matrix :: proc(t: ^testing.T) { } test.expect_hover(t, &source, "test.c: matrix[3,2]int") } + +@(test) +ast_hover_proc_group_variadic_args :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + append_elems :: proc(array: ^$T/[dynamic]string, args: ..string) {} + append_elem :: proc(array: ^$T/[dynamic]string, arg: string) {} + + append :: proc { + append_elem, + append_elems, + } + + main :: proc() { + foos: [dynamic]string + bars: [dynamic]string + app{*}end(&bars, ..foos[:]) + } + `, + } + test.expect_hover(t, &source, "test.append: proc(array: ^$T/[dynamic]string, args: ..string)") +} /* Waiting for odin fix -- cgit v1.2.3