aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-12-26 19:35:29 +1100
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-12-26 19:35:29 +1100
commit64d2031c8ddcb31698599cd744a183f8415413f6 (patch)
tree6e9fefcb4ec90db4714dcdc37aeda0ec69eb3a6e /tests
parent5872154f56d21074f0e77950612bc769351094aa (diff)
Add vector completions for using struct fields
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 3c34603..6e1eba6 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -5238,3 +5238,39 @@ ast_completion_proc_arg_default_enum_alias :: proc(t: ^testing.T) {
}
test.expect_completion_docs(t, &source, "", {"A", "B"})
}
+
+@(test)
+ast_completion_struct_using_anonymous_vector_types :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: struct {
+ using _: [3]f32,
+ }
+
+ main :: proc() {
+ foo: Foo
+ foo.{*}
+ }
+
+ `,
+ }
+ test.expect_completion_docs(t, &source, "", {"r: f32", "x: f32"})
+}
+
+@(test)
+ast_completion_struct_using_named_vector_types :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: struct {
+ using bar: [3]f32,
+ }
+
+ main :: proc() {
+ foo: Foo
+ foo.{*}
+ }
+
+ `,
+ }
+ test.expect_completion_docs(t, &source, "", {"Foo.bar: [3]f32", "r: f32", "x: f32"})
+}