diff --git a/src/vs/workbench/api/common/extHostApiCommands.ts b/src/vs/workbench/api/common/extHostApiCommands.ts index 8f3c18a769f02..db6bdefe028a6 100644 --- a/src/vs/workbench/api/common/extHostApiCommands.ts +++ b/src/vs/workbench/api/common/extHostApiCommands.ts @@ -439,7 +439,7 @@ const newCommands: ApiCommand[] = [ ), // --- continue edit session new ApiCommand( - 'vscode.experimental.editSession.continue', '_workbench.experimental.editSessions.actions.continueEditSession', 'Continue the current edit session in a different workspace', + 'vscode.experimental.editSession.continue', '_workbench.editSessions.actions.continueEditSession', 'Continue the current edit session in a different workspace', [ApiCommandArgument.Uri.with('workspaceUri', 'The target workspace to continue the current edit session in')], ApiCommandResult.Void ) diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts index 238f1612300fb..33842f0481f9c 100644 --- a/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts +++ b/src/vs/workbench/contrib/editSessions/browser/editSessions.contribution.ts @@ -58,19 +58,19 @@ registerSingleton(IEditSessionsLogService, EditSessionsLogService, false); registerSingleton(IEditSessionsStorageService, EditSessionsWorkbenchService, false); const continueWorkingOnCommand: IAction2Options = { - id: '_workbench.experimental.editSessions.actions.continueEditSession', + id: '_workbench.editSessions.actions.continueEditSession', title: { value: localize('continue working on', "Continue Working On..."), original: 'Continue Working On...' }, precondition: WorkspaceFolderCountContext.notEqualsTo('0'), f1: true }; const openLocalFolderCommand: IAction2Options = { - id: '_workbench.experimental.editSessions.actions.continueEditSession.openLocalFolder', + id: '_workbench.editSessions.actions.continueEditSession.openLocalFolder', title: { value: localize('continue edit session in local folder', "Open In Local Folder"), original: 'Open In Local Folder' }, category: EDIT_SESSION_SYNC_CATEGORY, precondition: IsWebContext }; const showOutputChannelCommand: IAction2Options = { - id: 'workbench.experimental.editSessions.actions.showOutputChannel', + id: 'workbench.editSessions.actions.showOutputChannel', title: { value: localize('show log', 'Show Log'), original: 'Show Log' }, category: EDIT_SESSION_SYNC_CATEGORY }; @@ -80,12 +80,10 @@ const resumingProgressOptions = { title: `[${localize('resuming edit session window', 'Resuming edit session...')}](command:${showOutputChannelCommand.id})` }; const queryParamName = 'editSessionId'; -const experimentalSettingName = 'workbench.experimental.editSessions.enabled'; -const useEditSessionsWithContinueOn = 'workbench.experimental.editSessions.continueOn'; +const useEditSessionsWithContinueOn = 'workbench.editSessions.continueOn'; export class EditSessionsContribution extends Disposable implements IWorkbenchContribution { - private registered = false; private continueEditSessionOptions: ContinueEditSessionItem[] = []; private readonly shouldShowViewsContext: IContextKey; @@ -116,12 +114,6 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo this.autoResumeEditSession(); - this.configurationService.onDidChangeConfiguration((e) => { - if (e.affectsConfiguration(experimentalSettingName)) { - this.registerActions(); - } - }); - this.registerActions(); this.registerViews(); this.registerContributedEditSessionOptions(); @@ -145,8 +137,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo if (this.environmentService.editSessionId !== undefined) { await this.resumeEditSession(this.environmentService.editSessionId).finally(() => this.environmentService.editSessionId = undefined); } else if ( - this.configurationService.getValue('workbench.experimental.editSessions.enabled') === true && - this.configurationService.getValue('workbench.experimental.editSessions.autoResume') === 'onReload' && + this.configurationService.getValue('workbench.editSessions.autoResume') === 'onReload' && this.editSessionsStorageService.isSignedIn ) { // Attempt to resume edit session based on edit workspace identifier @@ -186,11 +177,6 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo } private registerActions() { - if (this.registered || this.configurationService.getValue(experimentalSettingName) !== true) { - this.logService.info(`Skipping registering edit sessions actions as edit sessions are currently disabled. Set ${experimentalSettingName} to enable edit sessions.`); - return; - } - this.registerContinueEditSessionAction(); this.registerResumeLatestEditSessionAction(); @@ -200,8 +186,6 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo this.registerShowEditSessionViewAction(); this.registerShowEditSessionOutputChannelAction(); - - this.registered = true; } private registerShowEditSessionOutputChannelAction() { @@ -289,7 +273,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo this._register(registerAction2(class ResumeLatestEditSessionAction extends Action2 { constructor() { super({ - id: 'workbench.experimental.editSessions.actions.resumeLatest', + id: 'workbench.editSessions.actions.resumeLatest', title: { value: localize('resume latest.v2', "Resume Latest Edit Session"), original: 'Resume Latest Edit Session' }, category: EDIT_SESSION_SYNC_CATEGORY, f1: true, @@ -315,7 +299,7 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo this._register(registerAction2(class StoreLatestEditSessionAction extends Action2 { constructor() { super({ - id: 'workbench.experimental.editSessions.actions.storeCurrent', + id: 'workbench.editSessions.actions.storeCurrent', title: { value: localize('store current.v2', "Store Current Edit Session"), original: 'Store Current Edit Session' }, category: EDIT_SESSION_SYNC_CATEGORY, f1: true, @@ -741,23 +725,28 @@ Registry.as(ConfigurationExtensions.Configuration).regis 'default': 'off', 'markdownDescription': localize('autoStore', "Controls whether to automatically store an available edit session for the current workspace."), }, - 'workbench.experimental.editSessions.enabled': { - 'type': 'boolean', - 'tags': ['experimental', 'usesOnlineServices'], - 'default': true, - 'markdownDescription': localize('editSessionsEnabled', "Controls whether to display cloud-enabled actions to store and resume uncommitted changes when switching between web, desktop, or devices."), - }, - 'workbench.experimental.editSessions.autoResume': { + 'workbench.editSessions.autoResume': { enum: ['onReload', 'off'], enumDescriptions: [ localize('autoResume.onReload', "Automatically resume available edit session on window reload."), localize('autoResume.off', "Never attempt to resume an edit session.") ], 'type': 'string', - 'tags': ['experimental', 'usesOnlineServices'], + 'tags': ['usesOnlineServices'], 'default': 'onReload', 'markdownDescription': localize('autoResume', "Controls whether to automatically resume an available edit session for the current workspace."), }, + 'workbench.editSessions.continueOn': { + enum: ['prompt', 'off'], + enumDescriptions: [ + localize('continueOn.promptForAuth', 'Prompt the user to sign in to store edit sessions with Continue Working On.'), + localize('continueOn.off', 'Do not use edit sessions with Continue Working On unless the user has already turned on edit sessions.') + ], + type: 'string', + tags: ['usesOnlineServices'], + default: 'prompt', + markdownDescription: localize('continueOn', 'Controls whether to prompt the user to store edit sessions when using Continue Working On.') + }, 'workbench.experimental.editSessions.continueOn': { enum: ['prompt', 'off'], enumDescriptions: [ @@ -767,7 +756,25 @@ Registry.as(ConfigurationExtensions.Configuration).regis type: 'string', tags: ['experimental', 'usesOnlineServices'], default: 'prompt', + markdownDeprecationMessage: localize('continueOnDeprecated', 'This setting is deprecated in favor of {0}.', '`#workbench.experimental.continueOn#`'), markdownDescription: localize('continueOn', 'Controls whether to prompt the user to store edit sessions when using Continue Working On.') - } + }, + 'workbench.experimental.editSessions.enabled': { + 'type': 'boolean', + 'tags': ['experimental', 'usesOnlineServices'], + 'default': true, + 'markdownDeprecationMessage': localize('editSessionsEnabledDeprecated', "This setting is deprecated as Edit Sessions are no longer experimental. Please see {0} and {1} for configuring behavior related to Edit Sessions.", '`#workbench.editSessions.autoResume#`', '`#workbench.editSessions.continueOn#`') + }, + 'workbench.experimental.editSessions.autoResume': { + enum: ['onReload', 'off'], + enumDescriptions: [ + localize('autoResume.onReload', "Automatically resume available edit session on window reload."), + localize('autoResume.off', "Never attempt to resume an edit session.") + ], + 'type': 'string', + 'tags': ['experimental', 'usesOnlineServices'], + 'default': 'onReload', + 'markdownDeprecationMessage': localize('autoResumeDeprecated', "This setting is deprecated in favor of {0}.", '`#workbench.editSessions.autoResume#`') + }, } }); diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts b/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts index fdce08d708202..d995c8df6caba 100644 --- a/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts +++ b/src/vs/workbench/contrib/editSessions/browser/editSessionsStorageService.ts @@ -293,7 +293,7 @@ export class EditSessionsWorkbenchService extends Disposable implements IEditSes quickpick.onDidTriggerItemButton(async (e) => { if (e.button.tooltip === configureContinueOnPreference.tooltip) { - await this.commandService.executeCommand('workbench.action.openSettings', 'workbench.experimental.editSessions.continueOn'); + await this.commandService.executeCommand('workbench.action.openSettings', 'workbench.editSessions.continueOn'); } }); diff --git a/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.ts b/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.ts index feba1d9df63a3..7a70b872e4142 100644 --- a/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.ts +++ b/src/vs/workbench/contrib/editSessions/browser/editSessionsViews.ts @@ -90,7 +90,7 @@ export class EditSessionsDataViews extends Disposable { async run(accessor: ServicesAccessor, handle: TreeViewItemHandleArg): Promise { const editSessionId = URI.parse(handle.$treeItemHandle).path.substring(1); const commandService = accessor.get(ICommandService); - await commandService.executeCommand('workbench.experimental.editSessions.actions.resumeLatest', editSessionId); + await commandService.executeCommand('workbench.editSessions.actions.resumeLatest', editSessionId); await treeView.refresh(); } }); @@ -106,7 +106,7 @@ export class EditSessionsDataViews extends Disposable { async run(accessor: ServicesAccessor, handle: TreeViewItemHandleArg): Promise { const commandService = accessor.get(ICommandService); - await commandService.executeCommand('workbench.experimental.editSessions.actions.storeCurrent'); + await commandService.executeCommand('workbench.editSessions.actions.storeCurrent'); await treeView.refresh(); } });