aboutsummaryrefslogtreecommitdiff
path: root/tests/hover_test.odin
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-12-14 20:34:10 +1100
committerGitHub <noreply@github.com>2025-12-14 20:34:10 +1100
commit70efaf21cac9358b1b50e194e3401b07901b8f47 (patch)
tree97d1fc8eb5ac252dc60ab1083365ca459705754d /tests/hover_test.odin
parentd13ea9fadb3522b57184daeaa94272003202da6a (diff)
parent29ccf52e9cef7dc77f0b42f58669eb7e539cd12f (diff)
Merge pull request #1217 from BradLewis/feat/add-directives
Handle return types from call directives
Diffstat (limited to 'tests/hover_test.odin')
-rw-r--r--tests/hover_test.odin56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 75b3341..81a26ce 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5894,6 +5894,62 @@ ast_hover_const_aliases_from_other_pkg :: proc(t: ^testing.T) {
test.expect_hover(t, &source, "test.Bar :: my_package.Foo")
}
+@(test)
+ast_hover_directives_config_local :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ foo :: proc() {
+ b{*}ar := #config(TEST, false)
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar: bool")
+}
+
+@(test)
+ast_hover_directives_load_type_local :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ foo :: proc() {
+ b{*}ar := #load("foo", string)
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar: string")
+}
+
+@(test)
+ast_hover_directives_load_hash_local :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ foo :: proc() {
+ b{*}ar := #load_hash("a", "b")
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar: int")
+}
+
+@(test)
+ast_hover_directives_config :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ b{*}ar :: #config(TEST, false)
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar :: #config(TEST, false)")
+}
+
+@(test)
+ast_hover_directives_load :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ b{*}ar :: #load("foo.txt")
+ `,
+ }
+ test.expect_hover(t, &source, "test.bar :: #load(\"foo.txt\")")
+}
/*
Waiting for odin fix