gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
18.15k stars 763 forks source link

Support "Fill labels" code action if there are already arguments provided #3885

Open joshi-monster opened 1 week ago

joshi-monster commented 1 week ago

The language server supports a "add labels" code action, but only if there are no explicit arguments provided:

before:

fn wibble(a a: Int, b b: Float, c c: String) {
  a + b + c
}

fn wobble() {
  wibble()
  //    ^
}

after:

fn wobble() {
  wibble(a: todo, b: todo, c: todo)
}

It would be great if this code action could also support cases where I already partially supply arguments to a function or record constructor. This would be really useful if I added a new argument(s) or field(s), and I want to now update all the call-sides with the new arguments. This code action could add the missing labels for me, so I would have to just fill out the values. ~ :purple_heart:

lpil commented 1 week ago

Sounds good!