From 25fb7d45d18abf5a953a5d02ae446747035e0e24 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sun, 25 Jan 2026 21:57:42 +1100 Subject: Fix signature labels displaying empty symbol in definitions after commas --- src/server/analysis.odin | 3 +++ tests/signatures_test.odin | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 8e27d1e..000080d 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -2299,6 +2299,9 @@ internal_resolve_comp_literal :: proc( set_ast_package_set_scoped(ast_context, symbol.pkg) + if position_context.parent_comp_lit == nil { + return {}, false + } symbol, _ = resolve_type_comp_literal( ast_context, position_context, diff --git a/tests/signatures_test.odin b/tests/signatures_test.odin index d81a4da..4ee9ff3 100644 --- a/tests/signatures_test.odin +++ b/tests/signatures_test.odin @@ -649,6 +649,44 @@ signature_comp_lit_bit_set :: proc(t: ^testing.T) { ) } +@(test) +signature_comp_lit_struct_field_after_comma :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + Foo :: struct { + A,{*} + B, + } + `, + config = { + enable_comp_lit_signature_help = true, + } + } + + test.expect_signature_labels( + t, + &source, + {}, + ) +} + +@(test) +signature_comp_lit_proc_field_after_comma :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + foo :: proc(a, b,{*}: int) {} + `, + config = { + enable_comp_lit_signature_help = true, + } + } + + test.expect_signature_labels( + t, + &source, + {}, + ) +} /* @(test) signature_function_inside_when :: proc(t: ^testing.T) { -- cgit v1.2.3