summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2026-01-25 21:57:42 +1100
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2026-01-25 22:00:07 +1100
commit25fb7d45d18abf5a953a5d02ae446747035e0e24 (patch)
tree8a61c701591d84c0d437e8d340d0967557c5317e
parentce092169ca1d65b0c66fd2d81b0f00b828cf2e8c (diff)
Fix signature labels displaying empty symbol in definitions after commas
-rw-r--r--src/server/analysis.odin3
-rw-r--r--tests/signatures_test.odin38
2 files changed, 41 insertions, 0 deletions
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) {