diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts index 37887a5318f..203bcb896f9 100644 --- a/src/vs/base/common/event.ts +++ b/src/vs/base/common/event.ts @@ -8,7 +8,6 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { once as onceFn } from 'vs/base/common/functional'; import { combinedDisposable, Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { LinkedList } from 'vs/base/common/linkedList'; -import { TPromise } from 'vs/base/common/winjs.base'; /** * To an event a function with one or zero parameters @@ -277,7 +276,7 @@ export function fromCallback(fn: (handler: (e: T) => void) => IDisposable): E return emitter.event; } -export function fromPromise(promise: TPromise): Event { +export function fromPromise(promise: Thenable): Event { const emitter = new Emitter(); let shouldEmit = false; @@ -295,8 +294,8 @@ export function fromPromise(promise: TPromise): Event { return emitter.event; } -export function toPromise(event: Event): TPromise { - return new TPromise(complete => { +export function toPromise(event: Event): Promise { + return new Promise(complete => { const sub = event(e => { sub.dispose(); complete(e); diff --git a/src/vs/base/parts/ipc/common/ipc.ts b/src/vs/base/parts/ipc/common/ipc.ts index 8543a0ba8bf..925e26aab62 100644 --- a/src/vs/base/parts/ipc/common/ipc.ts +++ b/src/vs/base/parts/ipc/common/ipc.ts @@ -375,7 +375,7 @@ export class ChannelClient implements IChannelClient, IDisposable { if (this.state === State.Idle) { return TPromise.as(null); } else { - return toPromise(this.onDidInitialize); + return TPromise.wrap(toPromise(this.onDidInitialize)); } }