提交 951f891b 编写于 作者: M Matt Bierner

Extend disposable

上级 73fbb9da
...@@ -57,20 +57,19 @@ export default class TypingsStatus extends Disposable { ...@@ -57,20 +57,19 @@ export default class TypingsStatus extends Disposable {
} }
} }
export class AtaProgressReporter { export class AtaProgressReporter extends Disposable {
private _promises = new Map<number, Function>(); private readonly _promises = new Map<number, Function>();
private _disposable: vscode.Disposable;
constructor(client: ITypeScriptServiceClient) { constructor(client: ITypeScriptServiceClient) {
this._disposable = vscode.Disposable.from( super();
client.onDidBeginInstallTypings(e => this._onBegin(e.eventId)), this._register(client.onDidBeginInstallTypings(e => this._onBegin(e.eventId)));
client.onDidEndInstallTypings(e => this._onEndOrTimeout(e.eventId)), this._register(client.onDidEndInstallTypings(e => this._onEndOrTimeout(e.eventId)));
client.onTypesInstallerInitializationFailed(_ => this.onTypesInstallerInitializationFailed())); this._register(client.onTypesInstallerInitializationFailed(_ => this.onTypesInstallerInitializationFailed()));
} }
dispose(): void { dispose(): void {
this._disposable.dispose(); super.dispose();
this._promises.forEach(value => value()); this._promises.forEach(value => value());
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册