feat: start using inlay_hints for worksheets #713
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a bit of an experiment to see if everything will fully work as expected in worksheet evaluations now that Metals is returning them as
inlayHint
s. There is a refresh bug it seems that should probably be addressed first because currently it's odd behavior where it ends up being stale, but then if you trigger the worksheet hover that shows the correct result even though theinlayHint
itself is wrong. A couple things I'd like to do before merging this:textDocument/inlay_hint
not being correctly published when recieved neovim/neovim#32248 addressed if possibletextDocument/inlayHint
at the end of a line not being removed when the line is deleted neovim/neovim#32283 addressed if possibleVerify that we shouldn't be using resolve here. I created a message about this on Discord since we are always just returning the same stuff that we already have in theSo I got some illustrations with newer Scala versions that do indeed use this correctly.inlayHint
so I'm making an assumption it's safe to just do it this way, but I really want to make sure this evaluation isn't ever different after a resolve.