From 3d013dc76f402e33b4cb8cc3268ebded6bb3731e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 18 Nov 2020 11:08:37 +0100 Subject: [PATCH] move git rename to command palette --- extensions/git/package.json | 18 +----------------- extensions/git/src/commands.ts | 4 +++- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/extensions/git/package.json b/extensions/git/package.json index 4ca0723655c..b0ba9c45f74 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -628,7 +628,7 @@ }, { "command": "git.rename", - "when": "false" + "when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && resourceScheme == file" }, { "command": "git.commit", @@ -1352,18 +1352,6 @@ "when": "config.git.enabled && !git.missing && timelineItem =~ /git:file:commit\\b/" } ], - "explorer/context": [ - { - "submenu": "git.explorer", - "group": "7_git", - "when": "config.git.enabled && !git.missing && !explorerResourceIsRoot" - } - ], - "git.explorer": [ - { - "command": "git.rename" - } - ], "git.commit": [ { "command": "git.commit", @@ -1582,10 +1570,6 @@ ] }, "submenus": [ - { - "id": "git.explorer", - "label": "%submenu.explorer%" - }, { "id": "git.commit", "label": "%submenu.commit%" diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index a63189d3f73..e086c22ffc3 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -766,7 +766,9 @@ export class CommandCenter { } @command('git.rename', { repository: true }) - async rename(repository: Repository, fromUri: Uri): Promise { + async rename(repository: Repository, fromUri: Uri | undefined): Promise { + fromUri = fromUri ?? window.activeTextEditor?.document.uri; + if (!fromUri) { return; }