From eedf03421e07933cdfd2e0185ab815439f4faf57 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sun, 17 Aug 2025 08:10:00 -0400 Subject: Add `Matrix_Type` to build string node --- src/server/ast.odin | 8 ++++++++ tests/hover_test.odin | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/server/ast.odin b/src/server/ast.odin index 2bb13d0..f33ac6b 100644 --- a/src/server/ast.odin +++ b/src/server/ast.odin @@ -1251,6 +1251,14 @@ build_string_node :: proc(node: ^ast.Node, builder: ^strings.Builder, remove_poi build_string(n.key, builder, remove_pointers) strings.write_string(builder, "]") build_string(n.value, builder, remove_pointers) + case ^Matrix_Type: + strings.write_string(builder, "matrix") + strings.write_string(builder, "[") + build_string(n.row_count, builder, remove_pointers) + strings.write_string(builder, ",") + build_string(n.column_count, builder, remove_pointers) + strings.write_string(builder, "]") + build_string(n.elem, builder, remove_pointers) case ^ast.Multi_Pointer_Type: strings.write_string(builder, "[^]") build_string(n.elem, builder, remove_pointers) diff --git a/tests/hover_test.odin b/tests/hover_test.odin index 7f209b0..7da1b46 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -4019,6 +4019,23 @@ ast_hover_map_empty_struct_literal :: proc(t: ^testing.T) { } test.expect_hover(t, &source, "test.m: map[int]struct {}") } + +@(test) +ast_hover_struct_container_fields :: proc(t: ^testing.T) { + source := test.Source { + main = `package test + F{*}oo :: struct { + foo_slice: []int, + foo_dynamic: [dynamic]int, + foo_array: [5]int, + foo_map: map[int]int, + foo_matrix: matrix[3,4]int, + } + `, + } + test.expect_hover(t, &source, "test.Foo: struct {\n\tfoo_slice: []int,\n\tfoo_dynamic: [dynamic]int,\n\tfoo_array: [5]int,\n\tfoo_map: map[int]int,\n\tfoo_matrix: matrix[3,4]int,\n}") +} + /* Waiting for odin fix -- cgit v1.2.3