diff --git a/extensions/typescript-language-features/src/tsServer/versionManager.ts b/extensions/typescript-language-features/src/tsServer/versionManager.ts index cdd85fb02d6..0115ced57c1 100644 --- a/extensions/typescript-language-features/src/tsServer/versionManager.ts +++ b/extensions/typescript-language-features/src/tsServer/versionManager.ts @@ -39,7 +39,7 @@ export class TypeScriptVersionManager extends Disposable { } } else { setImmediate(() => { - vscode.workspace.requireWorkspaceTrust({ modal: false }) + vscode.workspace.requestWorkspaceTrust({ modal: false }) .then(trustState => { if (trustState === vscode.WorkspaceTrustState.Trusted && this.versionProvider.localVersion) { this.updateActiveVersion(this.versionProvider.localVersion); @@ -120,7 +120,7 @@ export class TypeScriptVersionManager extends Disposable { description: version.displayName, detail: version.pathLabel, run: async () => { - const trustState = await vscode.workspace.requireWorkspaceTrust(); + const trustState = await vscode.workspace.requestWorkspaceTrust(); if (trustState === vscode.WorkspaceTrustState.Trusted) { await this.workspaceState.update(useWorkspaceTsdkStorageKey, true); const tsConfig = vscode.workspace.getConfiguration('typescript'); diff --git a/src/vs/platform/workspace/common/workspaceTrust.ts b/src/vs/platform/workspace/common/workspaceTrust.ts index c840873f5dd..93fc57c4774 100644 --- a/src/vs/platform/workspace/common/workspaceTrust.ts +++ b/src/vs/platform/workspace/common/workspaceTrust.ts @@ -84,7 +84,7 @@ export interface IWorkspaceTrustService { onDidChangeTrustState: WorkspaceTrustChangeEvent; getWorkspaceTrustState(): WorkspaceTrustState; isWorkspaceTrustEnabled(): boolean; - requireWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise; + requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise; } export interface IWorkspaceTrustUriInfo { diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 7b783774c5b..236e9ee80c6 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -2836,7 +2836,7 @@ declare module 'vscode' { * @param options Optional object describing the properties of the * workspace trust request */ - export function requireWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Thenable; + export function requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Thenable; /** * Event that fires when the trust state of the current workspace changes diff --git a/src/vs/workbench/api/browser/mainThreadWorkspace.ts b/src/vs/workbench/api/browser/mainThreadWorkspace.ts index fd65baf6741..92e6a87eae4 100644 --- a/src/vs/workbench/api/browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/browser/mainThreadWorkspace.ts @@ -208,8 +208,8 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { // --- trust --- - $requireWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise { - return this._workspaceTrustService.requireWorkspaceTrust(options); + $requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise { + return this._workspaceTrustService.requestWorkspaceTrust(options); } private getWorkspaceTrustState(): WorkspaceTrustState { diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index dd52a8254fe..25a7e4fdb2d 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -912,9 +912,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I checkProposedApiEnabled(extension); return extHostWorkspace.trustState; }, - requireWorkspaceTrust: (options?: vscode.WorkspaceTrustRequestOptions) => { + requestWorkspaceTrust: (options?: vscode.WorkspaceTrustRequestOptions) => { checkProposedApiEnabled(extension); - return extHostWorkspace.requireWorkspaceTrust(options); + return extHostWorkspace.requestWorkspaceTrust(options); }, onDidChangeWorkspaceTrustState: (listener, thisArgs?, disposables?) => { return extHostWorkspace.onDidChangeWorkspaceTrustState(listener, thisArgs, disposables); diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 541891d7cdd..6f54b6892a9 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -927,7 +927,7 @@ export interface MainThreadWorkspaceShape extends IDisposable { $saveAll(includeUntitled?: boolean): Promise; $updateWorkspaceFolders(extensionName: string, index: number, deleteCount: number, workspaceFoldersToAdd: { uri: UriComponents, name?: string; }[]): Promise; $resolveProxy(url: string): Promise; - $requireWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise; + $requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise; } export interface IFileChangeDto { diff --git a/src/vs/workbench/api/common/extHostWorkspace.ts b/src/vs/workbench/api/common/extHostWorkspace.ts index 07e1a00e390..f000bfba761 100644 --- a/src/vs/workbench/api/common/extHostWorkspace.ts +++ b/src/vs/workbench/api/common/extHostWorkspace.ts @@ -563,8 +563,8 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac return this._workspaceTrustState; } - requireWorkspaceTrust(options?: vscode.WorkspaceTrustRequestOptions): Promise { - return this._proxy.$requireWorkspaceTrust(options); + requestWorkspaceTrust(options?: vscode.WorkspaceTrustRequestOptions): Promise { + return this._proxy.$requestWorkspaceTrust(options); } $onDidChangeWorkspaceTrustState(state: WorkspaceTrustStateChangeEvent): void { diff --git a/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts b/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts index 74ce4b72106..4e2b12579c9 100644 --- a/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts +++ b/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts @@ -116,7 +116,7 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut public static async promptForPermission(taskService: ITaskService, storageService: IStorageService, notificationService: INotificationService, workspaceTrustService: IWorkspaceTrustService, openerService: IOpenerService, workspaceTaskResult: Map) { - const isWorkspaceTrusted = await workspaceTrustService.requireWorkspaceTrust({ modal: false }) === WorkspaceTrustState.Trusted; + const isWorkspaceTrusted = await workspaceTrustService.requestWorkspaceTrust({ modal: false }) === WorkspaceTrustState.Trusted; if (!isWorkspaceTrusted) { return; } diff --git a/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts b/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts index 4ac057e34da..90c0b952fa8 100644 --- a/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts +++ b/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts @@ -70,7 +70,7 @@ export class ExtensionEnablementService extends Disposable implements IWorkbench // TODO: Confirm that this is the right lifecycle phase this.lifecycleService.when(LifecyclePhase.Eventually).then(() => { if (this.extensionsDisabledByTrustRequirement.length > 0) { - this.workspaceTrustService.requireWorkspaceTrust({ modal: false }); + this.workspaceTrustService.requestWorkspaceTrust({ modal: false }); } }); @@ -169,7 +169,7 @@ export class ExtensionEnablementService extends Disposable implements IWorkbench const result = await Promises.settled(extensions.map(e => { if (this._isDisabledByTrustRequirement(e)) { - return this.workspaceTrustService.requireWorkspaceTrust() + return this.workspaceTrustService.requestWorkspaceTrust() .then(trustState => { if (trustState === WorkspaceTrustState.Trusted) { return this._setEnablement(e, newState); @@ -442,7 +442,7 @@ export class ExtensionEnablementService extends Disposable implements IWorkbench private _onDidInstallExtension({ local, error }: DidInstallExtensionEvent): void { if (local && !error && this._isDisabledByTrustRequirement(local)) { - this.workspaceTrustService.requireWorkspaceTrust({ modal: false }); + this.workspaceTrustService.requestWorkspaceTrust({ modal: false }); this._onEnablementChanged.fire([local]); } } diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts index 5577f0072a1..71692bbc298 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts @@ -363,7 +363,7 @@ export class ExtensionManagementService extends Disposable implements IWorkbench protected async checkForWorkspaceTrust(manifest: IExtensionManifest): Promise { if (getExtensionWorkspaceTrustRequirement(manifest) === 'onStart') { try { - await this.workspaceTrustService.requireWorkspaceTrust({ + await this.workspaceTrustService.requestWorkspaceTrust({ modal: true, message: localize('extensionInstallWorkspaceTrustMessage', "Enabling this extension requires a trusted workspace."), buttons: [ diff --git a/src/vs/workbench/services/workspaces/common/workspaceTrust.ts b/src/vs/workbench/services/workspaces/common/workspaceTrust.ts index 8cee0b8399b..fd840dcacd7 100644 --- a/src/vs/workbench/services/workspaces/common/workspaceTrust.ts +++ b/src/vs/workbench/services/workspaces/common/workspaceTrust.ts @@ -436,7 +436,7 @@ export class WorkspaceTrustService extends Disposable implements IWorkspaceTrust return this.configurationService.getValue(WORKSPACE_TRUST_ENABLED) ?? false; } - async requireWorkspaceTrust(options: WorkspaceTrustRequestOptions = { modal: true }): Promise { + async requestWorkspaceTrust(options: WorkspaceTrustRequestOptions = { modal: true }): Promise { // Trusted workspace if (this.currentTrustState === WorkspaceTrustState.Trusted) { return this.currentTrustState; diff --git a/src/vs/workbench/services/workspaces/test/common/testWorkspaceTrustService.ts b/src/vs/workbench/services/workspaces/test/common/testWorkspaceTrustService.ts index 2953fcb2328..bc2e1302c3e 100644 --- a/src/vs/workbench/services/workspaces/test/common/testWorkspaceTrustService.ts +++ b/src/vs/workbench/services/workspaces/test/common/testWorkspaceTrustService.ts @@ -22,7 +22,7 @@ export class TestWorkspaceTrustService implements IWorkspaceTrustService { return true; } - requireWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise { + requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise { return Promise.resolve(WorkspaceTrustState.Trusted); } }