diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-13 19:56:30 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-13 19:56:30 -0400 |
| commit | e17b225fe055e2eb5ddd4a5b89f2b13d6001884b (patch) | |
| tree | db90be7649acaf5e7317c205440aa0badda3752a /tests | |
| parent | a697921c2556eb14f10fb54117f83dca4fffd027 (diff) | |
Resolve selector completions when a selector expr within a selector call expr
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index d3a2eb7..303fd64 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -4698,3 +4698,31 @@ ast_completion_struct_field_value :: proc(t: ^testing.T) { } test.expect_completion_docs(t, &source, "", {"test.Foo: struct {}"}) } + +@(test) +ast_completion_selector_within_selector_call_expr :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + + Data :: struct { + x, y: int, + } + + IFoo :: struct { + bar: proc(self: IFoo, x: int), + } + + print :: proc(self: IFoo, x: int) {} + + main :: proc() { + data := Data{} + foo := IFoo { + bar = print, + } + + foo->bar(data.x{*}) + } + `, + } + test.expect_completion_docs(t, &source, "", {"Data.x: int", "Data.y: int"}) +} |