aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-11 04:44:43 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-11 04:44:43 -0400
commita2b472d5fd8169de682e144b5dc76c99a24fe96c (patch)
tree937cc16ae95862cec74a568d9cfcc9a01d0d655a /tests
parent3e6c49805a003e224b709bfa15d42f3f1081db11 (diff)
Improve proc group resolution with named args
Diffstat (limited to 'tests')
-rw-r--r--tests/hover_test.odin48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 6461621..a90346e 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5234,6 +5234,54 @@ ast_hover_proc_group_with_enum_arg :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.bar :: proc(foo: Foo)")
}
+
+@(test)
+ast_hover_proc_group_with_enum_named_arg :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: enum {
+ A,
+ B,
+ C,
+ }
+
+ bar_none :: proc() {}
+ bar_foo :: proc(i: int, foo: Foo) {}
+ bar :: proc {
+ bar_none,
+ bar_foo,
+ }
+
+ main :: proc() {
+ b{*}ar(foo = .B, i = 2)
+ }
+
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar :: proc(i: int, foo: Foo)")
+}
+
+@(test)
+ast_hover_proc_group_named_arg_with_nil :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: struct {}
+
+ bar_none :: proc() {}
+ bar_foo :: proc(i: int, foo: ^Foo) {}
+ bar :: proc {
+ bar_none,
+ bar_foo,
+ }
+
+ main :: proc() {
+ b{*}ar(foo = nil, i = 2)
+ }
+
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar :: proc(i: int, foo: ^Foo)")
+}
/*
Waiting for odin fix