aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-12-16 19:32:27 +1100
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-12-16 19:32:27 +1100
commit45bb4a16cd821fb49d9c5b082dade954e59570ec (patch)
treec29fcf277e3d4fc217ac403448a3b7a0cc5a6e1d /tests
parent79dc7bb79998428a96ab25f6c122dfc4c1909ac1 (diff)
Only use field for selector completions if the position is within the field
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 5ab4181..4403e02 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -5148,3 +5148,35 @@ ast_completion_global_selector_from_local_scope :: proc(t: ^testing.T) {
}
test.expect_completion_docs(t, &source, "", {"Foo.foo: int"})
}
+
+@(test)
+ast_completion_empty_selector_with_ident_newline :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "my_package",
+ source = `package my_package
+ Foo :: struct{}
+ `,
+ },
+ )
+ source := test.Source {
+ main = `package test
+
+ Foo :: struct{
+ x: int,
+ }
+
+ import "my_package"
+
+ main :: proc() {
+ my_package.{*}
+ y := 2
+ }
+ `,
+ packages = packages[:],
+ }
+ test.expect_completion_docs(t, &source, "", {"my_package.Foo :: struct{}"})
+}