Skip to content

LanguageServerSemanticTokensOptions

LanguageServerSemanticTokensOptions = Omit<SemanticTokenLayerOptions, "name"> & object

readonly optional name?: string

Namespaced within the view. Defaults to semantic.

optional onLayer(layer, document): void | EditorDisposable

Receives the layer the view contribution created.

A host cannot construct one itself: a layer needs a viewport, a snapshot and a lifecycle, and all three belong to the contribution. Returning a disposable ties the host’s own request-side controller to the layer, in the shape onConnectionCreated already uses.

A layer never spans two documents or two language ids. A change to either disposes the one the host is holding and delivers a new one through a second call carrying the new identity — so clear() across a document change is a call on a dead handle, not a reset.

SemanticTokenLayer

LanguageServerSemanticTokensDocument

void | EditorDisposable