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

Extend disposable

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