The inlay hints provider interface defines the contract between extensions and the inlay hints feature.

Fields

resolveInlayHint(hint:T, token:CancellationToken):ProviderResult<T>

Given an inlay hint fill in {@link InlayHint.tooltip tooltip}, {@link InlayHint.textEdits text edits}, or complete label {@link InlayHintLabelPart parts}.

Note that the editor will resolve an inlay hint at most once.

Parameters:

hint

An inlay hint.

token

A cancellation token.

Returns:

The resolved inlay hint or a thenable that resolves to such. It is OK to return the given item. When no result is returned, the given item will be used.

provideInlayHints(document:TextDocument, range:Range, token:CancellationToken):ProviderResult<Array<T>>

Provide inlay hints for the given range and document.

Note that inlay hints that are not {@link Range.contains contained} by the given range are ignored.

Parameters:

document

The document in which the command was invoked.

range

The range for which inlay hints should be computed.

token

A cancellation token.

Returns:

An array of inlay hints or a thenable that resolves to such.

@:optionaloptionalonDidChangeInlayHints:Null<Event<Void>>

An optional event to signal that inlay hints from this provider have changed.