Commits
When a variable is shadowed inside a directly matching case branch and
then rebound after the case, the JavaScript code generator could declare
the same let variable twice in one scope. A directly matching branch
generates code into the enclosing scope, so the generator now keeps the
highest counter value used for a name and does not go below it.
Fixes #5748
Closes https://github.com/gleam-lang/gleam/issues/4474
When an unknown type is referenced in the source, the language server
now offers a "Generate type" code action that inserts a type stub
before the containing definition. For example:
pub fn wibble(arg: Wibble) { todo }
generates:
type Wibble
pub fn wibble(arg: Wibble) { todo }
Parameterised types use the original names from the call site:
Wibble(some, generics) → pub type Wibble(some, generics)
Types used in public contexts are generated as pub.
Closes #5389
When a variable is shadowed inside a directly matching case branch and
then rebound after the case, the JavaScript code generator could declare
the same let variable twice in one scope. A directly matching branch
generates code into the enclosing scope, so the generator now keeps the
highest counter value used for a name and does not go below it.
Fixes #5748
When an unknown type is referenced in the source, the language server
now offers a "Generate type" code action that inserts a type stub
before the containing definition. For example:
pub fn wibble(arg: Wibble) { todo }
generates:
type Wibble
pub fn wibble(arg: Wibble) { todo }
Parameterised types use the original names from the call site:
Wibble(some, generics) → pub type Wibble(some, generics)
Types used in public contexts are generated as pub.
Closes #5389