@theia/editor 1.45.1 → 1.46.0-next.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -30
- package/lib/browser/decorations/editor-decoration-style.d.ts +8 -8
- package/lib/browser/decorations/editor-decoration-style.js +36 -36
- package/lib/browser/decorations/editor-decoration.d.ts +106 -106
- package/lib/browser/decorations/editor-decoration.js +37 -37
- package/lib/browser/decorations/editor-decorator.d.ts +6 -6
- package/lib/browser/decorations/editor-decorator.js +43 -43
- package/lib/browser/decorations/index.d.ts +3 -3
- package/lib/browser/decorations/index.js +30 -30
- package/lib/browser/diff-navigator.d.ts +9 -10
- package/lib/browser/diff-navigator.d.ts.map +1 -1
- package/lib/browser/diff-navigator.js +19 -19
- package/lib/browser/diff-navigator.js.map +1 -1
- package/lib/browser/editor-command.d.ts +102 -102
- package/lib/browser/editor-command.js +426 -426
- package/lib/browser/editor-contribution.d.ts +26 -26
- package/lib/browser/editor-contribution.js +198 -198
- package/lib/browser/editor-frontend-module.d.ts +5 -5
- package/lib/browser/editor-frontend-module.js +74 -74
- package/lib/browser/editor-generated-preference-schema.d.ts +282 -249
- package/lib/browser/editor-generated-preference-schema.d.ts.map +1 -1
- package/lib/browser/editor-generated-preference-schema.js +2451 -2316
- package/lib/browser/editor-generated-preference-schema.js.map +1 -1
- package/lib/browser/editor-keybinding.d.ts +5 -5
- package/lib/browser/editor-keybinding.js +55 -55
- package/lib/browser/editor-linenumber-contribution.d.ts +15 -15
- package/lib/browser/editor-linenumber-contribution.d.ts.map +1 -1
- package/lib/browser/editor-linenumber-contribution.js +95 -96
- package/lib/browser/editor-linenumber-contribution.js.map +1 -1
- package/lib/browser/editor-manager.d.ts +115 -115
- package/lib/browser/editor-manager.js +428 -428
- package/lib/browser/editor-menu.d.ts +48 -48
- package/lib/browser/editor-menu.js +210 -210
- package/lib/browser/editor-navigation-contribution.d.ts +67 -67
- package/lib/browser/editor-navigation-contribution.js +343 -343
- package/lib/browser/editor-preferences.d.ts +41 -41
- package/lib/browser/editor-preferences.js +176 -176
- package/lib/browser/editor-variable-contribution.d.ts +8 -8
- package/lib/browser/editor-variable-contribution.js +64 -64
- package/lib/browser/editor-widget-factory.d.ts +17 -17
- package/lib/browser/editor-widget-factory.js +91 -91
- package/lib/browser/editor-widget.d.ts +24 -24
- package/lib/browser/editor-widget.d.ts.map +1 -1
- package/lib/browser/editor-widget.js +122 -114
- package/lib/browser/editor-widget.js.map +1 -1
- package/lib/browser/editor.d.ts +295 -293
- package/lib/browser/editor.d.ts.map +1 -1
- package/lib/browser/editor.js +103 -103
- package/lib/browser/editor.js.map +1 -1
- package/lib/browser/index.d.ts +10 -10
- package/lib/browser/index.js +37 -37
- package/lib/browser/language-status/editor-language-status-service.d.ts +77 -77
- package/lib/browser/language-status/editor-language-status-service.js +251 -251
- package/lib/browser/navigation/navigation-location-service.d.ts +103 -103
- package/lib/browser/navigation/navigation-location-service.js +281 -281
- package/lib/browser/navigation/navigation-location-service.spec.d.ts +1 -1
- package/lib/browser/navigation/navigation-location-service.spec.js +184 -184
- package/lib/browser/navigation/navigation-location-similarity.d.ts +15 -15
- package/lib/browser/navigation/navigation-location-similarity.js +62 -62
- package/lib/browser/navigation/navigation-location-similarity.spec.d.ts +1 -1
- package/lib/browser/navigation/navigation-location-similarity.spec.js +32 -32
- package/lib/browser/navigation/navigation-location-updater.d.ts +35 -35
- package/lib/browser/navigation/navigation-location-updater.js +210 -210
- package/lib/browser/navigation/navigation-location-updater.spec.d.ts +1 -1
- package/lib/browser/navigation/navigation-location-updater.spec.js +177 -177
- package/lib/browser/navigation/navigation-location.d.ts +191 -191
- package/lib/browser/navigation/navigation-location.js +300 -300
- package/lib/browser/navigation/test/mock-navigation-location-updater.d.ts +15 -15
- package/lib/browser/navigation/test/mock-navigation-location-updater.js +38 -38
- package/lib/browser/quick-editor-service.d.ts +16 -16
- package/lib/browser/quick-editor-service.js +109 -109
- package/lib/browser/undo-redo-service.d.ts +23 -23
- package/lib/browser/undo-redo-service.js +110 -110
- package/lib/common/language-selector.d.ts +13 -13
- package/lib/common/language-selector.js +90 -90
- package/lib/package.spec.js +25 -25
- package/package.json +5 -5
- package/src/browser/decorations/editor-decoration-style.ts +41 -41
- package/src/browser/decorations/editor-decoration.ts +127 -127
- package/src/browser/decorations/editor-decorator.ts +36 -36
- package/src/browser/decorations/index.ts +19 -19
- package/src/browser/diff-navigator.ts +27 -28
- package/src/browser/editor-command.ts +414 -414
- package/src/browser/editor-contribution.ts +185 -185
- package/src/browser/editor-frontend-module.ts +87 -87
- package/src/browser/editor-generated-preference-schema.ts +2707 -2539
- package/src/browser/editor-keybinding.ts +55 -55
- package/src/browser/editor-linenumber-contribution.ts +88 -89
- package/src/browser/editor-manager.ts +442 -442
- package/src/browser/editor-menu.ts +224 -224
- package/src/browser/editor-navigation-contribution.ts +343 -343
- package/src/browser/editor-preferences.ts +226 -226
- package/src/browser/editor-variable-contribution.ts +54 -54
- package/src/browser/editor-widget-factory.ts +82 -82
- package/src/browser/editor-widget.ts +137 -130
- package/src/browser/editor.ts +360 -358
- package/src/browser/index.ts +26 -26
- package/src/browser/language-status/editor-language-status-service.ts +271 -271
- package/src/browser/language-status/editor-language-status.css +101 -101
- package/src/browser/navigation/navigation-location-service.spec.ts +245 -245
- package/src/browser/navigation/navigation-location-service.ts +284 -284
- package/src/browser/navigation/navigation-location-similarity.spec.ts +46 -46
- package/src/browser/navigation/navigation-location-similarity.ts +58 -58
- package/src/browser/navigation/navigation-location-updater.spec.ts +197 -197
- package/src/browser/navigation/navigation-location-updater.ts +220 -220
- package/src/browser/navigation/navigation-location.ts +418 -418
- package/src/browser/navigation/test/mock-navigation-location-updater.ts +41 -41
- package/src/browser/quick-editor-service.ts +94 -94
- package/src/browser/style/index.css +19 -19
- package/src/browser/undo-redo-service.ts +120 -120
- package/src/common/language-selector.ts +104 -104
- package/src/package.spec.ts +28 -28
|
@@ -1,224 +1,224 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
-
import { MenuContribution, MenuModelRegistry, MenuPath, MAIN_MENU_BAR } from '@theia/core';
|
|
19
|
-
import { CommonCommands, CommonMenus } from '@theia/core/lib/browser';
|
|
20
|
-
import { EditorCommands } from './editor-command';
|
|
21
|
-
import { nls } from '@theia/core/lib/common/nls';
|
|
22
|
-
|
|
23
|
-
export const EDITOR_CONTEXT_MENU: MenuPath = ['editor_context_menu'];
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Editor context menu default groups should be aligned
|
|
27
|
-
* with VS Code default groups: https://code.visualstudio.com/api/references/contribution-points#contributes.menus
|
|
28
|
-
*/
|
|
29
|
-
export namespace EditorContextMenu {
|
|
30
|
-
export const NAVIGATION = [...EDITOR_CONTEXT_MENU, 'navigation'];
|
|
31
|
-
export const MODIFICATION = [...EDITOR_CONTEXT_MENU, '1_modification'];
|
|
32
|
-
export const CUT_COPY_PASTE = [...EDITOR_CONTEXT_MENU, '9_cutcopypaste'];
|
|
33
|
-
export const COMMANDS = [...EDITOR_CONTEXT_MENU, 'z_commands'];
|
|
34
|
-
export const UNDO_REDO = [...EDITOR_CONTEXT_MENU, '1_undo'];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export namespace EditorMainMenu {
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* The main `Go` menu item.
|
|
41
|
-
*/
|
|
42
|
-
export const GO = [...MAIN_MENU_BAR, '5_go'];
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Navigation menu group in the `Go` main-menu.
|
|
46
|
-
*/
|
|
47
|
-
export const NAVIGATION_GROUP = [...GO, '1_navigation_group'];
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Context management group in the `Go` main menu: Pane and editor switching commands.
|
|
51
|
-
*/
|
|
52
|
-
export const CONTEXT_GROUP = [...GO, '1.1_context_group'];
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Submenu for switching panes in the main area.
|
|
56
|
-
*/
|
|
57
|
-
export const PANE_GROUP = [...CONTEXT_GROUP, '2_pane_group'];
|
|
58
|
-
export const BY_NUMBER = [...EditorMainMenu.PANE_GROUP, '1_by_number'];
|
|
59
|
-
export const NEXT_PREVIOUS = [...EditorMainMenu.PANE_GROUP, '2_by_location'];
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Workspace menu group in the `Go` main-menu.
|
|
63
|
-
*/
|
|
64
|
-
export const WORKSPACE_GROUP = [...GO, '2_workspace_group'];
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Language features menu group in the `Go` main-menu.
|
|
68
|
-
*/
|
|
69
|
-
export const LANGUAGE_FEATURES_GROUP = [...GO, '3_language_features_group'];
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Location menu group in the `Go` main-menu.
|
|
73
|
-
*/
|
|
74
|
-
export const LOCATION_GROUP = [...GO, '4_locations'];
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
@injectable()
|
|
79
|
-
export class EditorMenuContribution implements MenuContribution {
|
|
80
|
-
|
|
81
|
-
registerMenus(registry: MenuModelRegistry): void {
|
|
82
|
-
registry.registerMenuAction(EditorContextMenu.UNDO_REDO, {
|
|
83
|
-
commandId: CommonCommands.UNDO.id
|
|
84
|
-
});
|
|
85
|
-
registry.registerMenuAction(EditorContextMenu.UNDO_REDO, {
|
|
86
|
-
commandId: CommonCommands.REDO.id
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
registry.registerMenuAction(EditorContextMenu.CUT_COPY_PASTE, {
|
|
90
|
-
commandId: CommonCommands.CUT.id,
|
|
91
|
-
order: '0'
|
|
92
|
-
});
|
|
93
|
-
registry.registerMenuAction(EditorContextMenu.CUT_COPY_PASTE, {
|
|
94
|
-
commandId: CommonCommands.COPY.id,
|
|
95
|
-
order: '1'
|
|
96
|
-
});
|
|
97
|
-
registry.registerMenuAction(EditorContextMenu.CUT_COPY_PASTE, {
|
|
98
|
-
commandId: CommonCommands.PASTE.id,
|
|
99
|
-
order: '2'
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
// Editor navigation. Go > Back and Go > Forward.
|
|
103
|
-
registry.registerSubmenu(EditorMainMenu.GO, nls.localizeByDefault('Go'));
|
|
104
|
-
registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, {
|
|
105
|
-
commandId: EditorCommands.GO_BACK.id,
|
|
106
|
-
label: EditorCommands.GO_BACK.label,
|
|
107
|
-
order: '1'
|
|
108
|
-
});
|
|
109
|
-
registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, {
|
|
110
|
-
commandId: EditorCommands.GO_FORWARD.id,
|
|
111
|
-
label: EditorCommands.GO_FORWARD.label,
|
|
112
|
-
order: '2'
|
|
113
|
-
});
|
|
114
|
-
registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, {
|
|
115
|
-
commandId: EditorCommands.GO_LAST_EDIT.id,
|
|
116
|
-
label: nls.localizeByDefault('Last Edit Location'),
|
|
117
|
-
order: '3'
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
registry.registerSubmenu(EditorMainMenu.PANE_GROUP, nls.localizeByDefault('Switch Group'));
|
|
121
|
-
|
|
122
|
-
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
123
|
-
commandId: 'workbench.action.focusFirstEditorGroup',
|
|
124
|
-
label: nls.localizeByDefault('Group 1'),
|
|
125
|
-
});
|
|
126
|
-
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
127
|
-
commandId: 'workbench.action.focusSecondEditorGroup',
|
|
128
|
-
label: nls.localizeByDefault('Group 2'),
|
|
129
|
-
});
|
|
130
|
-
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
131
|
-
commandId: 'workbench.action.focusThirdEditorGroup',
|
|
132
|
-
label: nls.localizeByDefault('Group 3'),
|
|
133
|
-
});
|
|
134
|
-
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
135
|
-
commandId: 'workbench.action.focusFourthEditorGroup',
|
|
136
|
-
label: nls.localizeByDefault('Group 4'),
|
|
137
|
-
});
|
|
138
|
-
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
139
|
-
commandId: 'workbench.action.focusFifthEditorGroup',
|
|
140
|
-
label: nls.localizeByDefault('Group 5'),
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
registry.registerMenuAction(EditorMainMenu.NEXT_PREVIOUS, {
|
|
144
|
-
commandId: CommonCommands.NEXT_TAB_GROUP.id,
|
|
145
|
-
label: nls.localizeByDefault('Next Group'),
|
|
146
|
-
order: '1'
|
|
147
|
-
});
|
|
148
|
-
registry.registerMenuAction(EditorMainMenu.NEXT_PREVIOUS, {
|
|
149
|
-
commandId: CommonCommands.PREVIOUS_TAB_GROUP.id,
|
|
150
|
-
label: nls.localizeByDefault('Previous Group'),
|
|
151
|
-
order: '2'
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
registry.registerMenuAction(EditorMainMenu.LOCATION_GROUP, {
|
|
155
|
-
commandId: EditorCommands.GOTO_LINE_COLUMN.id,
|
|
156
|
-
order: '1'
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
// Toggle Commands.
|
|
160
|
-
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
161
|
-
commandId: EditorCommands.TOGGLE_WORD_WRAP.id,
|
|
162
|
-
order: '0'
|
|
163
|
-
});
|
|
164
|
-
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
165
|
-
commandId: EditorCommands.TOGGLE_MINIMAP.id,
|
|
166
|
-
order: '1',
|
|
167
|
-
});
|
|
168
|
-
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
169
|
-
commandId: CommonCommands.TOGGLE_BREADCRUMBS.id,
|
|
170
|
-
order: '2',
|
|
171
|
-
});
|
|
172
|
-
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
173
|
-
commandId: EditorCommands.TOGGLE_RENDER_WHITESPACE.id,
|
|
174
|
-
order: '3'
|
|
175
|
-
});
|
|
176
|
-
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
177
|
-
commandId: EditorCommands.TOGGLE_STICKY_SCROLL.id,
|
|
178
|
-
order: '4'
|
|
179
|
-
});
|
|
180
|
-
registry.registerMenuAction(CommonMenus.FILE_CLOSE, {
|
|
181
|
-
commandId: CommonCommands.CLOSE_MAIN_TAB.id,
|
|
182
|
-
label: nls.localizeByDefault('Close Editor'),
|
|
183
|
-
order: '1'
|
|
184
|
-
});
|
|
185
|
-
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_SPLIT, {
|
|
186
|
-
commandId: EditorCommands.SPLIT_EDITOR_RIGHT.id,
|
|
187
|
-
label: nls.localizeByDefault('Split Editor Right'),
|
|
188
|
-
order: '0'
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_SPLIT, {
|
|
192
|
-
commandId: EditorCommands.SPLIT_EDITOR_LEFT.id,
|
|
193
|
-
label: nls.localizeByDefault('Split Editor Left'),
|
|
194
|
-
order: '1'
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_SPLIT, {
|
|
198
|
-
commandId: EditorCommands.SPLIT_EDITOR_UP.id,
|
|
199
|
-
label: nls.localizeByDefault('Split Editor Up'),
|
|
200
|
-
order: '2'
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_SPLIT, {
|
|
204
|
-
commandId: EditorCommands.SPLIT_EDITOR_DOWN.id,
|
|
205
|
-
label: nls.localizeByDefault('Split Editor Down'),
|
|
206
|
-
order: '3'
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_ORTHO, {
|
|
210
|
-
commandId: EditorCommands.SPLIT_EDITOR_HORIZONTAL.id,
|
|
211
|
-
label: nls.localize('theia/editor/splitHorizontal', 'Split Editor Horizontal'),
|
|
212
|
-
order: '1'
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_ORTHO, {
|
|
216
|
-
commandId: EditorCommands.SPLIT_EDITOR_VERTICAL.id,
|
|
217
|
-
label: nls.localize('theia/editor/splitVertical', 'Split Editor Vertical'),
|
|
218
|
-
order: '2'
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
registry.registerSubmenu(CommonMenus.VIEW_EDITOR_SUBMENU, nls.localizeByDefault('Editor Layout'));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { MenuContribution, MenuModelRegistry, MenuPath, MAIN_MENU_BAR } from '@theia/core';
|
|
19
|
+
import { CommonCommands, CommonMenus } from '@theia/core/lib/browser';
|
|
20
|
+
import { EditorCommands } from './editor-command';
|
|
21
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
22
|
+
|
|
23
|
+
export const EDITOR_CONTEXT_MENU: MenuPath = ['editor_context_menu'];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Editor context menu default groups should be aligned
|
|
27
|
+
* with VS Code default groups: https://code.visualstudio.com/api/references/contribution-points#contributes.menus
|
|
28
|
+
*/
|
|
29
|
+
export namespace EditorContextMenu {
|
|
30
|
+
export const NAVIGATION = [...EDITOR_CONTEXT_MENU, 'navigation'];
|
|
31
|
+
export const MODIFICATION = [...EDITOR_CONTEXT_MENU, '1_modification'];
|
|
32
|
+
export const CUT_COPY_PASTE = [...EDITOR_CONTEXT_MENU, '9_cutcopypaste'];
|
|
33
|
+
export const COMMANDS = [...EDITOR_CONTEXT_MENU, 'z_commands'];
|
|
34
|
+
export const UNDO_REDO = [...EDITOR_CONTEXT_MENU, '1_undo'];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export namespace EditorMainMenu {
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The main `Go` menu item.
|
|
41
|
+
*/
|
|
42
|
+
export const GO = [...MAIN_MENU_BAR, '5_go'];
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Navigation menu group in the `Go` main-menu.
|
|
46
|
+
*/
|
|
47
|
+
export const NAVIGATION_GROUP = [...GO, '1_navigation_group'];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Context management group in the `Go` main menu: Pane and editor switching commands.
|
|
51
|
+
*/
|
|
52
|
+
export const CONTEXT_GROUP = [...GO, '1.1_context_group'];
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Submenu for switching panes in the main area.
|
|
56
|
+
*/
|
|
57
|
+
export const PANE_GROUP = [...CONTEXT_GROUP, '2_pane_group'];
|
|
58
|
+
export const BY_NUMBER = [...EditorMainMenu.PANE_GROUP, '1_by_number'];
|
|
59
|
+
export const NEXT_PREVIOUS = [...EditorMainMenu.PANE_GROUP, '2_by_location'];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Workspace menu group in the `Go` main-menu.
|
|
63
|
+
*/
|
|
64
|
+
export const WORKSPACE_GROUP = [...GO, '2_workspace_group'];
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Language features menu group in the `Go` main-menu.
|
|
68
|
+
*/
|
|
69
|
+
export const LANGUAGE_FEATURES_GROUP = [...GO, '3_language_features_group'];
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Location menu group in the `Go` main-menu.
|
|
73
|
+
*/
|
|
74
|
+
export const LOCATION_GROUP = [...GO, '4_locations'];
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@injectable()
|
|
79
|
+
export class EditorMenuContribution implements MenuContribution {
|
|
80
|
+
|
|
81
|
+
registerMenus(registry: MenuModelRegistry): void {
|
|
82
|
+
registry.registerMenuAction(EditorContextMenu.UNDO_REDO, {
|
|
83
|
+
commandId: CommonCommands.UNDO.id
|
|
84
|
+
});
|
|
85
|
+
registry.registerMenuAction(EditorContextMenu.UNDO_REDO, {
|
|
86
|
+
commandId: CommonCommands.REDO.id
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
registry.registerMenuAction(EditorContextMenu.CUT_COPY_PASTE, {
|
|
90
|
+
commandId: CommonCommands.CUT.id,
|
|
91
|
+
order: '0'
|
|
92
|
+
});
|
|
93
|
+
registry.registerMenuAction(EditorContextMenu.CUT_COPY_PASTE, {
|
|
94
|
+
commandId: CommonCommands.COPY.id,
|
|
95
|
+
order: '1'
|
|
96
|
+
});
|
|
97
|
+
registry.registerMenuAction(EditorContextMenu.CUT_COPY_PASTE, {
|
|
98
|
+
commandId: CommonCommands.PASTE.id,
|
|
99
|
+
order: '2'
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// Editor navigation. Go > Back and Go > Forward.
|
|
103
|
+
registry.registerSubmenu(EditorMainMenu.GO, nls.localizeByDefault('Go'));
|
|
104
|
+
registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, {
|
|
105
|
+
commandId: EditorCommands.GO_BACK.id,
|
|
106
|
+
label: EditorCommands.GO_BACK.label,
|
|
107
|
+
order: '1'
|
|
108
|
+
});
|
|
109
|
+
registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, {
|
|
110
|
+
commandId: EditorCommands.GO_FORWARD.id,
|
|
111
|
+
label: EditorCommands.GO_FORWARD.label,
|
|
112
|
+
order: '2'
|
|
113
|
+
});
|
|
114
|
+
registry.registerMenuAction(EditorMainMenu.NAVIGATION_GROUP, {
|
|
115
|
+
commandId: EditorCommands.GO_LAST_EDIT.id,
|
|
116
|
+
label: nls.localizeByDefault('Last Edit Location'),
|
|
117
|
+
order: '3'
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
registry.registerSubmenu(EditorMainMenu.PANE_GROUP, nls.localizeByDefault('Switch Group'));
|
|
121
|
+
|
|
122
|
+
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
123
|
+
commandId: 'workbench.action.focusFirstEditorGroup',
|
|
124
|
+
label: nls.localizeByDefault('Group 1'),
|
|
125
|
+
});
|
|
126
|
+
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
127
|
+
commandId: 'workbench.action.focusSecondEditorGroup',
|
|
128
|
+
label: nls.localizeByDefault('Group 2'),
|
|
129
|
+
});
|
|
130
|
+
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
131
|
+
commandId: 'workbench.action.focusThirdEditorGroup',
|
|
132
|
+
label: nls.localizeByDefault('Group 3'),
|
|
133
|
+
});
|
|
134
|
+
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
135
|
+
commandId: 'workbench.action.focusFourthEditorGroup',
|
|
136
|
+
label: nls.localizeByDefault('Group 4'),
|
|
137
|
+
});
|
|
138
|
+
registry.registerMenuAction(EditorMainMenu.BY_NUMBER, {
|
|
139
|
+
commandId: 'workbench.action.focusFifthEditorGroup',
|
|
140
|
+
label: nls.localizeByDefault('Group 5'),
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
registry.registerMenuAction(EditorMainMenu.NEXT_PREVIOUS, {
|
|
144
|
+
commandId: CommonCommands.NEXT_TAB_GROUP.id,
|
|
145
|
+
label: nls.localizeByDefault('Next Group'),
|
|
146
|
+
order: '1'
|
|
147
|
+
});
|
|
148
|
+
registry.registerMenuAction(EditorMainMenu.NEXT_PREVIOUS, {
|
|
149
|
+
commandId: CommonCommands.PREVIOUS_TAB_GROUP.id,
|
|
150
|
+
label: nls.localizeByDefault('Previous Group'),
|
|
151
|
+
order: '2'
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
registry.registerMenuAction(EditorMainMenu.LOCATION_GROUP, {
|
|
155
|
+
commandId: EditorCommands.GOTO_LINE_COLUMN.id,
|
|
156
|
+
order: '1'
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// Toggle Commands.
|
|
160
|
+
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
161
|
+
commandId: EditorCommands.TOGGLE_WORD_WRAP.id,
|
|
162
|
+
order: '0'
|
|
163
|
+
});
|
|
164
|
+
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
165
|
+
commandId: EditorCommands.TOGGLE_MINIMAP.id,
|
|
166
|
+
order: '1',
|
|
167
|
+
});
|
|
168
|
+
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
169
|
+
commandId: CommonCommands.TOGGLE_BREADCRUMBS.id,
|
|
170
|
+
order: '2',
|
|
171
|
+
});
|
|
172
|
+
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
173
|
+
commandId: EditorCommands.TOGGLE_RENDER_WHITESPACE.id,
|
|
174
|
+
order: '3'
|
|
175
|
+
});
|
|
176
|
+
registry.registerMenuAction(CommonMenus.VIEW_TOGGLE, {
|
|
177
|
+
commandId: EditorCommands.TOGGLE_STICKY_SCROLL.id,
|
|
178
|
+
order: '4'
|
|
179
|
+
});
|
|
180
|
+
registry.registerMenuAction(CommonMenus.FILE_CLOSE, {
|
|
181
|
+
commandId: CommonCommands.CLOSE_MAIN_TAB.id,
|
|
182
|
+
label: nls.localizeByDefault('Close Editor'),
|
|
183
|
+
order: '1'
|
|
184
|
+
});
|
|
185
|
+
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_SPLIT, {
|
|
186
|
+
commandId: EditorCommands.SPLIT_EDITOR_RIGHT.id,
|
|
187
|
+
label: nls.localizeByDefault('Split Editor Right'),
|
|
188
|
+
order: '0'
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_SPLIT, {
|
|
192
|
+
commandId: EditorCommands.SPLIT_EDITOR_LEFT.id,
|
|
193
|
+
label: nls.localizeByDefault('Split Editor Left'),
|
|
194
|
+
order: '1'
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_SPLIT, {
|
|
198
|
+
commandId: EditorCommands.SPLIT_EDITOR_UP.id,
|
|
199
|
+
label: nls.localizeByDefault('Split Editor Up'),
|
|
200
|
+
order: '2'
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_SPLIT, {
|
|
204
|
+
commandId: EditorCommands.SPLIT_EDITOR_DOWN.id,
|
|
205
|
+
label: nls.localizeByDefault('Split Editor Down'),
|
|
206
|
+
order: '3'
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_ORTHO, {
|
|
210
|
+
commandId: EditorCommands.SPLIT_EDITOR_HORIZONTAL.id,
|
|
211
|
+
label: nls.localize('theia/editor/splitHorizontal', 'Split Editor Horizontal'),
|
|
212
|
+
order: '1'
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
registry.registerMenuAction(CommonMenus.VIEW_EDITOR_SUBMENU_ORTHO, {
|
|
216
|
+
commandId: EditorCommands.SPLIT_EDITOR_VERTICAL.id,
|
|
217
|
+
label: nls.localize('theia/editor/splitVertical', 'Split Editor Vertical'),
|
|
218
|
+
order: '2'
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
registry.registerSubmenu(CommonMenus.VIEW_EDITOR_SUBMENU, nls.localizeByDefault('Editor Layout'));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
}
|