From 34e42985f2bee18a9abf2d936070ba38d3fc5fa9 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Sun, 17 Aug 2025 11:20:13 -0400 Subject: Provide documentation for generic symbols --- src/server/documentation.odin | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/server/documentation.odin b/src/server/documentation.odin index a0922fd..c076008 100644 --- a/src/server/documentation.odin +++ b/src/server/documentation.odin @@ -331,7 +331,7 @@ write_short_signature :: proc(sb: ^strings.Builder, ast_context: ^AstContext, sy fmt.sbprintf(sb, "%smap[", pointer_prefix) build_string_node(v.key, sb, false) strings.write_string(sb, "]") - write_node(ast_context, sb, v.value, "", short_signature = true) + write_node(sb, ast_context, v.value, "", short_signature = true) return case SymbolProcedureValue: write_procedure_symbol_signature(sb, v, detailed_signature = true) @@ -370,21 +370,21 @@ write_short_signature :: proc(sb: ^strings.Builder, ast_context: ^AstContext, sy return case SymbolMultiPointerValue: fmt.sbprintf(sb, "%s[^]", pointer_prefix) - write_node(ast_context, sb, v.expr, "", short_signature = true) + write_node(sb, ast_context, v.expr, "", short_signature = true) return case SymbolDynamicArrayValue: fmt.sbprintf(sb, "%s[dynamic]", pointer_prefix) - write_node(ast_context, sb, v.expr, "", short_signature = true) + write_node(sb, ast_context, v.expr, "", short_signature = true) return case SymbolSliceValue: fmt.sbprintf(sb, "%s[]", pointer_prefix) - write_node(ast_context, sb, v.expr, "", short_signature = true) + write_node(sb, ast_context, v.expr, "", short_signature = true) return case SymbolFixedArrayValue: fmt.sbprintf(sb, "%s[", pointer_prefix) build_string_node(v.len, sb, false) strings.write_string(sb, "]") - write_node(ast_context, sb, v.expr, "", short_signature = true) + write_node(sb, ast_context, v.expr, "", short_signature = true) return case SymbolMatrixValue: fmt.sbprintf(sb, "%smatrix[", pointer_prefix) @@ -409,6 +409,9 @@ write_short_signature :: proc(sb: ^strings.Builder, ast_context: ^AstContext, sy strings.write_string(sb, "int") } return + case SymbolGenericValue: + build_string_node(v.expr, sb, false) + return } return @@ -574,7 +577,7 @@ write_struct_hover :: proc(sb: ^strings.Builder, ast_context: ^AstContext, v: Sy name_len += len(using_prefix) } fmt.sbprintf(sb, "%s:%*s", v.names[i], longestNameLen - name_len + 1, "") - write_node(ast_context, sb, v.types[i], v.names[i], depth + 1) + write_node(sb, ast_context, v.types[i], v.names[i], depth + 1) if bit_size, ok := v.bit_sizes[i]; ok { fmt.sbprintf(sb, "%*s| ", longest_type_len - len(type_names[i]) + 1, "") build_string_node(bit_size, sb, false) @@ -632,8 +635,8 @@ write_union_kind :: proc(sb: ^strings.Builder, kind: ast.Union_Type_Kind) { } write_node :: proc( - ast_context: ^AstContext, sb: ^strings.Builder, + ast_context: ^AstContext, node: ^ast.Node, name: string, depth := 0, -- cgit v1.2.3