rust-analyzer.vs
rust-analyzer.vs copied to clipboard
How to turn on inlay hints?

as you can see, the calls to test in main() show light text of the function parameter names in vscode. I don't know how to get this working with visual studio but it's built into rust analyzer. I think C/C++ has this feature too
okay inlay hints are present for both C++ and C#. Need to press Alt+F1. Ref https://stackoverflow.com/questions/71788959/visual-studio-community-2022-inline-hints-shortcut
Yeah, I recall this not working with rust in vstudio but will need to double check
okay investigate this.
- inlay hints are supported by LSP https://github.com/microsoft/vscode/issues/113276
- it is possible for LSP clients packages in VS2022 to invoke the LSP in addition to the usual comms between VS2022 and LSP like rust-analyzer see https://learn.microsoft.com/en-us/visualstudio/extensibility/adding-an-lsp-extension?view=vs-2022#send-custom-messages
- 2 is implemented in r-a.vs in LanguageClient.cs
the fix would be to do the same thing C# does - on Alt+F1, r-a.vs invokes the LSP using step 3, get back the inlay hints and display it using editor adornments.
it is also is a good idea to add this plumbing for further enhancements that VS2022 does not provide out of the box but LSPs do. e.g. unit test run / debug code lenses.
the fix would take a couple of days. i would welcome contribution from the community.
alternatively i can get to when when i have some free time.
any updates on this?
None unfortunately. January is the earliest I'll have free time and it should be implemented then.
How to disable inlay hints?