grain icon indicating copy to clipboard operation
grain copied to clipboard

LSP: Add support for inlay hints

Open sanathusk opened this issue 3 years ago • 5 comments

Many languages like Javascript/ typescript, rust(through rust-analyzer VS code extension) provide support for inlay hint in VS Code as shown below.inlay hint provides hints for type of variable defined in a different colored text as shown below: image The inlay hints are optional can can be enabled by user. If grain lang could provide similar support, it could improve the developer experience greatly.

sanathusk avatar Jul 15 '22 05:07 sanathusk

I definitely want this feature! It makes our excellent type inference even nicer.

I believe these would be provided via https://github.com/grain-lang/grain/tree/main/compiler/src/language_server so I'm going to move the issue to the main grain repo and rename.

phated avatar Jul 15 '22 16:07 phated

Ooh, I wasn't even aware of this, but it's very coool.

marcusroberts avatar Jul 15 '22 19:07 marcusroberts

This is now in progress.

marcusroberts avatar Mar 17 '23 14:03 marcusroberts

Thanks @marcusroberts This fantastic!!

sanathusk avatar Mar 20 '23 02:03 sanathusk

This is now in progress.

With #1793 the framework to add these was setup and inlay hints were added for module names.

We probably do not want to close this issue just yet given the original ask looks to have been for inlay types, so we may want to rename this.

Another expansion if we dont change the name is the idea of inlay parameter labels. for postional arguments we could inlay labels to create more clarity on what each parameter is.

spotandjake avatar Apr 16 '23 22:04 spotandjake