diff --git a/extensions/git/package.json b/extensions/git/package.json
index 3d00bb23494..0e74a3a51d8 100644
--- a/extensions/git/package.json
+++ b/extensions/git/package.json
@@ -31,10 +31,15 @@
}
},
{
- "command": "git.open",
+ "command": "git.openChange",
"title": "Open Change",
"category": "Git"
},
+ {
+ "command": "git.openFile",
+ "title": "Open File",
+ "category": "Git"
+ },
{
"command": "git.stage",
"title": "Stage",
@@ -70,6 +75,15 @@
"light": "resources/icons/light/unstage.svg",
"dark": "resources/icons/dark/unstage.svg"
}
+ },
+ {
+ "command": "git.clean",
+ "title": "Clean",
+ "category": "Git",
+ "icon": {
+ "light": "resources/icons/light/clean.svg",
+ "dark": "resources/icons/dark/clean.svg"
+ }
}
],
"menus": {
@@ -102,22 +116,52 @@
],
"scm/resource/context": [
{
- "command": "git.unstage",
+ "command": "git.openChange",
+ "when": "scmProvider == git && scmResourceGroup == index"
+ },
+ {
+ "command": "git.openFile",
"when": "scmProvider == git && scmResourceGroup == index"
},
{
"command": "git.unstage",
- "group": "inline",
- "when": "scmProvider == git && scmResourceGroup == index"
+ "when": "scmProvider == git && scmResourceGroup == index",
+ "group": "1_modification"
+ },
+ {
+ "command": "git.unstage",
+ "when": "scmProvider == git && scmResourceGroup == index",
+ "group": "inline"
+ },
+ {
+ "command": "git.openChange",
+ "when": "scmProvider == git && scmResourceGroup == workingTree",
+ "group": "navigation"
+ },
+ {
+ "command": "git.openFile",
+ "when": "scmProvider == git && scmResourceGroup == workingTree",
+ "group": "navigation"
},
{
"command": "git.stage",
- "when": "scmProvider == git && scmResourceGroup == workingTree"
+ "when": "scmProvider == git && scmResourceGroup == workingTree",
+ "group": "1_modification"
+ },
+ {
+ "command": "git.clean",
+ "when": "scmProvider == git && scmResourceGroup == workingTree",
+ "group": "1_modification"
+ },
+ {
+ "command": "git.clean",
+ "when": "scmProvider == git && scmResourceGroup == workingTree",
+ "group": "inline"
},
{
"command": "git.stage",
- "group": "inline",
- "when": "scmProvider == git && scmResourceGroup == workingTree"
+ "when": "scmProvider == git && scmResourceGroup == workingTree",
+ "group": "inline"
}
]
},
diff --git a/extensions/git/resources/icons/dark/clean.svg b/extensions/git/resources/icons/dark/clean.svg
new file mode 100644
index 00000000000..9f175633389
--- /dev/null
+++ b/extensions/git/resources/icons/dark/clean.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/extensions/git/resources/icons/light/clean.svg b/extensions/git/resources/icons/light/clean.svg
new file mode 100644
index 00000000000..1fa6ba48a19
--- /dev/null
+++ b/extensions/git/resources/icons/light/clean.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts
index 20ec1a761e2..3e48f10ffeb 100644
--- a/extensions/git/src/commands.ts
+++ b/extensions/git/src/commands.ts
@@ -16,7 +16,11 @@ function refresh(model: Model): () => void {
};
}
-function open(...args: any[]): void {
+function openChange(...args: any[]): void {
+ console.log('open', args);
+}
+
+function openFile(...args: any[]): void {
console.log('open', args);
}
@@ -36,14 +40,21 @@ function unstageAll(resourceGroup: SCMResourceGroup): void {
log('unstage-all', resourceGroup);
}
+function clean(resource: SCMResource): void {
+ log('clean', resource);
+}
+
+
export function registerCommands(model: Model): Disposable {
const disposables = [
commands.registerCommand('git.refresh', refresh(model)),
+ commands.registerCommand('git.openChange', openChange),
+ commands.registerCommand('git.openFile', openFile),
commands.registerCommand('git.stage', stage),
commands.registerCommand('git.stage-all', stageAll),
commands.registerCommand('git.unstage', unstage),
commands.registerCommand('git.unstage-all', unstageAll),
- commands.registerCommand('git.open', open)
+ commands.registerCommand('git.clean', clean),
];
return Disposable.from(...disposables);