From 78f76c1090f91cf2a09e95b1885b23ecd17cad9a Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Wed, 17 Dec 2025 07:05:34 +1100 Subject: Fix implicit selector completions for proc call args within assignments --- tests/completions_test.odin | 46 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 4403e02..1883032 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -5164,11 +5164,6 @@ ast_completion_empty_selector_with_ident_newline :: proc(t: ^testing.T) { ) source := test.Source { main = `package test - - Foo :: struct{ - x: int, - } - import "my_package" main :: proc() { @@ -5180,3 +5175,44 @@ ast_completion_empty_selector_with_ident_newline :: proc(t: ^testing.T) { } test.expect_completion_docs(t, &source, "", {"my_package.Foo :: struct{}"}) } + +@(test) +ast_completion_implicit_selector_binary_expr_proc_call :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package, context.temp_allocator) + + append( + &packages, + test.Package { + pkg = "my_package", + source = `package my_package + Foo :: enum { + A, + B, + C, + } + + Bar :: enum { + X, + Y, + } + + foo :: proc(f: Foo) -> bit_set[Bar] { + return {.X} + } + `, + }, + ) + source := test.Source { + main = `package test + import "my_package" + + main :: proc() { + results: bit_set[my_package.Bar] + + results |= my_package.foo(.{*}) + } + `, + packages = packages[:], + } + test.expect_completion_labels(t, &source, "", {"A", "B", "C"}, {"X", "Y"}) +} -- cgit v1.2.3