-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Feature request: option to disable inlay hints on lines with an active cursor #5903
Comments
I think this feature might be less beneficial as it might seem at first glance. |
cc @matklad |
Not really, we always query all inlay hint, but just don't show some of them in the editor. This is purely presentation concern. I am not sure that "disabling hints on an active line" is the best presentation possible. Some alternatives:
All three ideas seem non-trivial to implement though, the state management required seems tricky. But I might be wrong about this :) |
There is no delay in updating the inlay hints, as I said we poll for new inlay hints only when the user types a character or opens a new file.
My point was not in the amount of inlay hints we query, but the frequency. If we start tracking the cursor, we will need to reevaluate the inlay hints when the user just moves the cursor (currently when the user just moves the cursor the hints are not refetched). |
There's no need to refetch the hints in either case. The only difference is in how the client presents the hints to the user, the client-server interaction is exactly the same in both cases. Client stores a full hints model (which depends only on the contents of the file), and then renders the model, completely client-side, into a view (which depends on the model, the current position of cursors, and the set of timers (if we want to have "draw hints on the current line after a second" behavior)). Only model -> view needs to be recalculated on cursor movements, and, as it is purely client-side, it is cheap. |
Looks nice! I've imagined this feature removing all hints entirely, the original issue comment seems to mean the same. |
@saiintbrisson , those gifs above give an impression of a pretty much ready feature, so if you're able to create the PR out of that, please do it's very welcome. |
This preview is still a bit buggy, I'll open a PR when I get it fixed. Thank you! |
Any update? |
What do the client logs say? Those log the settings it recognizes and sends to the server. Disabling works fine for me, so something might be overwriting your setting or not causing ti to get to the server. |
Not related to the recent comments, but the issue itself can be closed now IMO: we don't control VSCode hint appearance or behaviour now. |
Sometimes the inlay hints seem to cause refactoring/change troubles, a particularly common case is when adding or removing a type specifier on a let. I suspect this is in part due to my use of the vim plugin at the same time.
I realized today that a great way around this that would work well for me, would be an option to disable inlay hints on the active cursor line.
The text was updated successfully, but these errors were encountered: