git context actions

This commit is contained in:
Joao Moreno 2016-11-28 11:08:37 +01:00
parent 57fe12fed3
commit 3ac3b7a113
3 changed files with 27 additions and 1 deletions

View file

@ -29,6 +29,11 @@
"light": "resources/icons/light/refresh.svg",
"dark": "resources/icons/dark/refresh.svg"
}
},
{
"command": "git.open-change",
"title": "Open Change",
"category": "Git"
}
],
"menus": {
@ -38,6 +43,13 @@
"group": "navigation",
"when": "scm.provider == git"
}
],
"scm/context": [
{
"command": "git.open-change",
"group": "navigation",
"when": "scm.provider == git"
}
]
},
"languages": [

View file

@ -7,6 +7,19 @@
import { commands, Disposable } from 'vscode';
function refresh(): void {
console.log('refresh');
}
function openChange(...args: any[]): void {
console.log('openChange', args);
}
export function registerCommands(): Disposable {
return commands.registerCommand('git.refresh', () => console.log('REFRESH'));
const disposables = [
commands.registerCommand('git.refresh', refresh),
commands.registerCommand('git.open-change', openChange)
];
return Disposable.from(...disposables);
}

View file

@ -33,6 +33,7 @@ namespace schema {
case 'explorer/context': return MenuId.ExplorerContext;
case 'editor/title/context': return MenuId.EditorTitleContext;
case 'scm/title': return MenuId.SCMTitle;
case 'scm/context': return MenuId.SCMContext;
}
}