From 20c207ce22a4233a5bcf79b1328bed4d7ba06153 Mon Sep 17 00:00:00 2001 From: Brad Lewis <22850972+BradLewis@users.noreply.github.com> Date: Thu, 31 Jul 2025 20:23:36 -0400 Subject: Remove markdown and duplicate comments from signature documentation --- src/server/documentation.odin | 8 ++++++-- src/server/signature.odin | 6 ++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/server') 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, } -- cgit v1.2.3