mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 11:49:38 +00:00
Use method instead of event
This commit is contained in:
@@ -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>());
|
||||
|
||||
Reference in New Issue
Block a user