diff options
| author | Bradley Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-12 07:49:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-12 07:49:26 -0400 |
| commit | 35a6216537c8aaa44c68df6c37b3f54cf37c2d29 (patch) | |
| tree | 87e2529b7eb50d97a45a996179ee7d083f66ac04 /src/server/documentation.odin | |
| parent | b07233c04cef18b283ea88f0abc8d4fac51f7e84 (diff) | |
| parent | 6bdd9d0e01cc19d0a322520aca79b16532bb866f (diff) | |
Merge pull request #860 from BradLewis/fix/foreign-blocks
Fix issue with foreign block attributes
Diffstat (limited to 'src/server/documentation.odin')
| -rw-r--r-- | src/server/documentation.odin | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/server/documentation.odin b/src/server/documentation.odin index 3d752eb..cdc2112 100644 --- a/src/server/documentation.odin +++ b/src/server/documentation.odin @@ -471,6 +471,18 @@ write_procedure_symbol_signature :: proc(sb: ^strings.Builder, value: SymbolProc strings.write_string(sb, "proc") if s, ok := value.calling_convention.(string); ok && detailed_signature { fmt.sbprintf(sb, " %s ", s) + } else if len(value.attributes) > 0 { + for attr in value.attributes { + for elem in attr.elems { + if ident, value, ok := unwrap_attr_elem(elem); ok { + if ident.name == "default_calling_convention" { + strings.write_string(sb, " ") + build_string_node(value, sb, false) + strings.write_string(sb, " ") + } + } + } + } } write_proc_param_list_and_return(sb, value) if detailed_signature { @@ -677,12 +689,27 @@ write_symbol_attributes :: proc(sb: ^strings.Builder, symbol: Symbol) { strings.write_string(sb, "@()\n") continue } + if len(attribute.elems) == 1 { + if ident, _, ok := unwrap_attr_elem(attribute.elems[0]); ok { + if ident.name == "default_calling_convention" { + continue + } + } + } strings.write_string(sb, "@(") for elem, i in attribute.elems { + if ident, value, ok := unwrap_attr_elem(elem); ok { + if ident.name == "default_calling_convention" { + continue + } + + if value != nil { + build_string_node(ident, sb, false) + strings.write_string(sb, "=") + build_string_node(value, sb, false) + } + } if directive, ok := elem.derived.(^ast.Field_Value); ok { - build_string_node(directive.field, sb, false) - strings.write_string(sb, "=") - build_string_node(directive.value, sb, false) } else { build_string_node(elem, sb, false) } |