mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
git context actions
This commit is contained in:
parent
57fe12fed3
commit
3ac3b7a113
3 changed files with 27 additions and 1 deletions
|
@ -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": [
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue