gleam-lang/gleam

LSP: Inlay hints for multiline pipelines

Open

#3,291 opened on Jun 18, 2024

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Rust (960 forks)batch import
help wanted

Repository metrics

Stars
 (21,417 stars)
PR merge metrics
 (Avg merge 10d 19h) (69 merged PRs in 30d)

Description

It would be nice to have inlay hints showing the type of each line in a pipeline expression (that span across multiple lines)

This is the way this is shown in Rust: Screenshot 2024-06-18 at 18 25 21

I have a working POC in this PR

Open questions

  1. in a a |> f() |> ... |> g() expression, should we show a's type? (Rust shows it)
    1. should we show it even if the value if a simple literal (e.g. string or int)?
    2. should we show it even if the value is a variable whose type is a type with the same name? (e.g. html: Html)

Previous attempts

https://github.com/gleam-lang/gleam/issues/2319, https://github.com/gleam-lang/gleam/pull/2393, https://github.com/gleam-lang/gleam/pull/2525

Contributor guide