aboutsummaryrefslogtreecommitdiff
path: root/src/server/symbol.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-18 20:58:46 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-08-18 21:07:42 -0400
commit8935def41b78130df63fd27a143f15224b2e9b04 (patch)
treeebef8b7d5ac3eb3b15d9642ec8caddc25e44e6e3 /src/server/symbol.odin
parent2ba84dcc4e19a1b66e3c270b7391cc8ae92e97b4 (diff)
Fix issues adding ast struct comments with the temporary allocator
Diffstat (limited to 'src/server/symbol.odin')
-rw-r--r--src/server/symbol.odin4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/symbol.odin b/src/server/symbol.odin
index d163e45..3e97fba 100644
--- a/src/server/symbol.odin
+++ b/src/server/symbol.odin
@@ -369,7 +369,9 @@ write_struct_type :: proc(
inlined := false,
) {
b.poly = v.poly_params
- construct_struct_field_docs(ast_context.file, v)
+ // We clone this so we don't override docs and comments with temp allocated docs and comments
+ v := cast(^ast.Struct_Type)clone_node(v, ast_context.allocator, nil)
+ construct_struct_field_docs(ast_context.file, v, ast_context.allocator)
for field in v.fields.list {
for n in field.names {
if identifier, ok := n.derived.(^ast.Ident); ok && field.type != nil {