diff options
| author | Bradley Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-10-04 07:50:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-04 07:50:19 -0400 |
| commit | b85caeb82b86af897113eff551d37616d4e8e440 (patch) | |
| tree | fc4a8df6b3bee1d84105f35b3df5eddae677505a /tests | |
| parent | 0f166cc7e740b1f7175246942d9e04ef3a070d17 (diff) | |
| parent | ccda4509f972ceb683d7d6c1fd6e55497bde1634 (diff) | |
Merge pull request #1076 from BradLewis/fix/call-after-proc-overload
Correctly provide completions when calling a proc immediately after a proc overload call
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 49 |
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"}) +} |