提交 26e06364 编写于 作者: D Daniel Imms

Reference termiinal command id enum for menu

上级 c999e037
......@@ -5,90 +5,94 @@
import * as nls from 'vs/nls';
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { COMMAND_ID } from 'vs/workbench/parts/terminal/common/terminalCommands';
export function setupTerminalMenu() {
// Manage
const manageGroup = '1_manage';
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '1_manage',
group: manageGroup,
command: {
id: 'workbench.action.terminal.new',
id: COMMAND_ID.NEW,
title: nls.localize({ key: 'miNewTerminal', comment: ['&& denotes a mnemonic'] }, "&&New Terminal")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '1_manage',
group: manageGroup,
command: {
id: 'workbench.action.terminal.split',
id: COMMAND_ID.SPLIT,
title: nls.localize({ key: 'miSplitTerminal', comment: ['&& denotes a mnemonic'] }, "&&Split Terminal")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '1_manage',
group: manageGroup,
command: {
id: 'workbench.action.terminal.kill',
id: COMMAND_ID.KILL,
title: nls.localize({ key: 'miKillTerminal', comment: ['&& denotes a mnemonic'] }, "&&Kill Terminal")
},
order: 3
});
// Run
const runGroup = '2_run';
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '2_run',
group: runGroup,
command: {
id: 'workbench.action.terminal.clear',
id: COMMAND_ID.CLEAR,
title: nls.localize({ key: 'miClear', comment: ['&& denotes a mnemonic'] }, "&&Clear")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '2_run',
group: runGroup,
command: {
id: 'workbench.action.terminal.runActiveFile',
id: COMMAND_ID.RUN_ACTIVE_FILE,
title: nls.localize({ key: 'miRunActiveFile', comment: ['&& denotes a mnemonic'] }, "Run &&Active File")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '2_run',
group: runGroup,
command: {
id: 'workbench.action.terminal.runSelectedFile',
id: COMMAND_ID.RUN_SELECTED_TEXT,
title: nls.localize({ key: 'miRunSelectedText', comment: ['&& denotes a mnemonic'] }, "Run &&Selected Text")
},
order: 3
});
// Scroll/selection
// Navigation
const navigationGroup = '3_navigation';
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
group: navigationGroup,
command: {
id: 'workbench.action.terminal.scrollToPreviousCommand',
id: COMMAND_ID.SCROLL_TO_PREVIOUS_COMMAND,
title: nls.localize({ key: 'miScrollToPreviousCommand', comment: ['&& denotes a mnemonic'] }, "Scroll To Previous Command")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
group: navigationGroup,
command: {
id: 'workbench.action.terminal.scrollToNextCommand',
id: COMMAND_ID.SCROLL_TO_NEXT_COMMAND,
title: nls.localize({ key: 'miScrollToNextCommand', comment: ['&& denotes a mnemonic'] }, "Scroll To Next Command")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
group: navigationGroup,
command: {
id: 'workbench.action.terminal.selectToPreviousCommand',
id: COMMAND_ID.SELECT_TO_PREVIOUS_COMMAND,
title: nls.localize({ key: 'miSelectToPreviousCommand', comment: ['&& denotes a mnemonic'] }, "Select To Previous Command")
},
order: 3
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
group: navigationGroup,
command: {
id: 'workbench.action.terminal.selectToNextCommand',
id: COMMAND_ID.SELECT_TO_NEXT_COMMAND,
title: nls.localize({ key: 'miSelectToNextCommand', comment: ['&& denotes a mnemonic'] }, "Select To Next Command")
},
order: 4
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册