Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
menus.registerMenuAction(GitWidget.ContextMenu.BATCH, {
commandId: GIT_COMMANDS.STAGE_ALL.id,
label: 'Stage All Changes'
});
menus.registerMenuAction(GitWidget.ContextMenu.BATCH, {
commandId: GIT_COMMANDS.UNSTAGE_ALL.id,
label: 'Unstage All Changes'
});
menus.registerMenuAction(GitWidget.ContextMenu.BATCH, {
commandId: GIT_COMMANDS.DISCARD_ALL.id,
label: 'Discard All Changes'
});
menus.registerMenuAction(EditorContextMenu.NAVIGATION, {
commandId: GIT_COMMANDS.OPEN_FILE.id
});
menus.registerMenuAction(EditorContextMenu.NAVIGATION, {
commandId: GIT_COMMANDS.OPEN_CHANGES.id
});
[GIT_COMMANDS.STASH, GIT_COMMANDS.APPLY_STASH,
GIT_COMMANDS.APPLY_LATEST_STASH, GIT_COMMANDS.POP_STASH,
GIT_COMMANDS.POP_LATEST_STASH, GIT_COMMANDS.DROP_STASH].forEach(command =>
menus.registerMenuAction(GitWidget.ContextMenu.STASH, {
commandId: command.id,
label: command.label
})
);
}
registerMenus(menus: MenuModelRegistry): void {
menus.registerMenuAction(EditorContextMenu.NAVIGATION, {
commandId: PreviewCommands.OPEN.id,
label: 'Open Preview',
});
}
commandId: GIT_COMMANDS.COMMIT_SIGN_OFF.id,
label: 'Commit (Signed Off)'
});
menus.registerMenuAction(GitWidget.ContextMenu.BATCH, {
commandId: GIT_COMMANDS.STAGE_ALL.id,
label: 'Stage All Changes'
});
menus.registerMenuAction(GitWidget.ContextMenu.BATCH, {
commandId: GIT_COMMANDS.UNSTAGE_ALL.id,
label: 'Unstage All Changes'
});
menus.registerMenuAction(GitWidget.ContextMenu.BATCH, {
commandId: GIT_COMMANDS.DISCARD_ALL.id,
label: 'Discard All Changes'
});
menus.registerMenuAction(EditorContextMenu.NAVIGATION, {
commandId: GIT_COMMANDS.OPEN_FILE.id
});
menus.registerMenuAction(EditorContextMenu.NAVIGATION, {
commandId: GIT_COMMANDS.OPEN_CHANGES.id
});
[GIT_COMMANDS.STASH, GIT_COMMANDS.APPLY_STASH,
GIT_COMMANDS.APPLY_LATEST_STASH, GIT_COMMANDS.POP_STASH,
GIT_COMMANDS.POP_LATEST_STASH, GIT_COMMANDS.DROP_STASH].forEach(command =>
menus.registerMenuAction(GitWidget.ContextMenu.STASH, {
commandId: command.id,
label: command.label
})
);
}
registerMenus(menus: MenuModelRegistry): void {
menus.registerMenuAction(EditorContextMenu.NAVIGATION, {
commandId: GIT_COMMANDS.OPEN_FILE.id
});
menus.registerMenuAction(EditorContextMenu.NAVIGATION, {
commandId: GIT_COMMANDS.OPEN_CHANGES.id
});
const registerResourceAction = (group: string, action: MenuAction) => {
menus.registerMenuAction(ScmWidget.RESOURCE_INLINE_MENU, action);
menus.registerMenuAction([...ScmWidget.RESOURCE_CONTEXT_MENU, group], action);
};
registerResourceAction('navigation', {
commandId: GIT_COMMANDS.OPEN_CHANGED_FILE.id,
when: 'scmProvider == git && scmResourceGroup == workingTree'
});
registerResourceAction('1_modification', {
commandId: GIT_COMMANDS.DISCARD.id,
when: 'scmProvider == git && scmResourceGroup == workingTree'
});
registerMenus(menus: MenuModelRegistry): void {
menus.registerMenuAction(EditorContextMenu.NAVIGATION, {
commandId: GIT_COMMANDS.OPEN_FILE.id
});
menus.registerMenuAction(EditorContextMenu.NAVIGATION, {
commandId: GIT_COMMANDS.OPEN_CHANGES.id
});
const registerResourceAction = (group: string, action: MenuAction) => {
menus.registerMenuAction(ScmWidget.RESOURCE_INLINE_MENU, action);
menus.registerMenuAction([...ScmWidget.RESOURCE_CONTEXT_MENU, group], action);
};
registerResourceAction('navigation', {
commandId: GIT_COMMANDS.OPEN_CHANGED_FILE.id,
when: 'scmProvider == git && scmResourceGroup == workingTree'
});
registerResourceAction('1_modification', {