diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-11-04 19:16:56 +0100 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-11-04 19:16:56 +0100 |
| commit | 40fdad6b5a2ffddc464cc8ebc4e560cdfd77924d (patch) | |
| tree | 79ed2264c76bde2a614ccb48315570c7a3b4fd28 /tests | |
| parent | 79b34ae986c713f7786f7f89575330fc40044d6e (diff) | |
Fix completion on call expr that return structs
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 21b89a2..d8a5d82 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -2031,3 +2031,28 @@ ast_vector_with_matrix_mult :: proc(t: ^testing.T) { test.expect_completion_details(t, &source, "", {"test.my_vector: [4]f32"}) } + +@(test) +ast_completion_on_call_expr :: proc(t: ^testing.T) { + source := test.Source { + main = `package main + My_Struct :: struct { + a: int, + b: int, + } + + my_function :: proc() -> My_Struct {} + + main :: proc() { + my_function().{*} + } + `, + } + + test.expect_completion_details( + t, + &source, + ".", + {"My_Struct.a: int", "My_Struct.b: int"}, + ) +} |