diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-17 18:53:10 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-17 20:41:52 -0400 |
| commit | 4eca8c2b02cb03f6de910b240439117e26192e28 (patch) | |
| tree | 620f3724db225e4e60921dcfcf06919b1e1d75cf /src | |
| parent | 6282669ff2438cdeb1b90b05af0f573602ad3144 (diff) | |
Add #soa to hover information
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/ast.odin | 2 | ||||
| -rw-r--r-- | src/server/documentation.odin | 18 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/server/ast.odin b/src/server/ast.odin index f33ac6b..f7f3083 100644 --- a/src/server/ast.odin +++ b/src/server/ast.odin @@ -1221,11 +1221,13 @@ build_string_node :: proc(node: ^ast.Node, builder: ^strings.Builder, remove_poi } build_string(n.elem, builder, remove_pointers) case ^Array_Type: + build_string(n.tag, builder, remove_pointers) strings.write_string(builder, "[") build_string(n.len, builder, remove_pointers) strings.write_string(builder, "]") build_string(n.elem, builder, remove_pointers) case ^Dynamic_Array_Type: + build_string(n.tag, builder, remove_pointers) strings.write_string(builder, "[dynamic]") build_string(n.elem, builder, remove_pointers) case ^Struct_Type: diff --git a/src/server/documentation.odin b/src/server/documentation.odin index 2f73ed2..84d8c2e 100644 --- a/src/server/documentation.odin +++ b/src/server/documentation.odin @@ -372,15 +372,27 @@ write_short_signature :: proc(sb: ^strings.Builder, ast_context: ^AstContext, sy write_node(sb, ast_context, v.expr, "", short_signature = true) return case SymbolDynamicArrayValue: - fmt.sbprintf(sb, "%s[dynamic]", pointer_prefix) + strings.write_string(sb, pointer_prefix) + if .Soa in symbol.flags { + strings.write_string(sb, "#soa") + } + strings.write_string(sb, "[dynamic]") write_node(sb, ast_context, v.expr, "", short_signature = true) return case SymbolSliceValue: - fmt.sbprintf(sb, "%s[]", pointer_prefix) + strings.write_string(sb, pointer_prefix) + if .Soa in symbol.flags { + strings.write_string(sb, "#soa") + } + strings.write_string(sb, "[]") write_node(sb, ast_context, v.expr, "", short_signature = true) return case SymbolFixedArrayValue: - fmt.sbprintf(sb, "%s[", pointer_prefix) + strings.write_string(sb, pointer_prefix) + if .Soa in symbol.flags { + strings.write_string(sb, "#soa") + } + strings.write_string(sb, "[") build_string_node(v.len, sb, false) strings.write_string(sb, "]") write_node(sb, ast_context, v.expr, "", short_signature = true) |