aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-04 07:42:01 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-04 07:43:20 -0400
commitccda4509f972ceb683d7d6c1fd6e55497bde1634 (patch)
treefc4a8df6b3bee1d84105f35b3df5eddae677505a /tests
parent0f166cc7e740b1f7175246942d9e04ef3a070d17 (diff)
Correctly provide completions when calling a proc immediately after a proc overload call
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index a97ff0f..cb05518 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -4738,3 +4738,52 @@ ast_completion_handle_matching_field_with_unary :: proc(t: ^testing.T) {
}
test.expect_completion_insert_text(t, &source, "", {"foo"})
}
+
+@(test)
+ast_completion_overload_proc_returning_proc_complete_comp_lit_arg_local :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: struct {
+ bar: int,
+ bazz: string,
+ }
+
+ foo_none :: proc() -> proc(config: Foo) -> bool {}
+ foo_string :: proc(s: string) -> proc(config: Foo) -> bool {}
+
+ foo :: proc{foo_none, foo_string}
+
+ main :: proc() {
+ result := foo()
+ result({
+ {*}
+ })
+ }
+ `,
+ }
+ test.expect_completion_docs(t, &source, "", {"Foo.bar: int", "Foo.bazz: string"})
+}
+
+@(test)
+ast_completion_overload_proc_returning_proc_complete_comp_lit_arg_direct :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: struct {
+ bar: int,
+ bazz: string,
+ }
+
+ foo_none :: proc() -> proc(config: Foo) -> bool {}
+ foo_string :: proc(s: string) -> proc(config: Foo) -> bool {}
+
+ foo :: proc{foo_none, foo_string}
+
+ main :: proc() {
+ foo()({
+ {*}
+ })
+ }
+ `,
+ }
+ test.expect_completion_docs(t, &source, "", {"Foo.bar: int", "Foo.bazz: string"})
+}