fix support the + - in hover panel #2974#4116
Open
asukaminato0721 wants to merge 1 commit into
Open
Conversation
This comment has been minimized.
This comment has been minimized.
kinto0
requested changes
Jul 13, 2026
kinto0
left a comment
Contributor
There was a problem hiding this comment.
cool idea. I like it a lot. I think we're OK with the increase in VSCode version (as long as that's the minimum we can do it on) but I left a few comments
This comment has been minimized.
This comment has been minimized.
kinto0
reviewed
Jul 14, 2026
| let mut cloned = type_.clone(); | ||
| move |solver| { | ||
| // Hover verbosity currently has two states: named nested unions or fully expanded. | ||
| let expand_unions = verbosity_level > 0; |
Contributor
There was a problem hiding this comment.
Suggested change
| let expand_unions = verbosity_level > 0; | |
| let unions_expanded = verbosity_level > 0; |
unclear that this is a state. it sounds like a verb, "should we expand unions"
kinto0
reviewed
Jul 14, 2026
| transaction.ad_hoc_solve(handle, "hover_display", { | ||
| let mut cloned = type_.clone(); | ||
| move |solver| { | ||
| // Hover verbosity currently has two states: named nested unions or fully expanded. |
Contributor
There was a problem hiding this comment.
I think this comment belongs in the HoverResult struct so it's more visible. with the suggested rename, I think it is clear
kinto0
requested changes
Jul 14, 2026
kinto0
left a comment
Contributor
There was a problem hiding this comment.
thanks! just a few more nits
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Contributor
|
@kinto0 has imported this pull request. If you are a Meta employee, you can view this in D111971431. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #2974
Added VS Code +/- hover verbosity controls.
Compact hovers preserve named union aliases; expanded hovers reveal their members.
Added the custom client/server hover protocol while preserving standard LSP behavior.
Raised the extension requirement to VS Code 1.103 for hover verbosity support.
why there is an extra
.d.ts:Because hover verbosity is still a proposed VS Code API. The stable @types/vscode package does not declare VerboseHover, HoverContext and the fourth provideHover argument.
In TypeScript, there are multiple expand levels.
Here we simplified it to only compact and expand.
Test Plan
add test