From 1b2fdd1cbdec68319a7aaa3d43db06459de672c5 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 24 Sep 2018 18:52:34 +0200 Subject: [PATCH] :lipstick: "Copy Relative Path" --- .../fileActions.contribution.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts index 439bc2f498b..30e273b8e62 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts @@ -124,19 +124,18 @@ const copyRelativePathCommand = { }; // Editor Title Context Menu +appendEditorTitleContextMenuItem(COPY_PATH_COMMAND_ID, copyPathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste'); +appendEditorTitleContextMenuItem(COPY_RELATIVE_PATH_COMMAND_ID, copyRelativePathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste'); appendEditorTitleContextMenuItem(REVEAL_IN_OS_COMMAND_ID, REVEAL_IN_OS_LABEL, ResourceContextKey.Scheme.isEqualTo(Schemas.file)); -appendEditorTitleContextMenuItem(COPY_PATH_COMMAND_ID, copyPathCommand.title, ResourceContextKey.IsFileSystemResource); -appendEditorTitleContextMenuItem(COPY_RELATIVE_PATH_COMMAND_ID, copyRelativePathCommand.title, ResourceContextKey.IsFileSystemResource); appendEditorTitleContextMenuItem(REVEAL_IN_EXPLORER_COMMAND_ID, nls.localize('revealInSideBar', "Reveal in Side Bar"), ResourceContextKey.IsFileSystemResource); -function appendEditorTitleContextMenuItem(id: string, title: string, when: ContextKeyExpr, alt?: { id: string, title: string }): void { +function appendEditorTitleContextMenuItem(id: string, title: string, when: ContextKeyExpr, group?: string): void { // Menu MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, { command: { id, title }, when, - group: '2_files', - alt + group: group || '2_files' }); } @@ -215,10 +214,16 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { }); MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { - group: 'navigation', - order: 40, + group: '1_cutcopypaste', + order: 10, command: copyPathCommand, - alt: copyRelativePathCommand, + when: ResourceContextKey.IsFileSystemResource +}); + +MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, { + group: '1_cutcopypaste', + order: 20, + command: copyRelativePathCommand, when: ResourceContextKey.IsFileSystemResource });