DocumentSemanticTokensProvider

The document semantic tokens provider interface defines the contract between extensions and semantic tokens.

Online Documentation

Properties

Link copied to clipboard

An optional event to signal that the semantic tokens from this provider have changed.

Link copied to clipboard
abstract var provideDocumentSemanticTokensEdits: (document: TextDocument, previousResultId: String, token: CancellationToken) -> ProviderResult<JsAny>?

Instead of always returning all the tokens in a file, it is possible for a DocumentSemanticTokensProvider to implement this method (provideDocumentSemanticTokensEdits) and then return incremental updates to the previously provided semantic tokens.

Functions

Link copied to clipboard

Tokens in a file are represented as an array of integers. The position of each token is expressed relative to the token before it, because most tokens remain stable relative to each other when edits are made in a file.