aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-31 20:23:36 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-31 20:23:36 -0400
commit20c207ce22a4233a5bcf79b1328bed4d7ba06153 (patch)
treea7c51754e5bc1b0a741256bddd2da80cead97107 /src
parent56447447ddb370ea74d66cf27ea5395b432a7700 (diff)
Remove markdown and duplicate comments from signature documentation
Diffstat (limited to 'src')
-rw-r--r--src/server/documentation.odin8
-rw-r--r--src/server/signature.odin6
2 files changed, 8 insertions, 6 deletions
diff --git a/src/server/documentation.odin b/src/server/documentation.odin
index 4e1cf9f..f5dfcde 100644
--- a/src/server/documentation.odin
+++ b/src/server/documentation.odin
@@ -118,7 +118,7 @@ build_documentation :: proc(ast_context: ^AstContext, symbol: ^Symbol, short_sig
}
}
-construct_symbol_docs :: proc(symbol: Symbol, allocator := context.temp_allocator) -> string {
+construct_symbol_docs :: proc(symbol: Symbol, markdown := true, allocator := context.temp_allocator) -> string {
sb := strings.builder_make(allocator = allocator)
if symbol.doc != "" {
strings.write_string(&sb, symbol.doc)
@@ -128,7 +128,11 @@ construct_symbol_docs :: proc(symbol: Symbol, allocator := context.temp_allocato
}
if symbol.comment != "" {
- fmt.sbprintf(&sb, "\n```odin\n%s\n```", symbol.comment)
+ if markdown {
+ fmt.sbprintf(&sb, "\n```odin\n%s\n```", symbol.comment)
+ } else {
+ fmt.sbprintf(&sb, "\n%s", symbol.comment)
+ }
}
return strings.to_string(sb)
diff --git a/src/server/signature.odin b/src/server/signature.odin
index f40da31..67b0970 100644
--- a/src/server/signature.odin
+++ b/src/server/signature.odin
@@ -134,14 +134,13 @@ get_signature_information :: proc(document: ^Document, position: common.Position
parameters[i].label = node_to_string(arg)
}
- call.doc = construct_symbol_docs(call)
sb := strings.builder_make(context.temp_allocator)
write_procedure_symbol_signature(&sb, value, detailed_signature = false)
call.signature = strings.to_string(sb)
info := SignatureInformation {
label = concatenate_raw_string_information(&ast_context, call.pkg, call.name, call.signature, call.type),
- documentation = construct_symbol_docs(call),
+ documentation = construct_symbol_docs(call, markdown = false),
parameters = parameters,
}
append(&signature_information, info)
@@ -163,14 +162,13 @@ get_signature_information :: proc(document: ^Document, position: common.Position
parameters[i].label = node_to_string(arg)
}
- symbol.doc = construct_symbol_docs(symbol)
sb := strings.builder_make(context.temp_allocator)
write_procedure_symbol_signature(&sb, value, detailed_signature = false)
symbol.signature = strings.to_string(sb)
info := SignatureInformation {
label = concatenate_raw_string_information(&ast_context, symbol.pkg, symbol.name, symbol.signature, symbol.type),
- documentation = construct_symbol_docs(symbol),
+ documentation = construct_symbol_docs(symbol, markdown = false),
parameters = parameters,
}