Skip to content
Tech News
← Back to articles

A field day for Gleam's language server – Gleam v1.18.0 release

read original more articles
Why This Matters

The Gleam v1.18.0 release significantly enhances developer tooling by adding full support for record fields, type variable renaming, and module import updates in its language server. These improvements streamline development workflows, improve code refactoring, and bolster static analysis capabilities, making Gleam more attractive for both individual developers and teams in the tech industry.

Key Takeaways

Gleam is a type safe and scalable language for the Erlang virtual machine and JavaScript runtimes. Today Gleam v1.18.0 has been published.

Language server record field support

Gleam's focus on static analysis and static types really helps with creating tooling, and that can be seen very clearly with Gleam's much-loved language server. All its features and capabilities can be seen in its documentation.

One remaining missing part of it was full support for record fields, a problem now fixed! The language server now supports go-to-definition, find-references and rename for record fields. These work on the field declaration, on labelled arguments, on labelled patterns, on record updates and on record.field accesses, both within a module and across modules. For example:

pub type Person { Person (name: String , age: Int ) } pub fn main () { let lucy = Person (name: "Lucy" , age: 10 ) lucy.name }

Thank you Alistair Smith! People will be very happy for this one!

Type variable renaming

Similarly, the language server now permits renaming type variables in functions, types, and constants. For example:

pub fn twice (value: a, f: fn (a) -> a) -> a { f ( f (value)) }

Produces:

... continue reading