The document color provider defines the contract between extensions and feature of picking and modifying colors in the editor.
Fields
provideDocumentColors(document:TextDocument, token:CancellationToken):ProviderResult<Array<ColorInformation>>
Provide colors for the given document.
@link ColorInformation color information} or a thenable that resolves to such. The lack of a result
can be signaled by returning undefined
, null
, or an empty array.
Parameters:
document | The document in which the command was invoked. |
---|---|
token | A cancellation token. |
Returns:
An array of {
provideColorPresentations(color:Color, context:{range:Range, document:TextDocument}, token:CancellationToken):ProviderResult<Array<ColorPresentation>>
Provide {@link ColorPresentation representations} for a color.
Parameters:
color | The color to show and insert. |
---|---|
context | A context object with additional information |
token | A cancellation token. |
Returns:
An array of color presentations or a thenable that resolves to such. The lack of a result
can be signaled by returning undefined
, null
, or an empty array.