gleam-lang / gleam

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

LSP: narrow complete suggestions after a pipe #3297

Open gusinacio opened 1 week ago

gusinacio commented 1 week ago

I don't know how functional languages LSPs usually handle this case but it would be nice if suggestions after a pipe are functions that contain the type as the first parameter. i.e:

"hello" |> // <- This would only suggest functions that have String as the first parameter type

If there are multiple pipes, the suggestions should be related to the last output value.

"2" |> int.parse |>  // <- This would only suggest functions that have Result as the first parameter type
lpil commented 1 week ago

Good suggestion, thank you!