web - only offer "Save Workspace As..." when supporting empty workspaces

The rationale is that the file system maybe in-memory and saving a workspace into such a file system will mean that after window reload we have to open an empty workspace because the workspace may not be persisted anymore.
This commit is contained in:
Benjamin Pasero 2020-09-23 08:45:21 +02:00
parent 02996aac27
commit 47625a0c05

View file

@ -258,7 +258,7 @@ const workspacesCategory = nls.localize('workspaces', "Workspaces");
registry.registerWorkbenchAction(SyncActionDescriptor.from(AddRootFolderAction), 'Workspaces: Add Folder to Workspace...', workspacesCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(GlobalRemoveRootFolderAction), 'Workspaces: Remove Folder from Workspace...', workspacesCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(CloseWorkspaceAction, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_F) }), 'Workspaces: Close Workspace', workspacesCategory, EmptyWorkspaceSupportContext);
registry.registerWorkbenchAction(SyncActionDescriptor.from(SaveWorkspaceAsAction), 'Workspaces: Save Workspace As...', workspacesCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(SaveWorkspaceAsAction), 'Workspaces: Save Workspace As...', workspacesCategory, EmptyWorkspaceSupportContext);
registry.registerWorkbenchAction(SyncActionDescriptor.from(DuplicateWorkspaceInNewWindowAction), 'Workspaces: Duplicate Workspace in New Window', workspacesCategory);
// --- Menu Registration
@ -282,7 +282,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
id: SaveWorkspaceAsAction.ID,
title: nls.localize('miSaveWorkspaceAs', "Save Workspace As...")
},
order: 2
order: 2,
when: EmptyWorkspaceSupportContext
});
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {