summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-27 20:02:38 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-10-27 20:02:38 -0400
commit62815da83221944cc45a01c11637bf2331773408 (patch)
treee6aa35fa556fb093fa3be3c79550d38a91cee9bb
parentd7f351f768a295ce74c91f67993e1df24b082bba (diff)
Correctly display hover info for bitset with underlying type
-rw-r--r--src/server/ast.odin5
-rw-r--r--tests/hover_test.odin10
2 files changed, 14 insertions, 1 deletions
diff --git a/src/server/ast.odin b/src/server/ast.odin
index f60116d..70c568d 100644
--- a/src/server/ast.odin
+++ b/src/server/ast.odin
@@ -1296,8 +1296,11 @@ build_string_node :: proc(node: ^ast.Node, builder: ^strings.Builder, remove_poi
strings.write_string(builder, "bit_set")
strings.write_string(builder, "[")
build_string(n.elem, builder, remove_pointers)
+ if n.underlying != nil {
+ strings.write_string(builder, "; ")
+ build_string(n.underlying, builder, remove_pointers)
+ }
strings.write_string(builder, "]")
- build_string(n.underlying, builder, remove_pointers)
case ^Map_Type:
strings.write_string(builder, "map")
strings.write_string(builder, "[")
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index e51d116..bd7abe6 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5312,6 +5312,16 @@ ast_hover_proc_return_with_enum :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "test.foo :: proc() -> enum{A, B}")
}
+
+@(test)
+ast_hover_proc_arg_generic_bit_set :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ f{*}oo :: proc($T: typeid/bit_set[$F; $E]) {}
+ `,
+ }
+ test.expect_hover(t, &source, "test.foo :: proc($T: typeid/bit_set[$F; $E])")
+}
/*
Waiting for odin fix