-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Inlay hints schedule improve #125995
Comments
(Experimental duplicate detection) |
/gifPlease |
I think inlay hints should disappear immediately if the surrounding text is deleted. |
Yes, I agree that hints should disappear immediately when their "anchor" position is removed. Maybe it's not so easy to know what remove actually means in this case. Arguably this is an editor bug as I was expecting this to work? |
I wouldn't call this a bug - decorations are never removed automatically. Alex suggests (I asked him before his vacation):
I also suggest to extend the inlay hints API so that a hint refers to a range. The hint itself then can either be after or before the range. With injected text, we now have two cursor stops around inlay hints - both refer to the same model position. Maybe the move behavior of inlay text should depend on the view position where the text change was caused from? I suggest to think about how we can better predict synchronously how a text change affects inlay hints. |
This is how we started, mostly to optionally support overlay hints, and everyone was confused about ranges for inlay hints. Using a range with before/after screams "position" and I don't want to leak an implementation detail into the API. We would also still have the case of empty ranges... I'd rather create "fake ranges" from positions so that I can use the notion of collapsed ranges. |
I have pushed a change (00d20b9) to use the range of touching words of inlay positions (when possible). In that case |
I think so, decorations are not removed automatically. |
But what does |
Ah, maybe I forgot to consider that flag for injected text, I'll look into it tomorrow. |
Currently, the inlay hints will clean and shows again as scheduler's strategy.
It's might not friendly if you are editing some line who has many hints.
I have an idea:
Clean all hints where the cursor’s line when we are editing the code and append new hints by the scheduler.
I think It's might improve the experience about inlay hints.
The text was updated successfully, but these errors were encountered: