This commit is contained in:
parent
a7cd261de0
commit
d5cb56faf7
1 changed files with 7 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue