aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-30 20:47:34 -0400
committerGitHub <noreply@github.com>2025-07-30 20:47:34 -0400
commitd129fa185bc60585a3a90e4842c8c0cc9952159d (patch)
tree0ad2c5660bad17e47cd072fc471db3ee0f004682
parentfdec06dd815b2074a938a390ad15d798b4d24159 (diff)
parentcbe778366f874a9328c9e191ce51c51e417a3026 (diff)
Merge pull request #810 from BradLewis/fix/dont-override-symbol-docs
Don't override the docs on the symbols to avoid memory corruption issues
-rw-r--r--src/server/documentation.odin10
-rw-r--r--src/server/hover.odin3
-rw-r--r--src/server/symbol.odin2
3 files changed, 2 insertions, 13 deletions
diff --git a/src/server/documentation.odin b/src/server/documentation.odin
index 6518006..4e1cf9f 100644
--- a/src/server/documentation.odin
+++ b/src/server/documentation.odin
@@ -116,16 +116,6 @@ build_documentation :: proc(ast_context: ^AstContext, symbol: ^Symbol, short_sig
if symbol.doc == "" && symbol.comment == "" {
return
}
-
- symbol.doc = construct_symbol_docs(symbol^, allocator = ast_context.allocator)
-}
-
-// Adds signature and docs information for a bit field field
-build_bit_field_field_documentation :: proc(
- symbol: ^Symbol, value: SymbolBitFieldValue, index: int, allocator := context.temp_allocator
-) {
- symbol.signature = get_bit_field_field_signature(value, index, allocator)
- symbol.doc = construct_symbol_docs(symbol^)
}
construct_symbol_docs :: proc(symbol: Symbol, allocator := context.temp_allocator) -> string {
diff --git a/src/server/hover.odin b/src/server/hover.odin
index 0a82406..364585d 100644
--- a/src/server/hover.odin
+++ b/src/server/hover.odin
@@ -35,10 +35,11 @@ write_hover_content :: proc(ast_context: ^AstContext, symbol: Symbol) -> MarkupC
}
cat := concatenate_symbol_information(ast_context, symbol)
+ doc := construct_symbol_docs(symbol)
if cat != "" {
content.kind = "markdown"
- content.value = fmt.tprintf("```odin\n%v\n```%v", cat, symbol.doc)
+ content.value = fmt.tprintf("```odin\n%v\n```%v", cat, doc)
} else {
content.kind = "plaintext"
}
diff --git a/src/server/symbol.odin b/src/server/symbol.odin
index 7700362..d933819 100644
--- a/src/server/symbol.odin
+++ b/src/server/symbol.odin
@@ -788,9 +788,7 @@ construct_bit_field_field_symbol :: proc(symbol: ^Symbol, parent_name: string, v
symbol.type = .Field
symbol.doc = get_doc(value.docs[index], context.temp_allocator)
symbol.comment = get_comment(value.comments[index])
- symbol.doc = construct_symbol_docs(symbol^)
symbol.signature = get_bit_field_field_signature(value, index)
- //build_bit_field_field_documentation(symbol, value, index)
}
construct_enum_field_symbol :: proc(symbol: ^Symbol, value: SymbolEnumValue, index: int) {