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

Configure Feed

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

Archive changelog

+311 -300
+1 -300
CHANGELOG.md
··· 1 1 # Changelog 2 2 3 - Dedicated to the memory of Len Pilfold. 4 - 5 - ## v1.8.0 - 2025-02-07 6 - 7 - ## v1.8.0-rc1 - 2025-02-03 3 + ## Unreleased 8 4 9 5 ### Compiler 10 6 11 - - Pipelines are now fault tolerant. A type error in the middle of a pipeline 12 - won't stop the compiler from figuring out the types of the remaining pieces, 13 - enabling the language server to show better suggestions for incomplete pipes. 14 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 15 - 16 - - Improved code generation for blocks in tail position on the Javascript target. 17 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 18 - 19 - - Function documentation comments and module documentation comments are now 20 - included in the generated Erlang code and can be browsed from the Erlang 21 - shell starting from OTP27. 22 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 23 - 24 - - Parsing of `case` expressions is now fault tolerant. If a `case` expressions 25 - is missing its body, the compiler can still perform type inference. This also 26 - allows the Language Server to provide completion hints for `case` subjects. 27 - ([Surya Rose](https://github.com/GearsDatapacks)) 28 - 29 - - The compiler can now suggest to wrap a value in an `Ok` or `Error` if that can 30 - solve a type mismatch error: 31 - 32 - ```gleam 33 - pub fn greet_logged_user() { 34 - use <- bool.guard(when: !logged_in, return: Error(Nil)) 35 - "Hello!" 36 - } 37 - ``` 38 - 39 - Results in the following error: 40 - 41 - ```txt 42 - error: Type mismatch 43 - ┌─ /main.gleam:7:3 44 - 45 - 7 │ "Hello!" 46 - │ ^^^^^^^^ Did you mean to wrap this in an `Ok`? 47 - 48 - Expected type: 49 - 50 - Result(a, Nil) 51 - 52 - Found type: 53 - 54 - String 55 - ``` 56 - 57 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 58 - 59 - - The compiler now shows an improved error message when using an unknown type as a 60 - variable name 61 - 62 - ```txt 63 - error: Unknown variable 64 - ┌─ /src/one/two.gleam:4:3 65 - 66 - 4 │ X 67 - │ ^ 68 - The custom type variant constructor `X` is not in scope here. 69 - ``` 70 - 71 - ([Roeeeee](https://github.com/5c077m4n)) 72 - 73 - - Erlang `file` module attributes now use paths relative to the root. 74 - ([Kasim](https://github.com/oneness)) 75 - 76 - ### Build tool 77 - 78 - - `gleam new` now has refined project name validation - rather than failing on 79 - invalid project names, it suggests a valid alternative and prompts for 80 - confirmation to use it. 81 - ([Diemo Gebhardt](https://github.com/diemogebhardt)) 82 - 83 - - `gleam docs build` generated documentation site now focuses the search input 84 - when "Cmd/Ctrl + K", "s" or "/" is pressed. 85 - ([Sambit Sahoo](https://github.com/soulsam480)) 86 - 87 - - `gleam deps` now supports `tree` operation that lists the dependency tree. 88 - 89 - ```markdown 90 - Usage: gleam deps tree [OPTIONS] 91 - 92 - Options: 93 - -p, --package <PACKAGE> Package to be used as the root of the tree 94 - -i, --invert <PACKAGE> Invert the tree direction and focus on the given package 95 - -h, --help Print help 96 - ``` 97 - 98 - For example, if the root project (`project_a`) depends on `package_b` and 99 - `package_c`, and `package_c` also depends on `package_b`, the output will be: 100 - 101 - 102 - ```markdown 103 - $ gleam deps tree 104 - 105 - project_a v1.0.0 106 - ├── package_b v0.52.0 107 - └── package_c v1.2.0 108 - └── package_b v0.52.0 109 - 110 - $ gleam deps tree --package package_c 111 - 112 - package_c v1.2.0 113 - └── package_b v0.52.0 114 - 115 - $ gleam deps tree --invert package_b 116 - 117 - package_b v0.52.0 118 - ├── package_c v1.2.0 119 - │ └── project_a v1.0.0 120 - └── project_a v1.0.0 121 - 122 - ``` 123 - 124 - ([Ramkarthik Krishnamurthy](https://github.com/ramkarthik)) 125 - 126 - - The build tool now checks for modules that would collide with the new Erlang 127 - `json` module in addition to the existing Erlang modules it already checked 128 - for. 129 - ([Louis Pilfold](https://github.com/lpil)) 130 - 131 7 ### Language server 132 8 133 - - The language server can now generate the definition of functions that do not 134 - exist in the current file. For example if I write the following piece of code: 135 - 136 - ```gleam 137 - import gleam/io 138 - 139 - pub type Pokemon { 140 - Pokemon(pokedex_number: Int, name: String) 141 - } 142 - 143 - pub fn main() { 144 - io.println(to_string(pokemon)) 145 - // ^ If you put your cursor over this function that is 146 - // not implemented yet 147 - } 148 - ``` 149 - 150 - Triggering the "generate function" code action, the language server will 151 - generate the following function for you: 152 - 153 - ```gleam 154 - fn to_string(pokemon: Pokemon) -> String { 155 - todo 156 - } 157 - ``` 158 - 159 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 160 - 161 - - The language server can now fill in the labels of any function call, even when 162 - only some of the arguments are provided. For example: 163 - 164 - ```gleam 165 - import gleam/string 166 - 167 - pub fn main() { 168 - string.replace("wibble") 169 - } 170 - ``` 171 - 172 - Will be completed to: 173 - 174 - ```gleam 175 - import gleam/string 176 - 177 - pub fn main() { 178 - string.replace("wibble", each: todo, with: todo) 179 - } 180 - ``` 181 - 182 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 183 - 184 - - The language server now suggests a code action to pattern match on a 185 - function's argument. For example: 186 - 187 - ```gleam 188 - pub type Pokemon { 189 - Pokemon(pokedex_number: Int, name: String) 190 - } 191 - 192 - pub fn to_string(pokemon: Pokemon) { 193 - // ^ If you put your cursor over the argument 194 - todo 195 - } 196 - ``` 197 - 198 - Triggering the code action on the `pokemon` argument will generate the 199 - following code for you: 200 - 201 - ```gleam 202 - pub type Pokemon { 203 - Pokemon(pokedex_number: Int, name: String) 204 - } 205 - 206 - pub fn to_string(pokemon: Pokemon) { 207 - let Pokemon(pokedex_number:, name:) = pokemon 208 - todo 209 - } 210 - ``` 211 - 212 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 213 - 214 - - The language server now suggests a code action to pattern match on a variable. 215 - For example: 216 - 217 - ```gleam 218 - pub fn main() { 219 - let result = list.first(a_list) 220 - // ^ If you put your cursor over the variable 221 - todo 222 - } 223 - ``` 224 - 225 - Triggering the code action on the `result` variable will generate the 226 - following code for you: 227 - 228 - ```gleam 229 - pub fn main() { 230 - let result = list.first(a_list) 231 - case result { 232 - Ok(value) -> todo 233 - Error(value) -> todo 234 - } 235 - todo 236 - } 237 - ``` 238 - 239 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 240 - 241 - - When generating functions or variables, the language server can now pick 242 - better names using the type of the code it's generating. 243 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 244 - 245 - - The Language Server now provides the ability to rename local variables. 246 - For example: 247 - 248 - ```gleam 249 - pub fn main() { 250 - let wibble = 10 251 - // ^ If you put your cursor here, and trigger a rename 252 - wibble + 1 253 - } 254 - ``` 255 - 256 - Triggering a rename and entering `my_number` results in this code: 257 - 258 - 259 - ```gleam 260 - pub fn main() { 261 - let my_number = 10 262 - my_number + 1 263 - } 264 - ``` 265 - 266 - ([Surya Rose](https://github.com/GearsDatapacks)) 267 - 268 - - `Unqualify` Action now get triggered when hovering over the module name 269 - for record value constructor. 270 - For example: 271 - 272 - ```gleam 273 - pub fn main() { 274 - let my_option = option.Some(1) 275 - // ^ would trigger "Unqualify option.Some" 276 - } 277 - ``` 278 - ([Jiangda Wang](https://github.com/Frank-III)) 279 - 280 9 ### Formatter 281 10 282 11 ### Bug fixes 283 - 284 - - Fixed a bug where the "convert from use" code action would generate invalid 285 - code for use expressions ending with a trailing comma. 286 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 287 - 288 - - Fixed a bug where floats outside of Erlang's floating point range were not 289 - causing errors. 290 - ([shayan](https://github.com/massivefermion)) 291 - 292 - - Fixed a bug where build tool could fail to add new dependencies when 293 - dependencies with optional dependencies are present in the manifest. 294 - ([Louis Pilfold](https://github.com/lpil)) 295 - 296 - - Fixed a bug where a block expression containing a singular record update would 297 - produce invalid erlang. 298 - ([yoshi](https://github.com/joshi-monster)) 299 - 300 - - Fixed a typo in the error message when trying to import a test module into an 301 - application module. 302 - ([John Strunk](https://github.com/jrstrunk)) 303 - 304 - - Fixed a bug where the "Extract variable" code action would erroneously extract 305 - a pipeline step as a variable. 306 - ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 307 - 308 - - Fixed a bug where variables bound in `let assert` assignments would be allowed 309 - to be used in the custom panic message. 310 - ([Surya Rose](https://github.com/GearsDatapacks))
+310
changelog/v1.8.md
··· 1 + # Changelog 2 + 3 + Dedicated to the memory of Len Pilfold. 4 + 5 + ## v1.8.0 - 2025-02-07 6 + 7 + ## v1.8.0-rc1 - 2025-02-03 8 + 9 + ### Compiler 10 + 11 + - Pipelines are now fault tolerant. A type error in the middle of a pipeline 12 + won't stop the compiler from figuring out the types of the remaining pieces, 13 + enabling the language server to show better suggestions for incomplete pipes. 14 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 15 + 16 + - Improved code generation for blocks in tail position on the Javascript target. 17 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 18 + 19 + - Function documentation comments and module documentation comments are now 20 + included in the generated Erlang code and can be browsed from the Erlang 21 + shell starting from OTP27. 22 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 23 + 24 + - Parsing of `case` expressions is now fault tolerant. If a `case` expressions 25 + is missing its body, the compiler can still perform type inference. This also 26 + allows the Language Server to provide completion hints for `case` subjects. 27 + ([Surya Rose](https://github.com/GearsDatapacks)) 28 + 29 + - The compiler can now suggest to wrap a value in an `Ok` or `Error` if that can 30 + solve a type mismatch error: 31 + 32 + ```gleam 33 + pub fn greet_logged_user() { 34 + use <- bool.guard(when: !logged_in, return: Error(Nil)) 35 + "Hello!" 36 + } 37 + ``` 38 + 39 + Results in the following error: 40 + 41 + ```txt 42 + error: Type mismatch 43 + ┌─ /main.gleam:7:3 44 + 45 + 7 │ "Hello!" 46 + │ ^^^^^^^^ Did you mean to wrap this in an `Ok`? 47 + 48 + Expected type: 49 + 50 + Result(a, Nil) 51 + 52 + Found type: 53 + 54 + String 55 + ``` 56 + 57 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 58 + 59 + - The compiler now shows an improved error message when using an unknown type as a 60 + variable name 61 + 62 + ```txt 63 + error: Unknown variable 64 + ┌─ /src/one/two.gleam:4:3 65 + 66 + 4 │ X 67 + │ ^ 68 + The custom type variant constructor `X` is not in scope here. 69 + ``` 70 + 71 + ([Roeeeee](https://github.com/5c077m4n)) 72 + 73 + - Erlang `file` module attributes now use paths relative to the root. 74 + ([Kasim](https://github.com/oneness)) 75 + 76 + ### Build tool 77 + 78 + - `gleam new` now has refined project name validation - rather than failing on 79 + invalid project names, it suggests a valid alternative and prompts for 80 + confirmation to use it. 81 + ([Diemo Gebhardt](https://github.com/diemogebhardt)) 82 + 83 + - `gleam docs build` generated documentation site now focuses the search input 84 + when "Cmd/Ctrl + K", "s" or "/" is pressed. 85 + ([Sambit Sahoo](https://github.com/soulsam480)) 86 + 87 + - `gleam deps` now supports `tree` operation that lists the dependency tree. 88 + 89 + ```markdown 90 + Usage: gleam deps tree [OPTIONS] 91 + 92 + Options: 93 + -p, --package <PACKAGE> Package to be used as the root of the tree 94 + -i, --invert <PACKAGE> Invert the tree direction and focus on the given package 95 + -h, --help Print help 96 + ``` 97 + 98 + For example, if the root project (`project_a`) depends on `package_b` and 99 + `package_c`, and `package_c` also depends on `package_b`, the output will be: 100 + 101 + 102 + ```markdown 103 + $ gleam deps tree 104 + 105 + project_a v1.0.0 106 + ├── package_b v0.52.0 107 + └── package_c v1.2.0 108 + └── package_b v0.52.0 109 + 110 + $ gleam deps tree --package package_c 111 + 112 + package_c v1.2.0 113 + └── package_b v0.52.0 114 + 115 + $ gleam deps tree --invert package_b 116 + 117 + package_b v0.52.0 118 + ├── package_c v1.2.0 119 + │ └── project_a v1.0.0 120 + └── project_a v1.0.0 121 + 122 + ``` 123 + 124 + ([Ramkarthik Krishnamurthy](https://github.com/ramkarthik)) 125 + 126 + - The build tool now checks for modules that would collide with the new Erlang 127 + `json` module in addition to the existing Erlang modules it already checked 128 + for. 129 + ([Louis Pilfold](https://github.com/lpil)) 130 + 131 + ### Language server 132 + 133 + - The language server can now generate the definition of functions that do not 134 + exist in the current file. For example if I write the following piece of code: 135 + 136 + ```gleam 137 + import gleam/io 138 + 139 + pub type Pokemon { 140 + Pokemon(pokedex_number: Int, name: String) 141 + } 142 + 143 + pub fn main() { 144 + io.println(to_string(pokemon)) 145 + // ^ If you put your cursor over this function that is 146 + // not implemented yet 147 + } 148 + ``` 149 + 150 + Triggering the "generate function" code action, the language server will 151 + generate the following function for you: 152 + 153 + ```gleam 154 + fn to_string(pokemon: Pokemon) -> String { 155 + todo 156 + } 157 + ``` 158 + 159 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 160 + 161 + - The language server can now fill in the labels of any function call, even when 162 + only some of the arguments are provided. For example: 163 + 164 + ```gleam 165 + import gleam/string 166 + 167 + pub fn main() { 168 + string.replace("wibble") 169 + } 170 + ``` 171 + 172 + Will be completed to: 173 + 174 + ```gleam 175 + import gleam/string 176 + 177 + pub fn main() { 178 + string.replace("wibble", each: todo, with: todo) 179 + } 180 + ``` 181 + 182 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 183 + 184 + - The language server now suggests a code action to pattern match on a 185 + function's argument. For example: 186 + 187 + ```gleam 188 + pub type Pokemon { 189 + Pokemon(pokedex_number: Int, name: String) 190 + } 191 + 192 + pub fn to_string(pokemon: Pokemon) { 193 + // ^ If you put your cursor over the argument 194 + todo 195 + } 196 + ``` 197 + 198 + Triggering the code action on the `pokemon` argument will generate the 199 + following code for you: 200 + 201 + ```gleam 202 + pub type Pokemon { 203 + Pokemon(pokedex_number: Int, name: String) 204 + } 205 + 206 + pub fn to_string(pokemon: Pokemon) { 207 + let Pokemon(pokedex_number:, name:) = pokemon 208 + todo 209 + } 210 + ``` 211 + 212 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 213 + 214 + - The language server now suggests a code action to pattern match on a variable. 215 + For example: 216 + 217 + ```gleam 218 + pub fn main() { 219 + let result = list.first(a_list) 220 + // ^ If you put your cursor over the variable 221 + todo 222 + } 223 + ``` 224 + 225 + Triggering the code action on the `result` variable will generate the 226 + following code for you: 227 + 228 + ```gleam 229 + pub fn main() { 230 + let result = list.first(a_list) 231 + case result { 232 + Ok(value) -> todo 233 + Error(value) -> todo 234 + } 235 + todo 236 + } 237 + ``` 238 + 239 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 240 + 241 + - When generating functions or variables, the language server can now pick 242 + better names using the type of the code it's generating. 243 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 244 + 245 + - The Language Server now provides the ability to rename local variables. 246 + For example: 247 + 248 + ```gleam 249 + pub fn main() { 250 + let wibble = 10 251 + // ^ If you put your cursor here, and trigger a rename 252 + wibble + 1 253 + } 254 + ``` 255 + 256 + Triggering a rename and entering `my_number` results in this code: 257 + 258 + 259 + ```gleam 260 + pub fn main() { 261 + let my_number = 10 262 + my_number + 1 263 + } 264 + ``` 265 + 266 + ([Surya Rose](https://github.com/GearsDatapacks)) 267 + 268 + - `Unqualify` Action now get triggered when hovering over the module name 269 + for record value constructor. 270 + For example: 271 + 272 + ```gleam 273 + pub fn main() { 274 + let my_option = option.Some(1) 275 + // ^ would trigger "Unqualify option.Some" 276 + } 277 + ``` 278 + ([Jiangda Wang](https://github.com/Frank-III)) 279 + 280 + ### Formatter 281 + 282 + ### Bug fixes 283 + 284 + - Fixed a bug where the "convert from use" code action would generate invalid 285 + code for use expressions ending with a trailing comma. 286 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 287 + 288 + - Fixed a bug where floats outside of Erlang's floating point range were not 289 + causing errors. 290 + ([shayan](https://github.com/massivefermion)) 291 + 292 + - Fixed a bug where build tool could fail to add new dependencies when 293 + dependencies with optional dependencies are present in the manifest. 294 + ([Louis Pilfold](https://github.com/lpil)) 295 + 296 + - Fixed a bug where a block expression containing a singular record update would 297 + produce invalid erlang. 298 + ([yoshi](https://github.com/joshi-monster)) 299 + 300 + - Fixed a typo in the error message when trying to import a test module into an 301 + application module. 302 + ([John Strunk](https://github.com/jrstrunk)) 303 + 304 + - Fixed a bug where the "Extract variable" code action would erroneously extract 305 + a pipeline step as a variable. 306 + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) 307 + 308 + - Fixed a bug where variables bound in `let assert` assignments would be allowed 309 + to be used in the custom panic message. 310 + ([Surya Rose](https://github.com/GearsDatapacks))