[Feature request] Is it possible to add codelens decoration on the VSCode extension?

Hi ReScript Team,

One feature that I miss working with ReScript that I had on Reason (using ocaml-lsp) was the editor telling me the interface of each function/module above as a CodeLens (Visual Studio Code Extensions using CodeLens, I couldn’t find a more explanatory documentation).

The other feature that is slightly related is what’s happening on Rust where intermediate pipins and other expressions get inferred the type: User Manual

Would this two features be doable?

2 Likes

The latter one are inlay hints which are already being worked on by @aspeddro: https://github.com/rescript-lang/rescript-vscode/pull/453

2 Likes

Yeah code lens for functions is really neat. It’s doable for sure, and (famous last words) if we limit the scope to just showing functions to start, it should be fairly quick. Code lenses are quite simple in the LS protocol.

@davesnx we’re a bit occupied working on other features at the moment, but would you be interested in taking a stab at implementing it? We could guide you, and like I said I think it should be fairly simple. Please feel free to contact me if you’d be interested in that.

A basic, experimental version of inlay hints has landed and will be included (behind a flag) in the next extension release (very soon). https://github.com/rescript-lang/rescript-vscode/pull/453

(sorry for cross posting)

4 Likes

…and code lens for function definitions have also been implemented now: https://github.com/rescript-lang/rescript-vscode/pull/513

4 Likes