diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-07-28 08:38:00 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-07-28 08:38:32 -0400 |
| commit | 8aeba058399f3e64bdd6eea027982977db2998e7 (patch) | |
| tree | 6bacc47450b5e0f8e8464aec6c3df5d59967c048 /tests | |
| parent | 62cae61b822416979ff25b3672feb3679c93eebc (diff) | |
Correctly resolving using statements with aliases
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 1389550..9a5d20c 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -3878,7 +3878,7 @@ ast_completion_proc_enum_param :: proc(t: ^testing.T) { @(test) ast_completion_using_aliased_package :: proc(t: ^testing.T) { - packages := make([dynamic]test.Package, context.temp_allocator) + packages := make([dynamic]test.Package, context.temp_allocator) append( &packages, @@ -3908,6 +3908,48 @@ ast_completion_using_aliased_package :: proc(t: ^testing.T) { } @(test) +ast_completion_using_aliased_package_multiple :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package, context.temp_allocator) + + append( + &packages, + test.Package { + pkg = "foo_pkg", + source = `package foo_pkg + foo :: proc() {} + `, + }, + ) + + append( + &packages, + test.Package { + pkg = "bar_pkg", + source = `package bar_pkg + bar :: proc() {} + `, + }, + ) + + source := test.Source { + main = `package test + + import "foo_pkg" + import "bar_pkg" + fp :: foo_pkg + + main :: proc() { + using fp + f{*} + } + `, + packages = packages[:], + } + + test.expect_completion_details(t, &source, ".", {"foo_pkg.foo: proc()"}) +} + +@(test) ast_completion_bitset_if_statement_in :: proc(t: ^testing.T) { source := test.Source { main = `package test |