aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-24 14:52:15 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-09-24 14:52:15 -0400
commit50273daf85ec00f429dd61b1f9f196fb5fdc5bb2 (patch)
treead03d0fca253f2348e5e25d869eb9a7578084ca8 /tests/hover_test.odin
parente50bcf94367f594e76628cae8751b6f00911a4b8 (diff)
Correct resolving package instead of field when name collides
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index b2af26a..345e9f9 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5049,6 +5049,43 @@ ast_hover_proc_overload_nil_pointer :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.foo :: proc(s: ^string)")
}
+
+@(test)
+ast_hover_package_proc_naming_conflicting_with_another_package :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "my_package",
+ source = `package my_package
+ foo :: proc() {}
+ `,
+ },
+ )
+ append(
+ &packages,
+ test.Package {
+ pkg = "foo",
+ source = `package foo
+ `,
+ },
+ )
+
+ source := test.Source {
+ main = `package test
+ import "my_package"
+ import "foo"
+
+ main :: proc() {
+ f := my_package.fo{*}o
+ }
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_hover(t, &source, "my_package.foo :: proc()")
+}
/*
Waiting for odin fix