diff --git a/extensions/git/package.json b/extensions/git/package.json index 0e74a3a51d8..34c428599c4 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -84,6 +84,15 @@ "light": "resources/icons/light/clean.svg", "dark": "resources/icons/dark/clean.svg" } + }, + { + "command": "git.cleanAll", + "title": "Clean All", + "category": "Git", + "icon": { + "light": "resources/icons/light/clean.svg", + "dark": "resources/icons/dark/clean.svg" + } } ], "menus": { @@ -97,31 +106,45 @@ "scm/resourceGroup/context": [ { "command": "git.unstage-all", - "when": "scmProvider == git && scmResourceGroup == index" + "when": "scmProvider == git && scmResourceGroup == index", + "group": "1_modification" }, { "command": "git.unstage-all", - "group": "inline", - "when": "scmProvider == git && scmResourceGroup == index" + "when": "scmProvider == git && scmResourceGroup == index", + "group": "inline" + }, + { + "command": "git.cleanAll", + "when": "scmProvider == git && scmResourceGroup == workingTree", + "group": "1_modification" }, { "command": "git.stage-all", - "when": "scmProvider == git && scmResourceGroup == workingTree" + "when": "scmProvider == git && scmResourceGroup == workingTree", + "group": "1_modification" + }, + { + "command": "git.cleanAll", + "when": "scmProvider == git && scmResourceGroup == workingTree", + "group": "inline" }, { "command": "git.stage-all", - "group": "inline", - "when": "scmProvider == git && scmResourceGroup == workingTree" + "when": "scmProvider == git && scmResourceGroup == workingTree", + "group": "inline" } ], "scm/resource/context": [ { "command": "git.openChange", - "when": "scmProvider == git && scmResourceGroup == index" + "when": "scmProvider == git && scmResourceGroup == index", + "group": "navigation" }, { "command": "git.openFile", - "when": "scmProvider == git && scmResourceGroup == index" + "when": "scmProvider == git && scmResourceGroup == index", + "group": "navigation" }, { "command": "git.unstage", diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 3e48f10ffeb..36083481bb9 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -44,6 +44,9 @@ function clean(resource: SCMResource): void { log('clean', resource); } +function cleanAll(resourceGroup: SCMResourceGroup): void { + log('clean all', resourceGroup); +} export function registerCommands(model: Model): Disposable { const disposables = [ @@ -55,6 +58,7 @@ export function registerCommands(model: Model): Disposable { commands.registerCommand('git.unstage', unstage), commands.registerCommand('git.unstage-all', unstageAll), commands.registerCommand('git.clean', clean), + commands.registerCommand('git.cleanAll', cleanAll), ]; return Disposable.from(...disposables);