-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable deduced types or make it on-hover only #3267
Comments
I think you're looking for the |
I'd also like to expand a bit on our philosophy for default settings: in general, we prefer to enable all bells and whistles by default, because that helps with discoverability. If a particular feature annoys you, it usually is straigforward to look at the docs for the way to disable it (if it is actually documented, oups :) ) OTOH, if you would love to use a feature, but do not know that it exists in the first place, you probably won't even try to find it in the docs. I am contemplating (long-term) about having two presents for settings:
|
@matklad Thank you for a response. The problem is while some “inlay” (maybe inline is more intuitive?) features are good such as parameter name hints, current implementation of type hints after “let x” statement provides very strange behavior when cursor jumps to the end of the type hint instead of the end of the variable name that makes a lot of distraction and visually misguiding. |
Yes, unfortunately, this is the best solution we have currently for the type hints, the reasoning behind it is described in the documentation now (see the PR that closed this issue). We have another issue for toggling the different categories of hints separately, hope this will help you when gets implemented. |
This issue should at least link to the documentation that describes how to disable these annoying type hints. It seems you can do it by going to the VS Code |
In my case, I also unchecked |
I also turned off |
Turning off But I'd like to call attention to the second part of the original issue: "or make it on-hover only". I'd hate to actually lose these hints, which are really valuable when you want them. Is there a way to display them without the associated cursor movement and text x-direction movement issues? I think the existing hover text might actually be sufficient - hovering over the function shows the function parameter names, and hovering over a variable shows its type. So I think nothing is lost, but I'm new here so I hope I haven't undone the great benefits of this plugin. |
@hraftery As far as I know this plugin is fully supported, here is my configuration: // ...
"rust-analyzer.inlayHints.typeHints.enable": false, // 关闭类型提示
"rust-analyzer.inlayHints.parameterHints.enable": false, // 关闭参数提示
//.. |
I wish toggling these inlay hints on/off was available in the command palette. They're useful every now and then, but often feel like clutter so I keep toggling them in the settings |
Perhaps related: the "7 Implementations" is from "Code Lens", and the VS Code Setting JSON key is While valuable, it's provided in the popup window on hover, so it's not necessary to have it floating between your lines of code at all times |
May be it’s a question of getting used to something, but by-default displayed type annotations after “let var” statements are verbose and make it difficult to edit the variable name (cursor jumps to the end on the type hint if it’s past the last symbol). There is no place in the documentation how to disable it, and extension settings do not give any hint.
The text was updated successfully, but these errors were encountered: