From 0a678f74b15e54e78233a5c1d780029398a4b0cc Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 8 Jan 2018 13:59:20 -0500 Subject: [PATCH 1/2] Register Nuclide File Tree: Rename/Delete commands at workspace level (#822) --- pkg/nuclide-file-tree/lib/FileTreeController.js | 6 +++--- pkg/nuclide-file-tree/menus/nuclide-file-tree.json | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pkg/nuclide-file-tree/lib/FileTreeController.js b/pkg/nuclide-file-tree/lib/FileTreeController.js index 0d2d8b60d0..3835c57dda 100644 --- a/pkg/nuclide-file-tree/lib/FileTreeController.js +++ b/pkg/nuclide-file-tree/lib/FileTreeController.js @@ -173,13 +173,10 @@ export default class FileTreeController { 'nuclide-file-tree:open-selected-entry-right': this._openSelectedEntrySplitRight.bind( this, ), - 'nuclide-file-tree:remove': this._deleteSelection.bind(this), 'core:delete': this._deleteSelection.bind(this), 'nuclide-file-tree:remove-project-folder-selection': this._removeRootFolderSelection.bind( this, ), - 'nuclide-file-tree:rename-selection': () => - FileSystemActions.openRenameDialog(), 'nuclide-file-tree:duplicate-selection': () => { FileSystemActions.openDuplicateDialog( this._openAndRevealFilePaths.bind(this), @@ -203,6 +200,9 @@ export default class FileTreeController { 'file:copy-full-path': this._copyFullPath.bind(this), // eslint-disable-next-line rulesdir/atom-apis 'file:show-in-file-manager': this._showInFileManager.bind(this), + 'nuclide-file-tree:rename-selection': () => + FileSystemActions.openRenameDialog(), + 'nuclide-file-tree:remove': this._deleteSelection.bind(this), }), ); if (state != null) { diff --git a/pkg/nuclide-file-tree/menus/nuclide-file-tree.json b/pkg/nuclide-file-tree/menus/nuclide-file-tree.json index 0b9ca2e766..fad09ca1ab 100644 --- a/pkg/nuclide-file-tree/menus/nuclide-file-tree.json +++ b/pkg/nuclide-file-tree/menus/nuclide-file-tree.json @@ -30,6 +30,14 @@ { "label": "New File...", "command": "nuclide-file-tree:add-file-relative" + }, + { + "label": "Rename Active File...", + "command": "nuclide-file-tree:rename-selection" + }, + { + "label": "Remove Active File", + "command": "nuclide-file-tree:remove" } ] } From 708df79131f62b7f205f2ce4adf94f1e355646be Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 13 Jan 2018 16:49:32 -0500 Subject: [PATCH 2/2] Nuclide File Tree: rename menu item 'Remove Active File' to 'Delete Active File' --- pkg/nuclide-file-tree/menus/nuclide-file-tree.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/nuclide-file-tree/menus/nuclide-file-tree.json b/pkg/nuclide-file-tree/menus/nuclide-file-tree.json index fad09ca1ab..a7654d6977 100644 --- a/pkg/nuclide-file-tree/menus/nuclide-file-tree.json +++ b/pkg/nuclide-file-tree/menus/nuclide-file-tree.json @@ -36,7 +36,7 @@ "command": "nuclide-file-tree:rename-selection" }, { - "label": "Remove Active File", + "label": "Delete Active File", "command": "nuclide-file-tree:remove" } ]