Remove extra dispose implementations
This commit is contained in:
parent
4521e5d1a6
commit
c5b91342d6
1 changed files with 10 additions and 17 deletions
|
@ -45,18 +45,14 @@ export class VersionDependentRegistration extends Disposable {
|
||||||
register: () => vscode.Disposable,
|
register: () => vscode.Disposable,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this._registration = new ConditionalRegistration(register);
|
|
||||||
|
this._registration = this._register(new ConditionalRegistration(register));
|
||||||
|
|
||||||
|
this._register(this.client.onTsServerStarted(() => {
|
||||||
|
this.update(this.client.apiVersion);
|
||||||
|
}));
|
||||||
|
|
||||||
this.update(client.apiVersion);
|
this.update(client.apiVersion);
|
||||||
|
|
||||||
this.client.onTsServerStarted(() => {
|
|
||||||
this.update(this.client.apiVersion);
|
|
||||||
}, null, this._disposables);
|
|
||||||
}
|
|
||||||
|
|
||||||
public dispose() {
|
|
||||||
super.dispose();
|
|
||||||
this._registration.dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private update(api: API) {
|
private update(api: API) {
|
||||||
|
@ -74,14 +70,11 @@ export class ConfigurationDependentRegistration extends Disposable {
|
||||||
register: () => vscode.Disposable,
|
register: () => vscode.Disposable,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this._registration = new ConditionalRegistration(register);
|
this._registration = this._register(new ConditionalRegistration(register));
|
||||||
this.update();
|
|
||||||
vscode.workspace.onDidChangeConfiguration(this.update, this, this._disposables);
|
|
||||||
}
|
|
||||||
|
|
||||||
public dispose() {
|
this._register(vscode.workspace.onDidChangeConfiguration(this.update, this));
|
||||||
super.dispose();
|
|
||||||
this._registration.dispose();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
private update() {
|
private update() {
|
||||||
|
|
Loading…
Reference in a new issue