redhat-developer / redhat-developer/lsp4ij
Set the `augmentsSyntaxTokens` client capability if appropriate
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 344
- Forks
- 113
- Avg merge
- 5h 22m
- Merged PRs (30d)
- 15
Description
The augmentsSyntaxTokens property is part of the SemanticTokensClientCapabilities in LSP specification and is documented like this:
Whether the client uses semantic tokens to augment existing syntax tokens. If set to
trueclient side created syntax tokens and semantic tokens are both used for colorization. If set tofalsethe client only uses the returned semantic tokens for colorization.If the value is
undefinedthen the client behavior is not specified.
This field essentially informs the server whether the client (lsp4ij/IntelliJ) already has basic syntax highlighting and uses semantic tokens to extend them. The server could then avoid emitting semantic tokens that carry no semantic meaning (e.g SemanticTokenTypes.keyword, SemanticTokenTypes.number) to let the syntax highlighting take over.
As far as I can tell, lsp4ij/IntelliJ is able to combine syntax highlighting with semantic tokens. Which means that augmentsSyntaxTokens should be set to whether syntax highlighting is available for the language the LSP is running on. I do not know how this is for IntelliJ plugins but it may not be possible to know whether syntax highlighting is available for a given language. In that case it may be viable to just assume that syntax highlighting is already available. This appears to be a common assumption across the three client that I know of which set augmentsSyntaxTokens:
To give some more context around this, I am trying to use this client capability for the ZLS language server in https://github.com/zigtools/zls/pull/2350 and have been asked by @angelozerr to open an issue about this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating where lsp4ij constructs SemanticTokensClientCapabilities and determine whether IntelliJ can report syntax-highlighting availability for the active language. Compare the behavior with the linked VS Code, Sublime Text, and Neovim implementations; done means the client advertises augmentsSyntaxTokens with a documented, tested policy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100