aboutsummaryrefslogtreecommitdiff
path: root/src/server/documentation.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-10 11:20:49 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-11 16:34:21 -0400
commit74bd4549170dd8115fc7e766202bc83c0e913739 (patch)
tree84b260659f4d20780e9bb387862db70fb263205c /src/server/documentation.odin
parent151fb26f5957338f670d2d6dbef01d75ff28cc8e (diff)
Correct all the newly broken tests due to changes
Diffstat (limited to 'src/server/documentation.odin')
-rw-r--r--src/server/documentation.odin72
1 files changed, 16 insertions, 56 deletions
diff --git a/src/server/documentation.odin b/src/server/documentation.odin
index 7b839c8..a8fd596 100644
--- a/src/server/documentation.odin
+++ b/src/server/documentation.odin
@@ -649,15 +649,11 @@ write_comments :: proc(sb: ^strings.Builder, comments: []^ast.Comment_Group, ind
// We concat the symbol information as follows
// attribute | variable | type | signature
// attributes and type information is optional
-
-concatenate_symbol_information :: proc {
- concatenate_raw_symbol_information,
- concatenate_raw_string_information,
-}
-
-construct_symbol_information :: proc(ast_context: ^AstContext, symbol: Symbol) -> string {
+construct_symbol_information :: proc(ast_context: ^AstContext, symbol: Symbol, write_attributes := true) -> string {
sb := strings.builder_make(ast_context.allocator)
- write_symbol_attributes(&sb, symbol)
+ if write_attributes {
+ write_symbol_attributes(&sb, symbol)
+ }
write_symbol_name(&sb, symbol)
if symbol.type == .Package {
@@ -722,11 +718,15 @@ write_symbol_type_information :: proc(sb: ^strings.Builder, ast_context: ^AstCon
return false
}
- if _, ok := symbol.value.(SymbolBasicValue); ok {
- return false
- }
-
- if _, ok := symbol.value.(SymbolUntypedValue); ok {
+ #partial switch v in symbol.value {
+ case SymbolUntypedValue,
+ SymbolBitSetValue,
+ SymbolMapValue,
+ SymbolSliceValue,
+ SymbolDynamicArrayValue,
+ SymbolFixedArrayValue,
+ SymbolMatrixValue,
+ SymbolMultiPointerValue:
return false
}
@@ -744,49 +744,9 @@ write_symbol_type_information :: proc(sb: ^strings.Builder, ast_context: ^AstCon
} else {
fmt.sbprintf(sb, "%s%s", pointer_prefix, symbol.type_name)
}
- return true
-}
-
-concatenate_raw_symbol_information :: proc(ast_context: ^AstContext, symbol: Symbol) -> string {
-
- // if pkg != "" && pkg != "$builtin" {
- // fmt.sbprintf(&sb, "%v.", pkg)
- // }
- // fmt.sbprintf(&sb, "%v", symbol.name)
- // if symbol.signature != "" {
- // fmt.sbprintf(&sb, ": %v", symbol.signature)
- // }
- // return strings.to_string(sb)
- //}
-
- return concatenate_raw_string_information(
- ast_context,
- symbol.pkg,
- symbol.name,
- symbol.signature,
- symbol.type,
- )
-}
-concatenate_raw_string_information :: proc(
- ast_context: ^AstContext,
- pkg: string,
- name: string,
- signature: string,
- type: SymbolType,
-) -> string {
- pkg := path.base(pkg, false, context.temp_allocator)
-
- if type == .Package {
- return fmt.tprintf("%v: package", name)
+ if v, ok := symbol.value.(SymbolUnionValue); ok {
+ write_poly_list(sb, v.poly, v.poly_names)
}
- sb := strings.builder_make()
- if pkg != "" && pkg != "$builtin" {
- fmt.sbprintf(&sb, "%v.", pkg)
- }
- fmt.sbprintf(&sb, "%v", name)
- if signature != "" {
- fmt.sbprintf(&sb, ": %v", signature)
- }
- return strings.to_string(sb)
+ return true
}