A code lens provider adds {@link Command commands} to source text. The commands will be shown as dedicated horizontal lines in between the source text.
Fields
optionalresolveCodeLens:Null<(codeLens:T, token:CancellationToken) ‑> ProviderResult<T>>
This function will be called for each visible code lens, usually when scrolling and after calls to {@link CodeLensProvider.provideCodeLenses compute}-lenses.
Parameters:
codeLens | Code lens that must be resolved. |
---|---|
token | A cancellation token. |
Returns:
The given, resolved code lens or thenable that resolves to such.
provideCodeLenses(document:TextDocument, token:CancellationToken):ProviderResult<Array<T>>
Compute a list of {@link CodeLens lenses}. This call should return as fast as possible and if computing the commands is expensive implementors should only return code lens objects with the range set and implement {@link CodeLensProvider.resolveCodeLens resolve}.
Parameters:
document | The document in which the command was invoked. |
---|---|
token | A cancellation token. |
Returns:
An array of code lenses or a thenable that resolves to such. The lack of a result can be
signaled by returning undefined
, null
, or an empty array.
optionalonDidChangeCodeLenses:Null<Event<Void>>
An optional event to signal that the code lenses from this provider have changed.