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 documentation

+150 -1
+8
CHANGELOG.md
··· 1 1 # Changelog 2 2 3 + ## Unreleased 4 + 5 + ### Bug fixes 6 + 7 + - Fixed a bug where type constructors with many fields would not be formatted 8 + properly in the generated documentation. 9 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 10 + 3 11 ## v1.11.0-rc1 - 2025-05-15 4 12 5 13 ### Compiler
+1 -1
compiler-core/src/docs/printer.rs
··· 286 286 287 287 let arguments = Self::wrap_arguments(arguments); 288 288 289 - docvec![self.title(&constructor.name), arguments] 289 + docvec![self.title(&constructor.name), arguments].group() 290 290 } 291 291 292 292 fn type_alias<'a>(
+51
compiler-core/src/docs/snapshots/gleam_core__docs__tests__constructor_with_long_types_and_many_fields.snap
··· 1 + --- 2 + source: compiler-core/src/docs/tests.rs 3 + expression: output 4 + --- 5 + ---- SOURCE CODE 6 + -- option.gleam 7 + pub type Option(a) 8 + 9 + -- main.gleam 10 + 11 + import option 12 + 13 + pub type Uri { 14 + Uri( 15 + scheme: option.Option(String), 16 + userinfo: option.Option(String), 17 + host: option.Option(String), 18 + port: option.Option(Int), 19 + path: String, 20 + query: option.Option(String), 21 + fragment: option.Option(String) 22 + ) 23 + } 24 + 25 + 26 + ---- TYPES 27 + 28 + --- Uri 29 + <pre><code>pub type Uri { 30 + Uri( 31 + scheme: option.Option(String), 32 + userinfo: option.Option(String), 33 + host: option.Option(String), 34 + port: option.Option(Int), 35 + path: String, 36 + query: option.Option(String), 37 + fragment: option.Option(String), 38 + ) 39 + }</code></pre> 40 + 41 + -- CONSTRUCTORS 42 + 43 + <pre><code>Uri( 44 + scheme: option.Option(String), 45 + userinfo: option.Option(String), 46 + host: option.Option(String), 47 + port: option.Option(Int), 48 + path: String, 49 + query: option.Option(String), 50 + fragment: option.Option(String), 51 + )</code></pre>
+47
compiler-core/src/docs/snapshots/gleam_core__docs__tests__constructor_with_long_types_and_many_fields_that_need_splitting.snap
··· 1 + --- 2 + source: compiler-core/src/docs/tests.rs 3 + expression: output 4 + --- 5 + ---- SOURCE CODE 6 + -- option.gleam 7 + pub type Option(a) 8 + 9 + -- main.gleam 10 + 11 + import option 12 + 13 + pub type TypeWithAVeryLoooooooooooooooooooongName 14 + 15 + pub type Wibble { 16 + Wibble( 17 + wibble: #(TypeWithAVeryLoooooooooooooooooooongName, TypeWithAVeryLoooooooooooooooooooongName), 18 + wobble: option.Option(String), 19 + ) 20 + } 21 + 22 + 23 + ---- TYPES 24 + 25 + --- TypeWithAVeryLoooooooooooooooooooongName 26 + <pre><code>pub type TypeWithAVeryLoooooooooooooooooooongName</code></pre> 27 + 28 + --- Wibble 29 + <pre><code>pub type Wibble { 30 + Wibble( 31 + wibble: #( 32 + TypeWithAVeryLoooooooooooooooooooongName, 33 + TypeWithAVeryLoooooooooooooooooooongName, 34 + ), 35 + wobble: option.Option(String), 36 + ) 37 + }</code></pre> 38 + 39 + -- CONSTRUCTORS 40 + 41 + <pre><code>Wibble( 42 + wibble: #( 43 + TypeWithAVeryLoooooooooooooooooooongName, 44 + TypeWithAVeryLoooooooooooooooooooongName, 45 + ), 46 + wobble: option.Option(String), 47 + )</code></pre>
+43
compiler-core/src/docs/tests.rs
··· 1119 1119 ONLY_LINKS 1120 1120 ); 1121 1121 } 1122 + 1123 + #[test] 1124 + fn constructor_with_long_types_and_many_fields() { 1125 + assert_documentation!( 1126 + ("option", "pub type Option(a)"), 1127 + " 1128 + import option 1129 + 1130 + pub type Uri { 1131 + Uri( 1132 + scheme: option.Option(String), 1133 + userinfo: option.Option(String), 1134 + host: option.Option(String), 1135 + port: option.Option(Int), 1136 + path: String, 1137 + query: option.Option(String), 1138 + fragment: option.Option(String) 1139 + ) 1140 + } 1141 + ", 1142 + NONE 1143 + ); 1144 + } 1145 + 1146 + #[test] 1147 + fn constructor_with_long_types_and_many_fields_that_need_splitting() { 1148 + assert_documentation!( 1149 + ("option", "pub type Option(a)"), 1150 + " 1151 + import option 1152 + 1153 + pub type TypeWithAVeryLoooooooooooooooooooongName 1154 + 1155 + pub type Wibble { 1156 + Wibble( 1157 + wibble: #(TypeWithAVeryLoooooooooooooooooooongName, TypeWithAVeryLoooooooooooooooooooongName), 1158 + wobble: option.Option(String), 1159 + ) 1160 + } 1161 + ", 1162 + NONE 1163 + ); 1164 + }