提交 0f3ed38c 编写于 作者: D Daniel Imms

Move terminal menu to parts/terminal

Part of #54510
上级 b5b20c46
......@@ -18,7 +18,6 @@ layoutMenuRegistration();
goMenuRegistration();
debugMenuRegistration();
tasksMenuRegistration();
terminalMenuRegistration();
if (isMacintosh) {
windowMenuRegistration();
......@@ -1511,102 +1510,3 @@ function helpMenuRegistration() {
order: 1
});
}
function terminalMenuRegistration() {
// Manage
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '1_manage',
command: {
id: 'workbench.action.terminal.new',
title: nls.localize({ key: 'miNewTerminal', comment: ['&& denotes a mnemonic'] }, "&&New Terminal")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '1_manage',
command: {
id: 'workbench.action.terminal.split',
title: nls.localize({ key: 'miSplitTerminal', comment: ['&& denotes a mnemonic'] }, "&&Split Terminal")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '1_manage',
command: {
id: 'workbench.action.terminal.kill',
title: nls.localize({ key: 'miKillTerminal', comment: ['&& denotes a mnemonic'] }, "&&Kill Terminal")
},
order: 3
});
// Run
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '2_run',
command: {
id: 'workbench.action.terminal.clear',
title: nls.localize({ key: 'miClear', comment: ['&& denotes a mnemonic'] }, "&&Clear")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '2_run',
command: {
id: 'workbench.action.terminal.runActiveFile',
title: nls.localize({ key: 'miRunActiveFile', comment: ['&& denotes a mnemonic'] }, "Run &&Active File")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '2_run',
command: {
id: 'workbench.action.terminal.runSelectedFile',
title: nls.localize({ key: 'miRunSelectedText', comment: ['&& denotes a mnemonic'] }, "Run &&Selected Text")
},
order: 3
});
// Selection
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
command: {
id: 'workbench.action.terminal.scrollToPreviousCommand',
title: nls.localize({ key: 'miScrollToPreviousCommand', comment: ['&& denotes a mnemonic'] }, "Scroll To Previous Command")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
command: {
id: 'workbench.action.terminal.scrollToNextCommand',
title: nls.localize({ key: 'miScrollToNextCommand', comment: ['&& denotes a mnemonic'] }, "Scroll To Next Command")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
command: {
id: 'workbench.action.terminal.selectToPreviousCommand',
title: nls.localize({ key: 'miSelectToPreviousCommand', comment: ['&& denotes a mnemonic'] }, "Select To Previous Command")
},
order: 3
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
command: {
id: 'workbench.action.terminal.selectToNextCommand',
title: nls.localize({ key: 'miSelectToNextCommand', comment: ['&& denotes a mnemonic'] }, "Select To Next Command")
},
order: 4
});
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal';
export function setup(): void {
export function setupTerminalCommands(): void {
registerOpenTerminalAtIndexCommands();
}
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
export function setupTerminalMenu() {
// Manage
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '1_manage',
command: {
id: 'workbench.action.terminal.new',
title: nls.localize({ key: 'miNewTerminal', comment: ['&& denotes a mnemonic'] }, "&&New Terminal")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '1_manage',
command: {
id: 'workbench.action.terminal.split',
title: nls.localize({ key: 'miSplitTerminal', comment: ['&& denotes a mnemonic'] }, "&&Split Terminal")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '1_manage',
command: {
id: 'workbench.action.terminal.kill',
title: nls.localize({ key: 'miKillTerminal', comment: ['&& denotes a mnemonic'] }, "&&Kill Terminal")
},
order: 3
});
// Run
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '2_run',
command: {
id: 'workbench.action.terminal.clear',
title: nls.localize({ key: 'miClear', comment: ['&& denotes a mnemonic'] }, "&&Clear")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '2_run',
command: {
id: 'workbench.action.terminal.runActiveFile',
title: nls.localize({ key: 'miRunActiveFile', comment: ['&& denotes a mnemonic'] }, "Run &&Active File")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '2_run',
command: {
id: 'workbench.action.terminal.runSelectedFile',
title: nls.localize({ key: 'miRunSelectedText', comment: ['&& denotes a mnemonic'] }, "Run &&Selected Text")
},
order: 3
});
// Scroll/selection
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
command: {
id: 'workbench.action.terminal.scrollToPreviousCommand',
title: nls.localize({ key: 'miScrollToPreviousCommand', comment: ['&& denotes a mnemonic'] }, "Scroll To Previous Command")
},
order: 1
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
command: {
id: 'workbench.action.terminal.scrollToNextCommand',
title: nls.localize({ key: 'miScrollToNextCommand', comment: ['&& denotes a mnemonic'] }, "Scroll To Next Command")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
command: {
id: 'workbench.action.terminal.selectToPreviousCommand',
title: nls.localize({ key: 'miSelectToPreviousCommand', comment: ['&& denotes a mnemonic'] }, "Select To Previous Command")
},
order: 3
});
MenuRegistry.appendMenuItem(MenuId.MenubarTerminalMenu, {
group: '3_selection',
command: {
id: 'workbench.action.terminal.selectToNextCommand',
title: nls.localize({ key: 'miSelectToNextCommand', comment: ['&& denotes a mnemonic'] }, "Select To Next Command")
},
order: 4
});
}
\ No newline at end of file
......@@ -11,7 +11,6 @@ import * as debugActions from 'vs/workbench/parts/debug/browser/debugActions';
import * as nls from 'vs/nls';
import * as panel from 'vs/workbench/browser/panel';
import * as platform from 'vs/base/common/platform';
import * as terminalCommands from 'vs/workbench/parts/terminal/common/terminalCommands';
import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, TerminalCursorStyle, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_NOT_VISIBLE, DEFAULT_LINE_HEIGHT, DEFAULT_LETTER_SPACING } from 'vs/workbench/parts/terminal/common/terminal';
import { getTerminalDefaultShellUnixLike, getTerminalDefaultShellWindows } from 'vs/workbench/parts/terminal/node/terminal';
......@@ -37,6 +36,8 @@ import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { TogglePanelAction } from 'vs/workbench/browser/parts/panel/panelActions';
import { TerminalPanel } from 'vs/workbench/parts/terminal/electron-browser/terminalPanel';
import { TerminalPickerHandler } from 'vs/workbench/parts/terminal/browser/terminalQuickOpen';
import { setupTerminalCommands } from 'vs/workbench/parts/terminal/common/terminalCommands';
import { setupTerminalMenu } from 'vs/workbench/parts/terminal/common/terminalMenu';
const quickOpenRegistry = (Registry.as<IQuickOpenRegistry>(QuickOpenExtensions.Quickopen));
......@@ -533,6 +534,7 @@ actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SelectToNextComm
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SelectToPreviousLineAction, SelectToPreviousLineAction.ID, SelectToPreviousLineAction.LABEL), 'Terminal: Select To Previous Line', category);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SelectToNextLineAction, SelectToNextLineAction.ID, SelectToNextLineAction.LABEL), 'Terminal: Select To Next Line', category);
terminalCommands.setup();
setupTerminalCommands();
setupTerminalMenu();
registerColors();
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册