From 50273daf85ec00f429dd61b1f9f196fb5fdc5bb2 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Wed, 24 Sep 2025 14:52:15 -0400 Subject: Correct resolving package instead of field when name collides --- tests/hover_test.odin | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3