-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Test: Hover Verbosity Proposed API #210904
Labels
Milestone
Comments
Removing my assignment in the list since it's breaking our tooling but I still plan on testing it along with the 2 other auto assigned testers |
This was referenced Apr 23, 2024
This was referenced Apr 23, 2024
This was referenced Apr 23, 2024
👏 @aiday-mar and @hediet This works really well! |
Thanks! |
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Refs: #195394
Complexity: 4
Create Issue
This iteration we have made it possible to show additional information in the hover on a user request. The feature request stems from the TS team which would like to show expanded type information. In the following example, when we currently hover on
foo
we see the following informationconst foo: FooType
. The TS team would like to showstring | number
on hover expansion instead.To this effect, we have developed a new Proposed API which allows extensions to provide expanded hover results. More specifically we have created a new type called the
VerboseHover
which extends from the standardHover
and contains two fieldscanIncreaseVerbosity
andcanDecreaseVerbosity
which specify if the verbosity of the current hover can be increased/decreased.This information is used to render +/- icons in the hover if it is expandable/retractable. We have also introduced a new signature for the method
provideHover
which contains an additional parameterHoverContext
.This parameter has two fields
action
andpreviousHover
which signal that the user would like to increase or decrease the verbosity of thepreviousHover
. It is to be used by extension authors to provide expanded/contracted hovers.Testing:
To test please do the following:
vscode.proposed.editorHoverVerbosityLevel.d.ts
which contains the proposed API. Make sure the API makes sense. Let me know if there is anything unclear in the description or the API structure.enabledApiProposals
place the stringeditorHoverVerbosityLevel
. Pull the proposed API withnpx @vscode/dts dev
.//logic
placeholder above with code which checks thecontext
parameter to determine the level of the hover to return. Here is an example of some code. The following logic registers a hover provider which returns an expandable verbose hover on the first 100 lines of the editor. The hover can be expanded up to three levels. Make sure to create a verbose hover which can expand to at least 2 levels for the following testing points.cmd+k cmd+p
/cmd+k cmd+m
(on macos) orctrl+k ctrl+p
/ctrl+k ctrl+m
(on windows) respectively increase and decrease the hover verbosity level.Thank you for testing!
The text was updated successfully, but these errors were encountered: