-
Couldn't load subscription status.
- Fork 68
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 zigtools/zls#2350 and have been asked by @angelozerr to open an issue about this.