Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

fix generated docs

+40 -5
+3
CHANGELOG.md
··· 471 471 result in invalid code. 472 472 ([Surya Rose](https://github.com/GearsDatapacks)) 473 473 474 + - Fixed a bug where the generated documentation would not be formatted properly. 475 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 476 + 474 477 ## v1.11.1 - 2025-06-05 475 478 476 479 ### Compiler
+8 -5
compiler-core/src/docs/printer.rs
··· 335 335 } 336 336 self.register_local_type_variable_names(return_type); 337 337 338 - let arguments = arguments.iter().map(|argument| { 339 - let name = self.variable(self.argument_name(argument)); 340 - docvec![name, ": ", self.type_(&argument.type_)].group() 341 - }); 342 - let arguments = Self::wrap_arguments(arguments); 338 + let arguments = if arguments.is_empty() { 339 + "()".to_doc() 340 + } else { 341 + Self::wrap_arguments(arguments.iter().map(|argument| { 342 + let name = self.variable(self.argument_name(argument)); 343 + docvec![name, ": ", self.type_(&argument.type_)].group() 344 + })) 345 + }; 343 346 344 347 docvec![ 345 348 self.keyword("pub fn "),
+16
compiler-core/src/docs/snapshots/gleam_core__docs__tests__long_function_with_no_arguments_parentheses_are_not_split.snap
··· 1 + --- 2 + source: compiler-core/src/docs/tests.rs 3 + expression: output 4 + --- 5 + ---- SOURCE CODE 6 + -- main.gleam 7 + 8 + pub fn aaaaaaaaaaaaaaaaaaaaaaaaaaaa() -> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa { 9 + todo 10 + } 11 + 12 + 13 + ---- VALUES 14 + 15 + --- aaaaaaaaaaaaaaaaaaaaaaaaaaaa 16 + <pre><code>pub fn aaaaaaaaaaaaaaaaaaaaaaaaaaaa() -> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</code></pre>
+13
compiler-core/src/docs/tests.rs
··· 1165 1165 NONE 1166 1166 ); 1167 1167 } 1168 + 1168 1169 #[test] 1169 1170 fn gitea_repository_url_has_no_double_slash() { 1170 1171 let repo = Repository::Gitea { ··· 1179 1180 "https://code.example.org/person/forgejo_bug" 1180 1181 ); 1181 1182 } 1183 + 1184 + #[test] 1185 + fn long_function_with_no_arguments_parentheses_are_not_split() { 1186 + assert_documentation!( 1187 + " 1188 + pub fn aaaaaaaaaaaaaaaaaaaaaaaaaaaa() -> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa { 1189 + todo 1190 + } 1191 + ", 1192 + NONE 1193 + ); 1194 + }