diff --git a/src/vs/workbench/browser/parts/editor/editorCommands.ts b/src/vs/workbench/browser/parts/editor/editorCommands.ts index da2012ab05e5..9f9400c629cc 100644 --- a/src/vs/workbench/browser/parts/editor/editorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/editorCommands.ts @@ -192,8 +192,8 @@ function registerDiffEditorCommands(): void { function handleCommandDeprecations(): void { const mapDeprecatedCommands = { - // Add in here a map from old command to new command like this: - // 'workbench.action.focusFirstEditor': 'workbench.action.focusFirstEditorGroup', + 'workbench.action.files.newFile': 'explorer.newFile', + 'workbench.action.files.newFolder': 'explorer.newFolder' }; Object.keys(mapDeprecatedCommands).forEach(deprecatedCommandId => { diff --git a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts index 6b663afd5b3a..11d95eb4fd88 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts @@ -240,7 +240,7 @@ CommandsRegistry.registerCommand('_files.windowOpen', openWindowCommand); CommandsRegistry.registerCommand('workbench.action.files.openFileInNewWindow', openFileInNewWindowCommand); KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'workbench.files.action.openEditors.open', + id: 'openEditors.open', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: OpenedEditorsFocusCondition, primary: KeyCode.Enter, @@ -248,7 +248,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ }); KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'workbench.files.action.filesExplorer.open', + id: 'filesExplorer.open', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: FilesExplorerFocusCondition, primary: KeyCode.Enter, @@ -259,7 +259,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ }); KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'workbench.files.action.explorer.openToSide', + id: 'explorer.openToSide', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: ExplorerFocusCondition, primary: KeyMod.CtrlCmd | KeyCode.Enter, @@ -270,7 +270,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ }); KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'workbench.files.action.filesExplorer.rename', + id: 'filesExplorer.rename', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: FilesExplorerFocusCondition, primary: KeyCode.F2, @@ -281,7 +281,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ }); KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'workbench.files.action.filesExplorer.moveFileToTrash', + id: 'filesExplorer.moveFileToTrash', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: FilesExplorerFocusCondition, primary: KeyCode.Delete, @@ -292,7 +292,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ }); KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'workbench.files.action.filesExplorer.deleteFile', + id: 'filesExplorer.deleteFile', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: FilesExplorerFocusCondition, primary: KeyMod.Shift | KeyCode.Delete, @@ -303,7 +303,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ }); KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'workbench.files.action.explorer.copyPath', + id: 'explorer.copyPath', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: ExplorerFocusCondition, primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_C, @@ -314,7 +314,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ }); KeybindingsRegistry.registerCommandAndKeybindingRule({ - id: 'workbench.files.action.explorer.revealInOS', + id: 'explorer.revealInOS', weight: KeybindingsRegistry.WEIGHT.workbenchContrib(), when: ExplorerFocusCondition, primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_R, diff --git a/src/vs/workbench/parts/files/browser/fileActions.ts b/src/vs/workbench/parts/files/browser/fileActions.ts index 3bc93fe20aa2..934981eea547 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.ts @@ -135,7 +135,7 @@ export class BaseFileAction extends Action { export class TriggerRenameFileAction extends BaseFileAction { - public static ID = 'workbench.files.action.filesExplorer.rename'; + public static ID = 'filesExplorer.rename'; private tree: ITree; private renameAction: BaseRenameAction; @@ -436,7 +436,7 @@ export class NewFileAction extends BaseNewAction { @ITextFileService textFileService: ITextFileService, @IInstantiationService instantiationService: IInstantiationService ) { - super('workbench.action.files.newFile', nls.localize('newFile', "New File"), tree, true, instantiationService.createInstance(CreateFileAction, element), null, fileService, messageService, textFileService); + super('explorer.newFile', nls.localize('newFile', "New File"), tree, true, instantiationService.createInstance(CreateFileAction, element), null, fileService, messageService, textFileService); this.class = 'explorer-action new-file'; this._updateEnablement(); @@ -454,7 +454,7 @@ export class NewFolderAction extends BaseNewAction { @ITextFileService textFileService: ITextFileService, @IInstantiationService instantiationService: IInstantiationService ) { - super('workbench.action.files.newFolder', nls.localize('newFolder', "New Folder"), tree, false, instantiationService.createInstance(CreateFolderAction, element), null, fileService, messageService, textFileService); + super('explorer.newFolder', nls.localize('newFolder', "New Folder"), tree, false, instantiationService.createInstance(CreateFolderAction, element), null, fileService, messageService, textFileService); this.class = 'explorer-action new-folder'; this._updateEnablement(); @@ -533,7 +533,7 @@ export class GlobalNewUntitledFileAction extends Action { /* Create new file from anywhere */ export class GlobalNewFileAction extends BaseGlobalNewAction { - public static ID = 'workbench.action.files.newFile'; + public static ID = 'explorer.newFile'; public static LABEL = nls.localize('newFile', "New File"); protected getAction(): IConstructorSignature2 { @@ -543,7 +543,7 @@ export class GlobalNewFileAction extends BaseGlobalNewAction { /* Create new folder from anywhere */ export class GlobalNewFolderAction extends BaseGlobalNewAction { - public static ID = 'workbench.action.files.newFolder'; + public static ID = 'explorer.newFolder'; public static LABEL = nls.localize('newFolder', "New Folder"); protected getAction(): IConstructorSignature2 { @@ -745,7 +745,7 @@ export class BaseDeleteFileAction extends BaseFileAction { /* Move File/Folder to trash */ export class MoveFileToTrashAction extends BaseDeleteFileAction { - public static ID = 'workbench.files.action.filesExplorer.moveFileToTrash'; + public static ID = 'filesExplorer.moveFileToTrash'; constructor( tree: ITree, @@ -1073,7 +1073,7 @@ export class DuplicateFileAction extends BaseFileAction { // Open to the side export class OpenToSideAction extends Action { - public static ID = 'workbench.files.action.explorer.openToSide'; + public static ID = 'explorer.openToSide'; public static LABEL = nls.localize('openToSide', "Open to the Side"); private tree: ITree; @@ -1822,7 +1822,7 @@ export class RevealInOSAction extends Action { private resource: URI, @IInstantiationService private instantiationService: IInstantiationService ) { - super('workbench.files.action.explorer.revealInOS', RevealInOSAction.LABEL); + super('explorer.revealInOS', RevealInOSAction.LABEL); this.order = 45; } @@ -1869,7 +1869,7 @@ export class CopyPathAction extends Action { private resource: URI, @IInstantiationService private instantiationService: IInstantiationService ) { - super('workbench.files.action.explorer.copyPath', CopyPathAction.LABEL); + super('explorer.copyPath', CopyPathAction.LABEL); this.order = 140; } diff --git a/src/vs/workbench/parts/files/browser/fileCommands.ts b/src/vs/workbench/parts/files/browser/fileCommands.ts index 3b2f767b4a10..e0259d5a9ce5 100644 --- a/src/vs/workbench/parts/files/browser/fileCommands.ts +++ b/src/vs/workbench/parts/files/browser/fileCommands.ts @@ -179,15 +179,15 @@ export const openFocussedExplorerViewItemCommand = (accessor: ServicesAccessor) export const openFocussedOpenedEditorsViewItemCommand = (accessor: ServicesAccessor) => openFocussedOpenedEditorsViewItem(accessor, false); export const renameFocussedExplorerViewItemCommand = (accessor: ServicesAccessor) => { - runActionOnFocussedExplorerViewItem(accessor, 'workbench.files.action.filesExplorer.rename'); + runActionOnFocussedExplorerViewItem(accessor, 'filesExplorer.rename'); }; export const deleteFocussedExplorerViewItemCommand = (accessor: ServicesAccessor) => { - runActionOnFocussedExplorerViewItem(accessor, 'workbench.files.action.filesExplorer.moveFileToTrash', { useTrash: false }); + runActionOnFocussedExplorerViewItem(accessor, 'filesExplorer.moveFileToTrash', { useTrash: false }); }; export const moveFocussedExplorerViewItemToTrashCommand = (accessor: ServicesAccessor) => { - runActionOnFocussedExplorerViewItem(accessor, 'workbench.files.action.filesExplorer.moveFileToTrash', { useTrash: true }); + runActionOnFocussedExplorerViewItem(accessor, 'filesExplorer.moveFileToTrash', { useTrash: true }); }; export const copyPathOfFocussedExplorerItem = (accessor: ServicesAccessor) => {