aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-13 19:56:30 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-13 19:56:30 -0400
commite17b225fe055e2eb5ddd4a5b89f2b13d6001884b (patch)
treedb90be7649acaf5e7317c205440aa0badda3752a /tests
parenta697921c2556eb14f10fb54117f83dca4fffd027 (diff)
Resolve selector completions when a selector expr within a selector call expr
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin28
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"})
+}