mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
provideColorPresentations should have document in paramaters.
This commit is contained in:
@@ -559,7 +559,7 @@ export interface ExtHostLanguageFeaturesShape {
|
||||
$provideDocumentLinks(handle: number, resource: URI): TPromise<modes.ILink[]>;
|
||||
$resolveDocumentLink(handle: number, link: modes.ILink): TPromise<modes.ILink>;
|
||||
$provideDocumentColors(handle: number, resource: URI): TPromise<IRawColorInfo[]>;
|
||||
$provideColorPresentations(handle: number, colorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]>;
|
||||
$provideColorPresentations(handle: number, resource: URI, colorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]>;
|
||||
}
|
||||
|
||||
export interface ExtHostQuickOpenShape {
|
||||
|
||||
@@ -729,7 +729,7 @@ class ColorProviderAdapter {
|
||||
});
|
||||
}
|
||||
|
||||
provideColorPresentations(rawColorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]> {
|
||||
provideColorPresentations(resource: URI, rawColorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]> {
|
||||
let colorInfo: vscode.ColorInformation = {
|
||||
range: TypeConverters.toRange(rawColorInfo.range),
|
||||
color: {
|
||||
@@ -739,7 +739,8 @@ class ColorProviderAdapter {
|
||||
alpha: rawColorInfo.color[3]
|
||||
}
|
||||
};
|
||||
return asWinJsPromise(token => this._provider.provideColorPresentations(colorInfo, token)).then(value => {
|
||||
const doc = this._documents.getDocumentData(resource).document;
|
||||
return asWinJsPromise(token => this._provider.provideColorPresentations(doc, colorInfo, token)).then(value => {
|
||||
return value.map(v => TypeConverters.ColorPresentation.from(v));
|
||||
});
|
||||
}
|
||||
@@ -1053,8 +1054,8 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
|
||||
return this._withAdapter(handle, ColorProviderAdapter, adapter => adapter.provideColors(resource));
|
||||
}
|
||||
|
||||
$provideColorPresentations(handle: number, colorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]> {
|
||||
return this._withAdapter(handle, ColorProviderAdapter, adapter => adapter.provideColorPresentations(colorInfo));
|
||||
$provideColorPresentations(handle: number, resource: URI, colorInfo: IRawColorInfo): TPromise<modes.IColorPresentation[]> {
|
||||
return this._withAdapter(handle, ColorProviderAdapter, adapter => adapter.provideColorPresentations(resource, colorInfo));
|
||||
}
|
||||
|
||||
// --- configuration
|
||||
|
||||
Reference in New Issue
Block a user