semanticTokensClientCapability
semanticTokensClientCapability(
options):ClientCapabilities
Builds a textDocument.semanticTokens block that declares exactly what this editor honours.
There is no such block in defaultClientCapabilities() and there will not be: a client that
declares semantic tokens makes every server it speaks to compute them, and a host that paints no
tokens would be paying for answers nobody draws. So the block is opt-in, and it is built here
rather than hand-written by each host because three of its flags are ones a client must not claim
unless it can actually honour them — and a server acts on all three.
overlappingTokenSupport is not an option. Where two spans overlap this editor truncates the
earlier one; it does not paint both. Declaring the flag would invite a server to send overlapping
tokens on the understanding that they would be layered, and they would not be.
dynamicRegistration is not an option. Several servers answer initialize with no
semantic-tokens provider at all when a client declares it, expecting to register later through
client/registerCapability — a request LspClient answers with method-not-found and always
will. Declaring it would turn a working server into a silent one.
multilineTokenSupport is declarable but not assumed. It was refused until the paint layer
was proved to render a span crossing a newline across two mounted rows; that gate is now open, so
the flag is an ordinary option. It is still opt-in, because it is a statement about the host’s
pipeline as well as the editor’s.
Everything the block does say — which requests, which token types, which modifiers — is the caller’s to choose, because at least one real server computes its advertised legend as the intersection of its own token types with the ones the client declared. That makes the declared block an input to the server rather than a local decoding table, and therefore a property of a connection, which is host-owned.
Parameters
Section titled “Parameters”options
Section titled “options”SemanticTokensClientCapabilityOptions