aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-08 05:40:15 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-08 05:40:15 -0400
commitbc83e2ccf93557322fcc0c7850fddfdd3123ca62 (patch)
tree15377b68eaf95ef58ccbe90d4b6f7308591ad99e
parent4c35d28c47e082a3a7bb38cd0c98d6def71e9637 (diff)
Add missing / in typeid specialization documentation
-rw-r--r--src/server/ast.odin5
-rw-r--r--tests/hover_test.odin11
2 files changed, 15 insertions, 1 deletions
diff --git a/src/server/ast.odin b/src/server/ast.odin
index 5548c23..b3e283c 100644
--- a/src/server/ast.odin
+++ b/src/server/ast.odin
@@ -1217,7 +1217,10 @@ build_string_node :: proc(node: ^ast.Node, builder: ^strings.Builder, remove_poi
}
case ^Typeid_Type:
strings.write_string(builder, "typeid")
- build_string(n.specialization, builder, remove_pointers)
+ if n.specialization != nil {
+ strings.write_string(builder, "/")
+ build_string(n.specialization, builder, remove_pointers)
+ }
case ^Helper_Type:
build_string(n.type, builder, remove_pointers)
case ^Distinct_Type:
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 08c6870..cffd779 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5197,6 +5197,17 @@ ast_hover_enum_in_bitset_within_call_expr :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.Foo: .A")
}
+
+@(test)
+ast_hover_typeid_with_specialization :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+
+ foo{*} :: proc($T: typeid/[]$E) {}
+ `,
+ }
+ test.expect_hover(t, &source, "test.foo :: proc($T: typeid/[]$E)")
+}
/*
Waiting for odin fix