Issue
I'm using the latest Eclipse IDE (2023-03) with Corrosion, and the Rust Analyzer (1.69.0). But the inlay hints clutter up the code a lot, while these hints provide no new information. I would very much like to turn off inlay hints entirely.
According to the documentation, "some clients such as VSCode and COC plugin in Vim", but for other editors (like Eclipse) "the initial configuration is specified as a value of the initializationOptions
field of the InitializeParams
message, in the LSP protocol."
In Eclipse, the configuration screen (Windows -> Preferences -> Rust) allows for installing and configuring the Rust Analyzer, by means of an empty field called LS Configuration
. Presumably I need to point to a configuration file which holds the JSON-formatted message that is to be sent over the LSP protocol ?
I've created this settings.json
file with the following content:
{
"inlayHints" : {
"chainingHints" : { "enable" : false },
"parameterHints" : { "enable" : false }
}
}
I tried pointing Eclipse to the file, restart Eclipse, adding another level "rust-analyzer"
before "inlayHints"
, but nothing works.
And Rust Analyzer currently seems to be lacking documentation, although some third parties have published instructions for other IDE's.
How can I change the default configuration?
Solution
To disable inlay hints for the Rust Analyzer in Eclipse:
1.) Create some settings.json
file:
{
"inlayHints" : {
"typeHints" : { "enable" : false },
"chainingHints" : { "enable" : false },
"parameterHints" : { "enable" : false },
"closingBraceHints" : { "enable" : false }
}
}
2.) Make sure the file is readable by the same user account that runs Eclipse.
3.) Open Eclipse.
4.) On the menu bar, open Window -> Preferences, go to the tab Rust.
5.) Click on the folder icon of the field "LS Configuration"
6.) Choose the settings.json
file and click "Apply and Close"
7.) Restart Eclipse
Answered By - Code4R7
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.