aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-17 11:20:13 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-17 11:27:56 -0400
commit34e42985f2bee18a9abf2d936070ba38d3fc5fa9 (patch)
tree7e7efd3369b381271b061eca19fb217cf1c01350 /src/server
parentaa4287a6c8bc06278db0abd5f7db902cf52af200 (diff)
Provide documentation for generic symbols
Diffstat (limited to 'src/server')
-rw-r--r--src/server/documentation.odin17
1 files changed, 10 insertions, 7 deletions
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,