-
Generated Erlang
.app
files now include external modules written in Elixir and Erlang. (LostKobrakai) -
HexDocs documentation of Gleam packages now uses the ExDocs search data model, allowing for global indexing of Gleam packages in HexDocs, and making Gleam packages discoverable through global search of HexDocs. (Diemo Gebhardt)
-
Allow users to set the
GLEAM_CACERTS_PATH
environment variable to specify a path to a directory containing CA certificates to install Hex packages. (winstxnhdw)
-
The language server now offers a code action to convert the first step of a pipeline to a regular function call. For example, this code:
import gleam/list pub fn main() { [1, 2, 3] |> list.map(fn(n) { n * 2 }) }
Will be rewritten as:
import gleam/list pub fn main() { list.map([1, 2, 3], fn(n) { n * 2 }) }
-
The language server now offers a code action to convert a function call into a pipeline. For example, this code:
import gleam/list pub fn main() { list.map([1, 2, 3], fn(n) { n * 2 }) }
Will be rewritten as:
import gleam/list pub fn main() { [1, 2, 3] |> list.map(fn(n) { n * 2 }) }
You can also pick which argument is going to be piped. In this case:
import gleam/list pub fn main() { list.map([1, 2, 3], fn(n) { n * 2 }) // ^ If you put your cursor over here }
The code will be rewritten as:
import gleam/list pub fn main() { fn(n) { n * 2 } |> list.map([1, 2, 3], _) }
-
The Language Server now suggests a code action to generate a function to encode a custom type as JSON using the
gleam_json
package. For example:pub type Person { Person(name: String, age: Int) }
Will become:
import gleam/json pub type Person { Person(name: String, age: Int) } fn encode_person(person: Person) -> json.Json { json.object([ #("name", json.string(person.name)), #("age", json.int(person.age)), ]) }
-
The Language Server now suggests a code action to inline a variable which is only used once. For example, this code:
import gleam/io pub fn main() { let greeting = "Hello!" io.println(greeting) }
Will be rewritten as:
import gleam/io pub fn main() { io.println("Hello!") }
- Fixed a bug where division and remainder operators would not work correctly in guards on the JavaScript target. (Surya Rose)
- Fixed a metadata caching bug where accessors for opaque types could sometimes be used in other modules. (Louis Pilfold)