This commit is contained in:
Ladislau Szomoru 2021-06-08 18:47:11 +02:00
parent a7cd261de0
commit d5cb56faf7
No known key found for this signature in database
GPG key ID: 2B88287CB9DB080B

View file

@ -235,8 +235,8 @@ export class WorkspaceTrustManagementService extends Disposable implements IWork
return true;
}
if (!this._initialized) {
return false;
if (this.environmentService.extensionTestsLocationURI) {
return true; // trust running tests with vscode-test
}
// Remote - remote authority explicitly sets workspace trust
@ -244,16 +244,16 @@ export class WorkspaceTrustManagementService extends Disposable implements IWork
return this._remoteAuthority.options.isTrusted;
}
if (this.environmentService.extensionTestsLocationURI) {
return true; // trust running tests with vscode-test
}
if (this.workspaceService.getWorkbenchState() === WorkbenchState.EMPTY) {
// Use memento if present, otherwise default to restricted mode
// Workspace may transition to trusted based on the opened editors
return this._trustState.isTrusted ?? false;
}
if (!this._initialized) {
return false;
}
return this.getUrisTrust(this.getWorkspaceUris());
}
@ -746,6 +746,7 @@ class WorkspaceTrustState {
}
set isTrusted(value: boolean | undefined) {
console.log('SET: ' + value);
this._mementoObject[this._isTrustedKey] = value;
this._memento.saveMemento();
}