diff options
| author | Bradley Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-07-31 20:27:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-31 20:27:15 -0400 |
| commit | 5d1bf18bb5e0494759fce01490fe02b802c26561 (patch) | |
| tree | 12cb74a9e1d293b05190a19c7d3bcf7f9011aa75 /src/server | |
| parent | 429b6946fffcef8f6d9d03ac98a438450cff5caa (diff) | |
| parent | 20c207ce22a4233a5bcf79b1328bed4d7ba06153 (diff) | |
Merge pull request #816 from BradLewis/fix/signature-documentation
Remove markdown and duplicate comments from signature documentation
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/documentation.odin | 8 | ||||
| -rw-r--r-- | src/server/signature.odin | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/server/documentation.odin b/src/server/documentation.odin index aab3cff..ab5b827 100644 --- a/src/server/documentation.odin +++ b/src/server/documentation.odin @@ -120,7 +120,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) @@ -130,7 +130,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, } |