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