aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-12-12 02:29:03 -0500
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-12-12 02:53:22 -0500
commit04b7710d526ad64d1e14eaf7860b51666bc7e4a8 (patch)
tree5228418f97693ec408d37f92d2c2fc73cfec1425 /tests/hover_test.odin
parent71eb09f0993a150503151fb8bb059ccd5f557b1d (diff)
Correct hover info for aliased constants
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 842360b..75b3341 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5865,6 +5865,35 @@ ast_hover_deferred_attributes :: proc(t: ^testing.T) {
test.expect_hover(t, &source, "test.foo :: proc()")
}
+@(test)
+ast_hover_const_aliases :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: 3 + 4
+ B{*}ar :: Foo
+ `,
+ }
+ test.expect_hover(t, &source, "test.Bar :: Foo")
+}
+
+@(test)
+ast_hover_const_aliases_from_other_pkg :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(&packages, test.Package{pkg = "my_package", source = `package my_package
+ Foo :: 3 + 4
+ `})
+ source := test.Source {
+ main = `package test
+ import "my_package"
+
+ B{*}ar :: my_package.Foo
+ `,
+ packages = packages[:],
+ }
+ test.expect_hover(t, &source, "test.Bar :: my_package.Foo")
+}
+
/*
Waiting for odin fix