Skip to content
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

InlayHints should be removed from the editor when their text edits are applied #147663

Closed
JoeRobich opened this issue Apr 19, 2022 · 10 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug inlay-hints insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@JoeRobich
Copy link
Member

JoeRobich commented Apr 19, 2022

While implementing TextEdit support for C# hints I noticed that the hint remains in the editor until new hints can be requested for the updated document. Since the point of the TextEdits is to remove the need for the inlay hint, it should be removed at the same time TextEdits are applied.

Behavior of both 1.66.0 and 1.67.0-insiders:

Screen.Recording.2022-04-18.at.5.18.46.PM.mov
@jrieken
Copy link
Member

jrieken commented Apr 19, 2022

The recording seems broken, please upload again, preferably directly into a comment.

Since the point of the TextEdits is to remove the need for the inlay hint, it should be removed at the same time TextEdits are applied.

Do you meaning typing in the sense of user gesture or automated text edits, like refactorings et al?

@JoeRobich
Copy link
Member Author

The recording seems broken, please upload again, preferably directly into a comment.

Sorry, it embedded correctly in the linked PR. I have uploaded it again into this issue.

Do you meaning typing in the sense of user gesture or automated text edits, like refactorings et al?

I am referring to the inlay hint double click behavior which applies a set of TextEdits to the document.

According to the documentation

	 * *Note* that edits are expected to change the document so that the inlay
	 * hint (or its nearest variant) is now part of the document and the inlay
	 * hint itself is now obsolete.

@jrieken jrieken added this to the April 2022 milestone Apr 19, 2022
@jrieken jrieken removed the info-needed Issue requires more information from poster label Apr 19, 2022
@jrieken
Copy link
Member

jrieken commented Apr 19, 2022

Understood. Thanks for clarifying.

@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug author-verification-requested Issues potentially verifiable by issue author labels Apr 19, 2022
@jrieken
Copy link
Member

jrieken commented Apr 19, 2022

I have pushed a change to immediately request inlay hints after applying inlay hints edits. That's not synchronously removing but still makes an async request. Usually they are fast but it depends on the extension and state of the extension host. Will be in next/tomorrows insiders, please give it a try and let me know if it works for you

@JoeRobich
Copy link
Member Author

@jrieken Performance with latest insiders build:

Screen.Recording.2022-04-20.at.2.28.20.PM.mov

I think it is fair to say that the O# language server could be faster at producing updated inlayHints, but I am not sure it would ever be fast enough that the users wouldn't see flashes where text is split with an inlay in the middle.
image

@jrieken
Copy link
Member

jrieken commented Apr 21, 2022

I think it is fair to say that the O# language server could be faster at producing updated inlayHints,

@JoeRobich I believe my changes weren't in insiders yet. We had trouble producing a build yesterday, version bd95a8d or more recent should have this fix and things should be much better there

@JoeRobich
Copy link
Member Author

I believe my changes weren't in insiders yet.

Thanks, I now see the issue tags tell a whole story.

Here I thought O# wouldn't be up to the task, but the experience should be fine for our users.

Screen.Recording.2022-04-21.at.8.42.47.AM.mov

@JoeRobich
Copy link
Member Author

/verified

@jrieken
Copy link
Member

jrieken commented Apr 21, 2022

Thanks for verifying

@github-actions github-actions bot locked and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug inlay-hints insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants
@JoeRobich @jrieken and others