From ccda4509f972ceb683d7d6c1fd6e55497bde1634 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sat, 4 Oct 2025 07:42:01 -0400 Subject: Correctly provide completions when calling a proc immediately after a proc overload call --- tests/completions_test.odin | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'tests') 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"}) +} -- cgit v1.2.3