New command: Type of dynamic selection #1675
Open
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 PR adds three new commands that can be used to get the type of a selection, and the ones of growing enclosings of this selection. At each step it is possible to ask for more verbose results.
The following videos show how the types of the growing selection are shown in a hover popup, with the selection growing, then shrinking, and lastly with an increased verbosity:
Screen.Recording.2024-12-04.at.11.28.03.mp4
The type history is also logged to an output channel which can be configured to show up automatically and clear itself to show only the last result.
I have been through a lot of back and forth to get to this result, because it is not possible (to the extent of my knowledge) to easily disable the standard hover provider from the client side due to how the official LSP client from Microsoft behaves. I tried multiple alternatives but I know think having a configuration option to mute the output of the standard hover from the server to be the most robust one.
Todo
cc @awilliambauer