Add client-side support for inlay hints in VSCode#407
Merged
ahoppen merged 4 commits intoswiftlang:mainfrom Jun 22, 2021
Merged
Add client-side support for inlay hints in VSCode#407ahoppen merged 4 commits intoswiftlang:mainfrom
ahoppen merged 4 commits intoswiftlang:mainfrom
Conversation
3 tasks
ahoppen
reviewed
Jun 14, 2021
Member
ahoppen
left a comment
There was a problem hiding this comment.
I’ve got two minor inline hints inline.
ahoppen
reviewed
Jun 14, 2021
Implement the `sourcekit-lsp/inlayHints` request on the client side for VSCode. - Add scaffolding for inlay hints in the VSCode extension - Add InlayHintsStyle - Add some notes on the inlay hints client - Implement generation of inlay hint decorations for VSCode - Implement syncCacheAndRenderHints on the VSCode side - Consistently use 4-space-indent in TypeScript sources - Remove unused (and unneeded) hints check - Address suggestions regarding inlay hints in VSCode
ahoppen
reviewed
Jun 20, 2021
Member
ahoppen
left a comment
There was a problem hiding this comment.
I have just managed to try this out and it feels good, especially if I imagine the type hints on the variable and not expression side.
Disabling the Render inlay type annotations in the editor doesn’t seem to do anything for me though and type hints are still being displayed if the setting is disabled.
Also, after trying it out, I think we should default Render inlay type annotations in the editor to false while the feature is under development and maybe also mark it as (experimental) or something like that.
While the feature is under development and experimental.
Member
Author
|
Thanks for the feedback, both of these issues should be fixed now. |
Member
|
@swift-ci Please test |
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.
For easier reviewability, the client-side implementation of inlay hints for VSCode (originally part of #406) is now in this PR. It implements the new (non-standard)
sourcekit-lsp/inlayHintsrequest and generates corresponding text decorations for inlay hints:Inlay hints as text decorations on the client side are also a proposed part of the VSCode API, although this implementation does not use it yet, as it is only available in VSCode Insiders builds. More details can be found here:
Once inlay hints become part of LSP, this client-side implementation can be removed completely as VSCode's internal language client will then send inlay hint requests as appropriate.