debt - less asWinJsPromise-usage, #56137
This commit is contained in:
parent
37b44d383a
commit
81ab31f5f1
3 changed files with 5 additions and 5 deletions
|
@ -50,7 +50,7 @@ class DecorationRequestsQueue {
|
|||
// make request
|
||||
const requests = this._requests;
|
||||
const resolver = this._resolver;
|
||||
this._proxy.$provideDecorations(values(requests)).then(data => {
|
||||
this._proxy.$provideDecorations(values(requests), CancellationToken.None).then(data => {
|
||||
for (const id in resolver) {
|
||||
resolver[id](data[id]);
|
||||
}
|
||||
|
|
|
@ -971,7 +971,7 @@ export type DecorationData = [number, boolean, string, string, ThemeColor, strin
|
|||
export type DecorationReply = { [id: number]: DecorationData };
|
||||
|
||||
export interface ExtHostDecorationsShape {
|
||||
$provideDecorations(requests: DecorationRequest[]): Thenable<DecorationReply>;
|
||||
$provideDecorations(requests: DecorationRequest[], token: CancellationToken): Thenable<DecorationReply>;
|
||||
}
|
||||
|
||||
export interface ExtHostWindowShape {
|
||||
|
|
|
@ -9,7 +9,7 @@ import { URI } from 'vs/base/common/uri';
|
|||
import { MainContext, IMainContext, ExtHostDecorationsShape, MainThreadDecorationsShape, DecorationData, DecorationRequest, DecorationReply } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { Disposable } from 'vs/workbench/api/node/extHostTypes';
|
||||
import { asWinJsPromise } from 'vs/base/common/async';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
|
||||
interface ProviderData {
|
||||
provider: vscode.DecorationProvider;
|
||||
|
@ -43,7 +43,7 @@ export class ExtHostDecorations implements ExtHostDecorationsShape {
|
|||
});
|
||||
}
|
||||
|
||||
$provideDecorations(requests: DecorationRequest[]): TPromise<DecorationReply> {
|
||||
$provideDecorations(requests: DecorationRequest[], token: CancellationToken): Thenable<DecorationReply> {
|
||||
const result: DecorationReply = Object.create(null);
|
||||
return TPromise.join(requests.map(request => {
|
||||
const { handle, uri, id } = request;
|
||||
|
@ -52,7 +52,7 @@ export class ExtHostDecorations implements ExtHostDecorationsShape {
|
|||
return void 0;
|
||||
}
|
||||
const { provider, extensionId } = this._provider.get(handle);
|
||||
return asWinJsPromise(token => provider.provideDecoration(URI.revive(uri), token)).then(data => {
|
||||
return Promise.resolve(provider.provideDecoration(URI.revive(uri), token)).then(data => {
|
||||
if (data && data.letter && data.letter.length !== 1) {
|
||||
console.warn(`INVALID decoration from extension '${extensionId}'. The 'letter' must be set and be one character, not '${data.letter}'.`);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue