Use method instead of event
This commit is contained in:
parent
c30e2d46b2
commit
f18a340066
|
@ -39,7 +39,14 @@ export class TypeScriptVersionManager extends Disposable {
|
|||
}
|
||||
} else {
|
||||
setImmediate(() => {
|
||||
vscode.workspace.requireWorkspaceTrust(false);
|
||||
vscode.workspace.requireWorkspaceTrust(false)
|
||||
.then(trustState => {
|
||||
if (trustState === vscode.WorkspaceTrustState.Trusted && this.versionProvider.localVersion) {
|
||||
this.updateActiveVersion(this.versionProvider.localVersion);
|
||||
} else {
|
||||
this.updateActiveVersion(this.versionProvider.defaultVersion);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -50,16 +57,6 @@ export class TypeScriptVersionManager extends Disposable {
|
|||
});
|
||||
}
|
||||
|
||||
this._register(vscode.workspace.onDidChangeWorkspaceTrustState((event: vscode.WorkspaceTrustStateChangeEvent) => {
|
||||
if (this.useWorkspaceTsdkSetting) {
|
||||
if (event.currentTrustState === vscode.WorkspaceTrustState.Trusted && this.versionProvider.localVersion) {
|
||||
this.updateActiveVersion(this.versionProvider.localVersion);
|
||||
} else {
|
||||
this.updateActiveVersion(this.versionProvider.defaultVersion);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
private readonly _onDidPickNewVersion = this._register(new vscode.EventEmitter<void>());
|
||||
|
|
Loading…
Reference in a new issue