mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Color Decorator sits together with Color Picker.
This commit is contained in:
@@ -734,8 +734,7 @@ class ColorProviderAdapter {
|
||||
return {
|
||||
color: [ci.color.red, ci.color.green, ci.color.blue, ci.color.alpha] as [number, number, number, number],
|
||||
availableFormats: availableFormats,
|
||||
range: TypeConverters.fromRange(ci.range),
|
||||
renderDecorator: ci.renderDecorator
|
||||
range: TypeConverters.fromRange(ci.range)
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1040,9 +1039,16 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
|
||||
|
||||
registerColorProvider(selector: vscode.DocumentSelector, provider: vscode.DocumentColorProvider): vscode.Disposable {
|
||||
const handle = this._nextHandle();
|
||||
const eventHandle = typeof provider.onDidChangeColors === 'function' ? this._nextHandle() : undefined;
|
||||
this._adapter.set(handle, new ColorProviderAdapter(this._proxy, this._documents, this._colorFormatCache, provider));
|
||||
this._proxy.$registerDocumentColorProvider(handle, selector);
|
||||
return this._createDisposable(handle);
|
||||
this._proxy.$registerDocumentColorProvider(handle, selector, eventHandle);
|
||||
let result = this._createDisposable(handle);
|
||||
|
||||
if (eventHandle !== undefined) {
|
||||
const subscription = provider.onDidChangeColors(_ => this._proxy.$emitColorsEvent(eventHandle));
|
||||
result = Disposable.from(result, subscription);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
$provideDocumentColors(handle: number, resource: URI): TPromise<IRawColorInfo[]> {
|
||||
|
||||
Reference in New Issue
Block a user