diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-10 13:40:04 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-09-10 13:44:11 -0400 |
| commit | a60d0daad2ff3e57eb9942c58c532007794bbd63 (patch) | |
| tree | 8d888b9551b1b2a66886d1b09451fe8f79287d70 /src/server | |
| parent | 8f44d4c36c2712b9d230238b58042e79df67cefd (diff) | |
Add parentheses around named proc returns
Diffstat (limited to 'src/server')
| -rw-r--r-- | src/server/documentation.odin | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/documentation.odin b/src/server/documentation.odin index 49674ad..6f591a4 100644 --- a/src/server/documentation.odin +++ b/src/server/documentation.odin @@ -486,7 +486,14 @@ write_proc_param_list_and_return :: proc(sb: ^strings.Builder, value: SymbolProc if len(value.orig_return_types) != 0 { strings.write_string(sb, " -> ") + add_parens := false if len(value.orig_return_types) > 1 { + add_parens = true + } else if field, ok := value.orig_return_types[0].derived.(^ast.Field); ok && len(field.names) > 0{ + add_parens = true + } + + if add_parens { strings.write_string(sb, "(") } @@ -497,7 +504,7 @@ write_proc_param_list_and_return :: proc(sb: ^strings.Builder, value: SymbolProc } } - if len(value.orig_return_types) > 1 { + if add_parens { strings.write_string(sb, ")") } } else if value.diverging { |