aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-12-17 07:09:03 +1100
committerGitHub <noreply@github.com>2025-12-17 07:09:03 +1100
commitcccd35ac38e675faa75c841526cb2a4dfd0b0149 (patch)
tree27eb1456c036fbfca3068115ed3cf28f3fad1dde /tests
parent8090d72884fda0aaee3e28beca6a898bd6955060 (diff)
parent78f76c1090f91cf2a09e95b1885b23ecd17cad9a (diff)
Merge pull request #1226 from BradLewis/fix/implicit-selector-completion-assignment-proc-arg
Fix implicit selector completions for proc call args within assignments
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin46
1 files changed, 41 insertions, 5 deletions
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"})
+}