From f6335de738e47dff08ab4fefc8aad027f860076b Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Tue, 10 Jun 2025 12:36:29 -0400 Subject: Ensure for locals that they are defined in the same file as the identifier --- tests/hover_test.odin | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'tests') diff --git a/tests/hover_test.odin b/tests/hover_test.odin index bdd583a..244a4f9 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -412,6 +412,49 @@ ast_hover_union_implicit_selector :: proc(t: ^testing.T) { test.expect_hover(t, &source, "test.Bar: .Foo1") } +@(test) +ast_hover_foreign_package_name_collision :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package, context.temp_allocator) + + append( + &packages, + test.Package { + pkg = "my_package", + source = `package my_package + + data :: struct { + nodes: []node, + } + + bar :: struct { + } + + node :: struct { + bar: ^bar + } + + get_data :: proc() -> ^data { + return &data{} + } + `, + }, + ) + source := test.Source { + main = `package test + import "my_package" + main :: proc() { + data := my_package.get_data() + + for node in data.nodes { + bar := node.b{*}ar + } + } + `, + packages = packages[:], + } + + test.expect_hover(t, &source, "node.bar: ^bar") +} /* Waiting for odin fix -- cgit v1.2.3