mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
setParentFolderTrust should use canSetParentFolderTrust
This commit is contained in:
parent
f50840e91b
commit
41c2f164b3
|
@ -16,7 +16,7 @@ import { getRemoteAuthority, isVirtualResource } from 'vs/platform/remote/common
|
|||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
import { IWorkspace, IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { WorkspaceTrustRequestOptions, IWorkspaceTrustManagementService, IWorkspaceTrustInfo, IWorkspaceTrustUriInfo, IWorkspaceTrustRequestService, IWorkspaceTrustTransitionParticipant, WorkspaceTrustUriResponse, IWorkspaceTrustEnablementService } from 'vs/platform/workspace/common/workspaceTrust';
|
||||
import { isSingleFolderWorkspaceIdentifier, isUntitledWorkspace, toWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isUntitledWorkspace, toWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { Memento, MementoObject } from 'vs/workbench/common/memento';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
|
||||
|
@ -483,9 +483,8 @@ export class WorkspaceTrustManagementService extends Disposable implements IWork
|
|||
}
|
||||
|
||||
async setParentFolderTrust(trusted: boolean): Promise<void> {
|
||||
const workspaceIdentifier = toWorkspaceIdentifier(this._canonicalWorkspace);
|
||||
if (isSingleFolderWorkspaceIdentifier(workspaceIdentifier) && workspaceIdentifier.uri.scheme === Schemas.file) {
|
||||
const { parentPath } = splitName(workspaceIdentifier.uri.fsPath);
|
||||
if (this.canSetParentFolderTrust()) {
|
||||
const { parentPath } = splitName((toWorkspaceIdentifier(this._canonicalWorkspace) as ISingleFolderWorkspaceIdentifier).uri.fsPath);
|
||||
|
||||
await this.setUrisTrust([URI.file(parentPath)], trusted);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue