Skip to content
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

[5.7] Migrate to upstream inlay hints #570

Merged
merged 1 commit into from
Jun 22, 2022

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Jun 14, 2022

  • Explanation: Inlay hints have been upstreamed to the Language Server Protocol and this PR migrates SourceKit-LSP's custom request to the standard LSP request. Besides being more widely supported, standard inlay hints have the advantage of being very customizable, e.g. VSCode can be configured to only show the hints while a certain keybinding is held.
  • Scope: Only affects clients that send inlay hint requests, in particular SourceKit-LSP's non-standard requests.
  • Risk: Clients using the previous non-standard inlay hints will no longer be able to show these, the standard LSP hints should be preferable in any case though and are being supported by recent versions of vscode-languageclient already.
  • Testing: Experimentation with recent versions of VSCode and vscode-swift (see Migrate to upstream LSP inlay hints on the client side vscode-swift#198)
  • Issue: rdar://95141875
  • Reviewer: @ahoppen on Migrate to upstream LSP inlay hints request #465

- Use official textDocument/inlayHint request
- Rename InlayHintCategory to InlayHintKind
- Additionally, represent it using an Int, as in the proposed LSP API.
- Add inlay hint client capabilities
- Add inlay hint server capabilities
- Add dynamic registration of inlay hint request
- Rename InlayHintsRequest -> InlayHintRequest
  This is to be consistent with the request itself being named in singular
  in LSP and the other requests (e.g. DocumentSymbolRequest).
- Forward inlay hint requests to clangd
- Add colon before inlay hints
- Add other properties to InlayHint
- Add InlayHintLabel structures
- Conform InlayHintLabel to ExpressibleByStringX protocols
- Attach TextEdit to inlay hints for committing them
- Add InlayHint.data
- Fix InlayHintTests
  We need to include text edits in the expected inlay hints.
@ahoppen
Copy link
Member

ahoppen commented Jun 14, 2022

@swift-ci Please test

@ahoppen ahoppen merged commit 4e05e56 into swiftlang:release/5.7 Jun 22, 2022
@fwcd fwcd deleted the 5.7-upstream-inlay-hints branch June 27, 2022 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants