@codingame/monaco-vscode-keybindings-service-override 4.0.0 → 4.1.0

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 (63) hide show
  1. package/keybindings.js +6 -6
  2. package/package.json +9 -9
  3. package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +0 -50
  4. package/vscode/src/vs/platform/keyboardLayout/common/keyboardMapper.js +0 -24
  5. package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js +0 -146
  6. package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +0 -29
  7. package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js +0 -250
  8. package/vscode/src/vs/workbench/contrib/preferences/common/smartSnippetInserter.js +0 -126
  9. package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +0 -1597
  10. package/vscode/src/vs/workbench/services/commands/common/commandService.js +0 -79
  11. package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +0 -947
  12. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +0 -502
  13. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js +0 -14
  14. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.js +0 -163
  15. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.js +0 -163
  16. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.js +0 -126
  17. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.js +0 -181
  18. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.js +0 -163
  19. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.js +0 -163
  20. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.js +0 -126
  21. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.js +0 -163
  22. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.js +0 -126
  23. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.js +0 -163
  24. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.js +0 -126
  25. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.js +0 -163
  26. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.js +0 -126
  27. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.js +0 -163
  28. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.js +0 -134
  29. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.js +0 -183
  30. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.js +0 -168
  31. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.js +0 -163
  32. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.js +0 -126
  33. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.js +0 -181
  34. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.js +0 -163
  35. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.js +0 -126
  36. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.js +0 -181
  37. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.js +0 -163
  38. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.js +0 -163
  39. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.js +0 -126
  40. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.js +0 -163
  41. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.js +0 -126
  42. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.js +0 -126
  43. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.js +0 -126
  44. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.js +0 -17
  45. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.js +0 -6
  46. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.js +0 -23
  47. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.js +0 -163
  48. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.js +0 -126
  49. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.js +0 -163
  50. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.js +0 -163
  51. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.js +0 -126
  52. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.js +0 -163
  53. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.js +0 -126
  54. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.js +0 -181
  55. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.js +0 -163
  56. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.js +0 -165
  57. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.js +0 -163
  58. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.js +0 -163
  59. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.js +0 -126
  60. package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.js +0 -74
  61. package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.js +0 -110
  62. package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +0 -888
  63. package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +0 -352
@@ -1,1597 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { localizeWithPath } from 'vscode/vscode/vs/nls';
3
- import { isFalsyOrWhitespace } from 'vscode/vscode/vs/base/common/strings';
4
- import { joinPath } from 'vscode/vscode/vs/base/common/resources';
5
- import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
6
- import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
7
- import { MenuId, MenuRegistry } from 'vscode/vscode/vs/platform/actions/common/actions';
8
- import { DisposableStore, Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
9
- import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
10
- import { index } from 'vscode/vscode/vs/base/common/arrays';
11
- import { isProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
12
- import { Extensions } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures';
13
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
14
- import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
15
- import { platform } from 'vscode/vscode/vs/base/common/process';
16
- import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
17
- import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
18
-
19
- const apiMenus = [
20
- {
21
- key: 'commandPalette',
22
- id: MenuId.CommandPalette,
23
- description: ( localizeWithPath(
24
- 'vs/workbench/services/actions/common/menusExtensionPoint',
25
- 'menus.commandPalette',
26
- "The Command Palette"
27
- )),
28
- supportsSubmenus: false
29
- },
30
- {
31
- key: 'touchBar',
32
- id: MenuId.TouchBarContext,
33
- description: ( localizeWithPath(
34
- 'vs/workbench/services/actions/common/menusExtensionPoint',
35
- 'menus.touchBar',
36
- "The touch bar (macOS only)"
37
- )),
38
- supportsSubmenus: false
39
- },
40
- {
41
- key: 'editor/title',
42
- id: MenuId.EditorTitle,
43
- description: ( localizeWithPath(
44
- 'vs/workbench/services/actions/common/menusExtensionPoint',
45
- 'menus.editorTitle',
46
- "The editor title menu"
47
- ))
48
- },
49
- {
50
- key: 'editor/title/run',
51
- id: MenuId.EditorTitleRun,
52
- description: ( localizeWithPath(
53
- 'vs/workbench/services/actions/common/menusExtensionPoint',
54
- 'menus.editorTitleRun',
55
- "Run submenu inside the editor title menu"
56
- ))
57
- },
58
- {
59
- key: 'editor/context',
60
- id: MenuId.EditorContext,
61
- description: ( localizeWithPath(
62
- 'vs/workbench/services/actions/common/menusExtensionPoint',
63
- 'menus.editorContext',
64
- "The editor context menu"
65
- ))
66
- },
67
- {
68
- key: 'editor/context/copy',
69
- id: MenuId.EditorContextCopy,
70
- description: ( localizeWithPath(
71
- 'vs/workbench/services/actions/common/menusExtensionPoint',
72
- 'menus.editorContextCopyAs',
73
- "'Copy as' submenu in the editor context menu"
74
- ))
75
- },
76
- {
77
- key: 'editor/context/share',
78
- id: MenuId.EditorContextShare,
79
- description: ( localizeWithPath(
80
- 'vs/workbench/services/actions/common/menusExtensionPoint',
81
- 'menus.editorContextShare',
82
- "'Share' submenu in the editor context menu"
83
- )),
84
- proposed: 'contribShareMenu'
85
- },
86
- {
87
- key: 'explorer/context',
88
- id: MenuId.ExplorerContext,
89
- description: ( localizeWithPath(
90
- 'vs/workbench/services/actions/common/menusExtensionPoint',
91
- 'menus.explorerContext',
92
- "The file explorer context menu"
93
- ))
94
- },
95
- {
96
- key: 'explorer/context/share',
97
- id: MenuId.ExplorerContextShare,
98
- description: ( localizeWithPath(
99
- 'vs/workbench/services/actions/common/menusExtensionPoint',
100
- 'menus.explorerContextShare',
101
- "'Share' submenu in the file explorer context menu"
102
- )),
103
- proposed: 'contribShareMenu'
104
- },
105
- {
106
- key: 'editor/title/context',
107
- id: MenuId.EditorTitleContext,
108
- description: ( localizeWithPath(
109
- 'vs/workbench/services/actions/common/menusExtensionPoint',
110
- 'menus.editorTabContext',
111
- "The editor tabs context menu"
112
- ))
113
- },
114
- {
115
- key: 'editor/title/context/share',
116
- id: MenuId.EditorTitleContextShare,
117
- description: ( localizeWithPath(
118
- 'vs/workbench/services/actions/common/menusExtensionPoint',
119
- 'menus.editorTitleContextShare',
120
- "'Share' submenu inside the editor title context menu"
121
- )),
122
- proposed: 'contribShareMenu'
123
- },
124
- {
125
- key: 'debug/callstack/context',
126
- id: MenuId.DebugCallStackContext,
127
- description: ( localizeWithPath(
128
- 'vs/workbench/services/actions/common/menusExtensionPoint',
129
- 'menus.debugCallstackContext',
130
- "The debug callstack view context menu"
131
- ))
132
- },
133
- {
134
- key: 'debug/variables/context',
135
- id: MenuId.DebugVariablesContext,
136
- description: ( localizeWithPath(
137
- 'vs/workbench/services/actions/common/menusExtensionPoint',
138
- 'menus.debugVariablesContext',
139
- "The debug variables view context menu"
140
- ))
141
- },
142
- {
143
- key: 'debug/toolBar',
144
- id: MenuId.DebugToolBar,
145
- description: ( localizeWithPath(
146
- 'vs/workbench/services/actions/common/menusExtensionPoint',
147
- 'menus.debugToolBar',
148
- "The debug toolbar menu"
149
- ))
150
- },
151
- {
152
- key: 'notebook/variables/context',
153
- id: MenuId.NotebookVariablesContext,
154
- description: ( localizeWithPath(
155
- 'vs/workbench/services/actions/common/menusExtensionPoint',
156
- 'menus.notebookVariablesContext',
157
- "The notebook variables view context menu"
158
- ))
159
- },
160
- {
161
- key: 'menuBar/home',
162
- id: MenuId.MenubarHomeMenu,
163
- description: ( localizeWithPath(
164
- 'vs/workbench/services/actions/common/menusExtensionPoint',
165
- 'menus.home',
166
- "The home indicator context menu (web only)"
167
- )),
168
- proposed: 'contribMenuBarHome',
169
- supportsSubmenus: false
170
- },
171
- {
172
- key: 'menuBar/edit/copy',
173
- id: MenuId.MenubarCopy,
174
- description: ( localizeWithPath(
175
- 'vs/workbench/services/actions/common/menusExtensionPoint',
176
- 'menus.opy',
177
- "'Copy as' submenu in the top level Edit menu"
178
- ))
179
- },
180
- {
181
- key: 'scm/title',
182
- id: MenuId.SCMTitle,
183
- description: ( localizeWithPath(
184
- 'vs/workbench/services/actions/common/menusExtensionPoint',
185
- 'menus.scmTitle',
186
- "The Source Control title menu"
187
- ))
188
- },
189
- {
190
- key: 'scm/sourceControl',
191
- id: MenuId.SCMSourceControl,
192
- description: ( localizeWithPath(
193
- 'vs/workbench/services/actions/common/menusExtensionPoint',
194
- 'menus.scmSourceControl',
195
- "The Source Control menu"
196
- ))
197
- },
198
- {
199
- key: 'scm/sourceControl/title',
200
- id: MenuId.SCMSourceControlTitle,
201
- description: ( localizeWithPath(
202
- 'vs/workbench/services/actions/common/menusExtensionPoint',
203
- 'menus.scmSourceControlTitle',
204
- "The Source Control title menu"
205
- )),
206
- proposed: 'contribSourceControlTitleMenu'
207
- },
208
- {
209
- key: 'scm/resourceState/context',
210
- id: MenuId.SCMResourceContext,
211
- description: ( localizeWithPath(
212
- 'vs/workbench/services/actions/common/menusExtensionPoint',
213
- 'menus.resourceStateContext',
214
- "The Source Control resource state context menu"
215
- ))
216
- },
217
- {
218
- key: 'scm/resourceFolder/context',
219
- id: MenuId.SCMResourceFolderContext,
220
- description: ( localizeWithPath(
221
- 'vs/workbench/services/actions/common/menusExtensionPoint',
222
- 'menus.resourceFolderContext',
223
- "The Source Control resource folder context menu"
224
- ))
225
- },
226
- {
227
- key: 'scm/resourceGroup/context',
228
- id: MenuId.SCMResourceGroupContext,
229
- description: ( localizeWithPath(
230
- 'vs/workbench/services/actions/common/menusExtensionPoint',
231
- 'menus.resourceGroupContext',
232
- "The Source Control resource group context menu"
233
- ))
234
- },
235
- {
236
- key: 'scm/change/title',
237
- id: MenuId.SCMChangeContext,
238
- description: ( localizeWithPath(
239
- 'vs/workbench/services/actions/common/menusExtensionPoint',
240
- 'menus.changeTitle',
241
- "The Source Control inline change menu"
242
- ))
243
- },
244
- {
245
- key: 'scm/inputBox',
246
- id: MenuId.SCMInputBox,
247
- description: ( localizeWithPath(
248
- 'vs/workbench/services/actions/common/menusExtensionPoint',
249
- 'menus.input',
250
- "The Source Control input box menu"
251
- )),
252
- proposed: 'contribSourceControlInputBoxMenu'
253
- },
254
- {
255
- key: 'scm/incomingChanges',
256
- id: MenuId.SCMIncomingChanges,
257
- description: ( localizeWithPath(
258
- 'vs/workbench/services/actions/common/menusExtensionPoint',
259
- 'menus.incomingChanges',
260
- "The Source Control incoming changes menu"
261
- )),
262
- proposed: 'contribSourceControlHistoryItemGroupMenu'
263
- },
264
- {
265
- key: 'scm/incomingChanges/context',
266
- id: MenuId.SCMIncomingChangesContext,
267
- description: ( localizeWithPath(
268
- 'vs/workbench/services/actions/common/menusExtensionPoint',
269
- 'menus.incomingChangesContext',
270
- "The Source Control incoming changes context menu"
271
- )),
272
- proposed: 'contribSourceControlHistoryItemGroupMenu'
273
- },
274
- {
275
- key: 'scm/outgoingChanges',
276
- id: MenuId.SCMOutgoingChanges,
277
- description: ( localizeWithPath(
278
- 'vs/workbench/services/actions/common/menusExtensionPoint',
279
- 'menus.outgoingChanges',
280
- "The Source Control outgoing changes menu"
281
- )),
282
- proposed: 'contribSourceControlHistoryItemGroupMenu'
283
- },
284
- {
285
- key: 'scm/outgoingChanges/context',
286
- id: MenuId.SCMOutgoingChangesContext,
287
- description: ( localizeWithPath(
288
- 'vs/workbench/services/actions/common/menusExtensionPoint',
289
- 'menus.outgoingChangesContext',
290
- "The Source Control outgoing changes context menu"
291
- )),
292
- proposed: 'contribSourceControlHistoryItemGroupMenu'
293
- },
294
- {
295
- key: 'scm/incomingChanges/allChanges/context',
296
- id: MenuId.SCMIncomingChangesAllChangesContext,
297
- description: ( localizeWithPath(
298
- 'vs/workbench/services/actions/common/menusExtensionPoint',
299
- 'menus.incomingChangesAllChangesContext',
300
- "The Source Control all incoming changes context menu"
301
- )),
302
- proposed: 'contribSourceControlHistoryItemMenu'
303
- },
304
- {
305
- key: 'scm/incomingChanges/historyItem/context',
306
- id: MenuId.SCMIncomingChangesHistoryItemContext,
307
- description: ( localizeWithPath(
308
- 'vs/workbench/services/actions/common/menusExtensionPoint',
309
- 'menus.incomingChangesHistoryItemContext',
310
- "The Source Control incoming changes history item context menu"
311
- )),
312
- proposed: 'contribSourceControlHistoryItemMenu'
313
- },
314
- {
315
- key: 'scm/outgoingChanges/allChanges/context',
316
- id: MenuId.SCMOutgoingChangesAllChangesContext,
317
- description: ( localizeWithPath(
318
- 'vs/workbench/services/actions/common/menusExtensionPoint',
319
- 'menus.outgoingChangesAllChangesContext',
320
- "The Source Control all outgoing changes context menu"
321
- )),
322
- proposed: 'contribSourceControlHistoryItemMenu'
323
- },
324
- {
325
- key: 'scm/outgoingChanges/historyItem/context',
326
- id: MenuId.SCMOutgoingChangesHistoryItemContext,
327
- description: ( localizeWithPath(
328
- 'vs/workbench/services/actions/common/menusExtensionPoint',
329
- 'menus.outgoingChangesHistoryItemContext',
330
- "The Source Control outgoing changes history item context menu"
331
- )),
332
- proposed: 'contribSourceControlHistoryItemMenu'
333
- },
334
- {
335
- key: 'statusBar/remoteIndicator',
336
- id: MenuId.StatusBarRemoteIndicatorMenu,
337
- description: ( localizeWithPath(
338
- 'vs/workbench/services/actions/common/menusExtensionPoint',
339
- 'menus.statusBarRemoteIndicator',
340
- "The remote indicator menu in the status bar"
341
- )),
342
- supportsSubmenus: false
343
- },
344
- {
345
- key: 'terminal/context',
346
- id: MenuId.TerminalInstanceContext,
347
- description: ( localizeWithPath(
348
- 'vs/workbench/services/actions/common/menusExtensionPoint',
349
- 'menus.terminalContext',
350
- "The terminal context menu"
351
- ))
352
- },
353
- {
354
- key: 'terminal/title/context',
355
- id: MenuId.TerminalTabContext,
356
- description: ( localizeWithPath(
357
- 'vs/workbench/services/actions/common/menusExtensionPoint',
358
- 'menus.terminalTabContext',
359
- "The terminal tabs context menu"
360
- ))
361
- },
362
- {
363
- key: 'view/title',
364
- id: MenuId.ViewTitle,
365
- description: ( localizeWithPath(
366
- 'vs/workbench/services/actions/common/menusExtensionPoint',
367
- 'view.viewTitle',
368
- "The contributed view title menu"
369
- ))
370
- },
371
- {
372
- key: 'view/item/context',
373
- id: MenuId.ViewItemContext,
374
- description: ( localizeWithPath(
375
- 'vs/workbench/services/actions/common/menusExtensionPoint',
376
- 'view.itemContext',
377
- "The contributed view item context menu"
378
- ))
379
- },
380
- {
381
- key: 'comments/comment/editorActions',
382
- id: MenuId.CommentEditorActions,
383
- description: ( localizeWithPath(
384
- 'vs/workbench/services/actions/common/menusExtensionPoint',
385
- 'commentThread.editorActions',
386
- "The contributed comment editor actions"
387
- )),
388
- proposed: 'contribCommentEditorActionsMenu'
389
- },
390
- {
391
- key: 'comments/commentThread/title',
392
- id: MenuId.CommentThreadTitle,
393
- description: ( localizeWithPath(
394
- 'vs/workbench/services/actions/common/menusExtensionPoint',
395
- 'commentThread.title',
396
- "The contributed comment thread title menu"
397
- ))
398
- },
399
- {
400
- key: 'comments/commentThread/context',
401
- id: MenuId.CommentThreadActions,
402
- description: ( localizeWithPath(
403
- 'vs/workbench/services/actions/common/menusExtensionPoint',
404
- 'commentThread.actions',
405
- "The contributed comment thread context menu, rendered as buttons below the comment editor"
406
- )),
407
- supportsSubmenus: false
408
- },
409
- {
410
- key: 'comments/commentThread/additionalActions',
411
- id: MenuId.CommentThreadAdditionalActions,
412
- description: ( localizeWithPath(
413
- 'vs/workbench/services/actions/common/menusExtensionPoint',
414
- 'commentThread.actions',
415
- "The contributed comment thread context menu, rendered as buttons below the comment editor"
416
- )),
417
- supportsSubmenus: false,
418
- proposed: 'contribCommentThreadAdditionalMenu'
419
- },
420
- {
421
- key: 'comments/commentThread/title/context',
422
- id: MenuId.CommentThreadTitleContext,
423
- description: ( localizeWithPath(
424
- 'vs/workbench/services/actions/common/menusExtensionPoint',
425
- 'commentThread.titleContext',
426
- "The contributed comment thread title's peek context menu, rendered as a right click menu on the comment thread's peek title."
427
- )),
428
- proposed: 'contribCommentPeekContext'
429
- },
430
- {
431
- key: 'comments/comment/title',
432
- id: MenuId.CommentTitle,
433
- description: ( localizeWithPath(
434
- 'vs/workbench/services/actions/common/menusExtensionPoint',
435
- 'comment.title',
436
- "The contributed comment title menu"
437
- ))
438
- },
439
- {
440
- key: 'comments/comment/context',
441
- id: MenuId.CommentActions,
442
- description: ( localizeWithPath(
443
- 'vs/workbench/services/actions/common/menusExtensionPoint',
444
- 'comment.actions',
445
- "The contributed comment context menu, rendered as buttons below the comment editor"
446
- )),
447
- supportsSubmenus: false
448
- },
449
- {
450
- key: 'comments/commentThread/comment/context',
451
- id: MenuId.CommentThreadCommentContext,
452
- description: ( localizeWithPath(
453
- 'vs/workbench/services/actions/common/menusExtensionPoint',
454
- 'comment.commentContext',
455
- "The contributed comment context menu, rendered as a right click menu on the an individual comment in the comment thread's peek view."
456
- )),
457
- proposed: 'contribCommentPeekContext'
458
- },
459
- {
460
- key: 'commentsView/commentThread/context',
461
- id: MenuId.CommentsViewThreadActions,
462
- description: ( localizeWithPath(
463
- 'vs/workbench/services/actions/common/menusExtensionPoint',
464
- 'commentsView.threadActions',
465
- "The contributed comment thread context menu in the comments view"
466
- )),
467
- proposed: 'contribCommentsViewThreadMenus'
468
- },
469
- {
470
- key: 'notebook/toolbar',
471
- id: MenuId.NotebookToolbar,
472
- description: ( localizeWithPath(
473
- 'vs/workbench/services/actions/common/menusExtensionPoint',
474
- 'notebook.toolbar',
475
- "The contributed notebook toolbar menu"
476
- ))
477
- },
478
- {
479
- key: 'notebook/kernelSource',
480
- id: MenuId.NotebookKernelSource,
481
- description: ( localizeWithPath(
482
- 'vs/workbench/services/actions/common/menusExtensionPoint',
483
- 'notebook.kernelSource',
484
- "The contributed notebook kernel sources menu"
485
- )),
486
- proposed: 'notebookKernelSource'
487
- },
488
- {
489
- key: 'notebook/cell/title',
490
- id: MenuId.NotebookCellTitle,
491
- description: ( localizeWithPath(
492
- 'vs/workbench/services/actions/common/menusExtensionPoint',
493
- 'notebook.cell.title',
494
- "The contributed notebook cell title menu"
495
- ))
496
- },
497
- {
498
- key: 'notebook/cell/execute',
499
- id: MenuId.NotebookCellExecute,
500
- description: ( localizeWithPath(
501
- 'vs/workbench/services/actions/common/menusExtensionPoint',
502
- 'notebook.cell.execute',
503
- "The contributed notebook cell execution menu"
504
- ))
505
- },
506
- {
507
- key: 'interactive/toolbar',
508
- id: MenuId.InteractiveToolbar,
509
- description: ( localizeWithPath(
510
- 'vs/workbench/services/actions/common/menusExtensionPoint',
511
- 'interactive.toolbar',
512
- "The contributed interactive toolbar menu"
513
- )),
514
- },
515
- {
516
- key: 'interactive/cell/title',
517
- id: MenuId.InteractiveCellTitle,
518
- description: ( localizeWithPath(
519
- 'vs/workbench/services/actions/common/menusExtensionPoint',
520
- 'interactive.cell.title',
521
- "The contributed interactive cell title menu"
522
- )),
523
- },
524
- {
525
- key: 'issue/reporter',
526
- id: MenuId.IssueReporter,
527
- description: ( localizeWithPath(
528
- 'vs/workbench/services/actions/common/menusExtensionPoint',
529
- 'issue.reporter',
530
- "The contributed issue reporter menu"
531
- )),
532
- proposed: 'contribIssueReporter'
533
- },
534
- {
535
- key: 'testing/item/context',
536
- id: MenuId.TestItem,
537
- description: ( localizeWithPath(
538
- 'vs/workbench/services/actions/common/menusExtensionPoint',
539
- 'testing.item.context',
540
- "The contributed test item menu"
541
- )),
542
- },
543
- {
544
- key: 'testing/item/gutter',
545
- id: MenuId.TestItemGutter,
546
- description: ( localizeWithPath(
547
- 'vs/workbench/services/actions/common/menusExtensionPoint',
548
- 'testing.item.gutter.title',
549
- "The menu for a gutter decoration for a test item"
550
- )),
551
- },
552
- {
553
- key: 'testing/item/result',
554
- id: MenuId.TestPeekElement,
555
- description: ( localizeWithPath(
556
- 'vs/workbench/services/actions/common/menusExtensionPoint',
557
- 'testing.item.result.title',
558
- "The menu for an item in the Test Results view or peek."
559
- )),
560
- },
561
- {
562
- key: 'testing/message/context',
563
- id: MenuId.TestMessageContext,
564
- description: ( localizeWithPath(
565
- 'vs/workbench/services/actions/common/menusExtensionPoint',
566
- 'testing.message.context.title',
567
- "A prominent button overlaying editor content where the message is displayed"
568
- )),
569
- },
570
- {
571
- key: 'testing/message/content',
572
- id: MenuId.TestMessageContent,
573
- description: ( localizeWithPath(
574
- 'vs/workbench/services/actions/common/menusExtensionPoint',
575
- 'testing.message.content.title',
576
- "Context menu for the message in the results tree"
577
- )),
578
- },
579
- {
580
- key: 'extension/context',
581
- id: MenuId.ExtensionContext,
582
- description: ( localizeWithPath(
583
- 'vs/workbench/services/actions/common/menusExtensionPoint',
584
- 'menus.extensionContext',
585
- "The extension context menu"
586
- ))
587
- },
588
- {
589
- key: 'timeline/title',
590
- id: MenuId.TimelineTitle,
591
- description: ( localizeWithPath(
592
- 'vs/workbench/services/actions/common/menusExtensionPoint',
593
- 'view.timelineTitle',
594
- "The Timeline view title menu"
595
- ))
596
- },
597
- {
598
- key: 'timeline/item/context',
599
- id: MenuId.TimelineItemContext,
600
- description: ( localizeWithPath(
601
- 'vs/workbench/services/actions/common/menusExtensionPoint',
602
- 'view.timelineContext',
603
- "The Timeline view item context menu"
604
- ))
605
- },
606
- {
607
- key: 'ports/item/context',
608
- id: MenuId.TunnelContext,
609
- description: ( localizeWithPath(
610
- 'vs/workbench/services/actions/common/menusExtensionPoint',
611
- 'view.tunnelContext',
612
- "The Ports view item context menu"
613
- ))
614
- },
615
- {
616
- key: 'ports/item/origin/inline',
617
- id: MenuId.TunnelOriginInline,
618
- description: ( localizeWithPath(
619
- 'vs/workbench/services/actions/common/menusExtensionPoint',
620
- 'view.tunnelOriginInline',
621
- "The Ports view item origin inline menu"
622
- ))
623
- },
624
- {
625
- key: 'ports/item/port/inline',
626
- id: MenuId.TunnelPortInline,
627
- description: ( localizeWithPath(
628
- 'vs/workbench/services/actions/common/menusExtensionPoint',
629
- 'view.tunnelPortInline',
630
- "The Ports view item port inline menu"
631
- ))
632
- },
633
- {
634
- key: 'file/newFile',
635
- id: MenuId.NewFile,
636
- description: ( localizeWithPath(
637
- 'vs/workbench/services/actions/common/menusExtensionPoint',
638
- 'file.newFile',
639
- "The 'New File...' quick pick, shown on welcome page and File menu."
640
- )),
641
- supportsSubmenus: false,
642
- },
643
- {
644
- key: 'webview/context',
645
- id: MenuId.WebviewContext,
646
- description: ( localizeWithPath(
647
- 'vs/workbench/services/actions/common/menusExtensionPoint',
648
- 'webview.context',
649
- "The webview context menu"
650
- ))
651
- },
652
- {
653
- key: 'file/share',
654
- id: MenuId.MenubarShare,
655
- description: ( localizeWithPath(
656
- 'vs/workbench/services/actions/common/menusExtensionPoint',
657
- 'menus.share',
658
- "Share submenu shown in the top level File menu."
659
- )),
660
- proposed: 'contribShareMenu'
661
- },
662
- {
663
- key: 'editor/inlineCompletions/actions',
664
- id: MenuId.InlineCompletionsActions,
665
- description: ( localizeWithPath(
666
- 'vs/workbench/services/actions/common/menusExtensionPoint',
667
- 'inlineCompletions.actions',
668
- "The actions shown when hovering on an inline completion"
669
- )),
670
- supportsSubmenus: false,
671
- proposed: 'inlineCompletionsAdditions'
672
- },
673
- {
674
- key: 'editor/inlineEdit/actions',
675
- id: MenuId.InlineEditActions,
676
- description: ( localizeWithPath(
677
- 'vs/workbench/services/actions/common/menusExtensionPoint',
678
- 'inlineEdit.actions',
679
- "The actions shown when hovering on an inline edit"
680
- )),
681
- supportsSubmenus: false,
682
- proposed: 'inlineEdit'
683
- },
684
- {
685
- key: 'editor/content',
686
- id: MenuId.EditorContent,
687
- description: ( localizeWithPath(
688
- 'vs/workbench/services/actions/common/menusExtensionPoint',
689
- 'merge.toolbar',
690
- "The prominent button in an editor, overlays its content"
691
- )),
692
- proposed: 'contribEditorContentMenu'
693
- },
694
- {
695
- key: 'editor/lineNumber/context',
696
- id: MenuId.EditorLineNumberContext,
697
- description: ( localizeWithPath(
698
- 'vs/workbench/services/actions/common/menusExtensionPoint',
699
- 'editorLineNumberContext',
700
- "The contributed editor line number context menu"
701
- ))
702
- },
703
- {
704
- key: 'mergeEditor/result/title',
705
- id: MenuId.MergeInputResultToolbar,
706
- description: ( localizeWithPath(
707
- 'vs/workbench/services/actions/common/menusExtensionPoint',
708
- 'menus.mergeEditorResult',
709
- "The result toolbar of the merge editor"
710
- )),
711
- proposed: 'contribMergeEditorMenus'
712
- },
713
- {
714
- key: 'multiDiffEditor/resource/title',
715
- id: MenuId.MultiDiffEditorFileToolbar,
716
- description: ( localizeWithPath(
717
- 'vs/workbench/services/actions/common/menusExtensionPoint',
718
- 'menus.multiDiffEditorResource',
719
- "The resource toolbar in the multi diff editor"
720
- )),
721
- proposed: 'contribMultiDiffEditorMenus'
722
- },
723
- {
724
- key: 'diffEditor/gutter/hunk',
725
- id: MenuId.DiffEditorHunkToolbar,
726
- description: ( localizeWithPath(
727
- 'vs/workbench/services/actions/common/menusExtensionPoint',
728
- 'menus.diffEditorGutterToolBarMenus',
729
- "The gutter toolbar in the diff editor"
730
- )),
731
- proposed: 'contribDiffEditorGutterToolBarMenus'
732
- },
733
- {
734
- key: 'diffEditor/gutter/selection',
735
- id: MenuId.DiffEditorSelectionToolbar,
736
- description: ( localizeWithPath(
737
- 'vs/workbench/services/actions/common/menusExtensionPoint',
738
- 'menus.diffEditorGutterToolBarMenus',
739
- "The gutter toolbar in the diff editor"
740
- )),
741
- proposed: 'contribDiffEditorGutterToolBarMenus'
742
- }
743
- ];
744
- var schema;
745
- ( (function(schema) {
746
- function isMenuItem(item) {
747
- return typeof item.command === 'string';
748
- }
749
- schema.isMenuItem = isMenuItem;
750
- function isValidMenuItem(item, collector) {
751
- if (typeof item.command !== 'string') {
752
- collector.error(( localizeWithPath(
753
- 'vs/workbench/services/actions/common/menusExtensionPoint',
754
- 'requirestring',
755
- "property `{0}` is mandatory and must be of type `string`",
756
- 'command'
757
- )));
758
- return false;
759
- }
760
- if (item.alt && typeof item.alt !== 'string') {
761
- collector.error(( localizeWithPath(
762
- 'vs/workbench/services/actions/common/menusExtensionPoint',
763
- 'optstring',
764
- "property `{0}` can be omitted or must be of type `string`",
765
- 'alt'
766
- )));
767
- return false;
768
- }
769
- if (item.when && typeof item.when !== 'string') {
770
- collector.error(( localizeWithPath(
771
- 'vs/workbench/services/actions/common/menusExtensionPoint',
772
- 'optstring',
773
- "property `{0}` can be omitted or must be of type `string`",
774
- 'when'
775
- )));
776
- return false;
777
- }
778
- if (item.group && typeof item.group !== 'string') {
779
- collector.error(( localizeWithPath(
780
- 'vs/workbench/services/actions/common/menusExtensionPoint',
781
- 'optstring',
782
- "property `{0}` can be omitted or must be of type `string`",
783
- 'group'
784
- )));
785
- return false;
786
- }
787
- return true;
788
- }
789
- schema.isValidMenuItem = isValidMenuItem;
790
- function isValidSubmenuItem(item, collector) {
791
- if (typeof item.submenu !== 'string') {
792
- collector.error(( localizeWithPath(
793
- 'vs/workbench/services/actions/common/menusExtensionPoint',
794
- 'requirestring',
795
- "property `{0}` is mandatory and must be of type `string`",
796
- 'submenu'
797
- )));
798
- return false;
799
- }
800
- if (item.when && typeof item.when !== 'string') {
801
- collector.error(( localizeWithPath(
802
- 'vs/workbench/services/actions/common/menusExtensionPoint',
803
- 'optstring',
804
- "property `{0}` can be omitted or must be of type `string`",
805
- 'when'
806
- )));
807
- return false;
808
- }
809
- if (item.group && typeof item.group !== 'string') {
810
- collector.error(( localizeWithPath(
811
- 'vs/workbench/services/actions/common/menusExtensionPoint',
812
- 'optstring',
813
- "property `{0}` can be omitted or must be of type `string`",
814
- 'group'
815
- )));
816
- return false;
817
- }
818
- return true;
819
- }
820
- schema.isValidSubmenuItem = isValidSubmenuItem;
821
- function isValidItems(items, collector) {
822
- if (!Array.isArray(items)) {
823
- collector.error(( localizeWithPath(
824
- 'vs/workbench/services/actions/common/menusExtensionPoint',
825
- 'requirearray',
826
- "submenu items must be an array"
827
- )));
828
- return false;
829
- }
830
- for (const item of items) {
831
- if (isMenuItem(item)) {
832
- if (!isValidMenuItem(item, collector)) {
833
- return false;
834
- }
835
- }
836
- else {
837
- if (!isValidSubmenuItem(item, collector)) {
838
- return false;
839
- }
840
- }
841
- }
842
- return true;
843
- }
844
- schema.isValidItems = isValidItems;
845
- function isValidSubmenu(submenu, collector) {
846
- if (typeof submenu !== 'object') {
847
- collector.error(( localizeWithPath(
848
- 'vs/workbench/services/actions/common/menusExtensionPoint',
849
- 'require',
850
- "submenu items must be an object"
851
- )));
852
- return false;
853
- }
854
- if (typeof submenu.id !== 'string') {
855
- collector.error(( localizeWithPath(
856
- 'vs/workbench/services/actions/common/menusExtensionPoint',
857
- 'requirestring',
858
- "property `{0}` is mandatory and must be of type `string`",
859
- 'id'
860
- )));
861
- return false;
862
- }
863
- if (typeof submenu.label !== 'string') {
864
- collector.error(( localizeWithPath(
865
- 'vs/workbench/services/actions/common/menusExtensionPoint',
866
- 'requirestring',
867
- "property `{0}` is mandatory and must be of type `string`",
868
- 'label'
869
- )));
870
- return false;
871
- }
872
- return true;
873
- }
874
- schema.isValidSubmenu = isValidSubmenu;
875
- const menuItem = {
876
- type: 'object',
877
- required: ['command'],
878
- properties: {
879
- command: {
880
- description: ( localizeWithPath(
881
- 'vs/workbench/services/actions/common/menusExtensionPoint',
882
- 'vscode.extension.contributes.menuItem.command',
883
- 'Identifier of the command to execute. The command must be declared in the \'commands\'-section'
884
- )),
885
- type: 'string'
886
- },
887
- alt: {
888
- description: ( localizeWithPath(
889
- 'vs/workbench/services/actions/common/menusExtensionPoint',
890
- 'vscode.extension.contributes.menuItem.alt',
891
- 'Identifier of an alternative command to execute. The command must be declared in the \'commands\'-section'
892
- )),
893
- type: 'string'
894
- },
895
- when: {
896
- description: ( localizeWithPath(
897
- 'vs/workbench/services/actions/common/menusExtensionPoint',
898
- 'vscode.extension.contributes.menuItem.when',
899
- 'Condition which must be true to show this item'
900
- )),
901
- type: 'string'
902
- },
903
- group: {
904
- description: ( localizeWithPath(
905
- 'vs/workbench/services/actions/common/menusExtensionPoint',
906
- 'vscode.extension.contributes.menuItem.group',
907
- 'Group into which this item belongs'
908
- )),
909
- type: 'string'
910
- }
911
- }
912
- };
913
- const submenuItem = {
914
- type: 'object',
915
- required: ['submenu'],
916
- properties: {
917
- submenu: {
918
- description: ( localizeWithPath(
919
- 'vs/workbench/services/actions/common/menusExtensionPoint',
920
- 'vscode.extension.contributes.menuItem.submenu',
921
- 'Identifier of the submenu to display in this item.'
922
- )),
923
- type: 'string'
924
- },
925
- when: {
926
- description: ( localizeWithPath(
927
- 'vs/workbench/services/actions/common/menusExtensionPoint',
928
- 'vscode.extension.contributes.menuItem.when',
929
- 'Condition which must be true to show this item'
930
- )),
931
- type: 'string'
932
- },
933
- group: {
934
- description: ( localizeWithPath(
935
- 'vs/workbench/services/actions/common/menusExtensionPoint',
936
- 'vscode.extension.contributes.menuItem.group',
937
- 'Group into which this item belongs'
938
- )),
939
- type: 'string'
940
- }
941
- }
942
- };
943
- const submenu = {
944
- type: 'object',
945
- required: ['id', 'label'],
946
- properties: {
947
- id: {
948
- description: ( localizeWithPath(
949
- 'vs/workbench/services/actions/common/menusExtensionPoint',
950
- 'vscode.extension.contributes.submenu.id',
951
- 'Identifier of the menu to display as a submenu.'
952
- )),
953
- type: 'string'
954
- },
955
- label: {
956
- description: ( localizeWithPath(
957
- 'vs/workbench/services/actions/common/menusExtensionPoint',
958
- 'vscode.extension.contributes.submenu.label',
959
- 'The label of the menu item which leads to this submenu.'
960
- )),
961
- type: 'string'
962
- },
963
- icon: {
964
- description: ( localizeWithPath(
965
- 'vs/workbench/services/actions/common/menusExtensionPoint',
966
- { key: 'vscode.extension.contributes.submenu.icon', comment: ['do not translate or change `\\$(zap)`, \\ in front of $ is important.'] },
967
- '(Optional) Icon which is used to represent the submenu in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`'
968
- )),
969
- anyOf: [{
970
- type: 'string'
971
- },
972
- {
973
- type: 'object',
974
- properties: {
975
- light: {
976
- description: ( localizeWithPath(
977
- 'vs/workbench/services/actions/common/menusExtensionPoint',
978
- 'vscode.extension.contributes.submenu.icon.light',
979
- 'Icon path when a light theme is used'
980
- )),
981
- type: 'string'
982
- },
983
- dark: {
984
- description: ( localizeWithPath(
985
- 'vs/workbench/services/actions/common/menusExtensionPoint',
986
- 'vscode.extension.contributes.submenu.icon.dark',
987
- 'Icon path when a dark theme is used'
988
- )),
989
- type: 'string'
990
- }
991
- }
992
- }]
993
- }
994
- }
995
- };
996
- schema.menusContribution = {
997
- description: ( localizeWithPath(
998
- 'vs/workbench/services/actions/common/menusExtensionPoint',
999
- 'vscode.extension.contributes.menus',
1000
- "Contributes menu items to the editor"
1001
- )),
1002
- type: 'object',
1003
- properties: index(apiMenus, menu => menu.key, menu => ({
1004
- markdownDescription: menu.proposed ? ( localizeWithPath(
1005
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1006
- 'proposed',
1007
- "Proposed API, requires `enabledApiProposal: [\"{0}\"]` - {1}",
1008
- menu.proposed,
1009
- menu.description
1010
- )) : menu.description,
1011
- type: 'array',
1012
- items: menu.supportsSubmenus === false ? menuItem : { oneOf: [menuItem, submenuItem] }
1013
- })),
1014
- additionalProperties: {
1015
- description: 'Submenu',
1016
- type: 'array',
1017
- items: { oneOf: [menuItem, submenuItem] }
1018
- }
1019
- };
1020
- schema.submenusContribution = {
1021
- description: ( localizeWithPath(
1022
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1023
- 'vscode.extension.contributes.submenus',
1024
- "Contributes submenu items to the editor"
1025
- )),
1026
- type: 'array',
1027
- items: submenu
1028
- };
1029
- function isValidCommand(command, collector) {
1030
- if (!command) {
1031
- collector.error(( localizeWithPath(
1032
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1033
- 'nonempty',
1034
- "expected non-empty value."
1035
- )));
1036
- return false;
1037
- }
1038
- if (isFalsyOrWhitespace(command.command)) {
1039
- collector.error(( localizeWithPath(
1040
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1041
- 'requirestring',
1042
- "property `{0}` is mandatory and must be of type `string`",
1043
- 'command'
1044
- )));
1045
- return false;
1046
- }
1047
- if (!isValidLocalizedString(command.title, collector, 'title')) {
1048
- return false;
1049
- }
1050
- if (command.shortTitle && !isValidLocalizedString(command.shortTitle, collector, 'shortTitle')) {
1051
- return false;
1052
- }
1053
- if (command.enablement && typeof command.enablement !== 'string') {
1054
- collector.error(( localizeWithPath(
1055
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1056
- 'optstring',
1057
- "property `{0}` can be omitted or must be of type `string`",
1058
- 'precondition'
1059
- )));
1060
- return false;
1061
- }
1062
- if (command.category && !isValidLocalizedString(command.category, collector, 'category')) {
1063
- return false;
1064
- }
1065
- if (!isValidIcon(command.icon, collector)) {
1066
- return false;
1067
- }
1068
- return true;
1069
- }
1070
- schema.isValidCommand = isValidCommand;
1071
- function isValidIcon(icon, collector) {
1072
- if (typeof icon === 'undefined') {
1073
- return true;
1074
- }
1075
- if (typeof icon === 'string') {
1076
- return true;
1077
- }
1078
- else if (typeof icon.dark === 'string' && typeof icon.light === 'string') {
1079
- return true;
1080
- }
1081
- collector.error(( localizeWithPath(
1082
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1083
- 'opticon',
1084
- "property `icon` can be omitted or must be either a string or a literal like `{dark, light}`"
1085
- )));
1086
- return false;
1087
- }
1088
- function isValidLocalizedString(localized, collector, propertyName) {
1089
- if (typeof localized === 'undefined') {
1090
- collector.error(( localizeWithPath(
1091
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1092
- 'requireStringOrObject',
1093
- "property `{0}` is mandatory and must be of type `string` or `object`",
1094
- propertyName
1095
- )));
1096
- return false;
1097
- }
1098
- else if (typeof localized === 'string' && isFalsyOrWhitespace(localized)) {
1099
- collector.error(( localizeWithPath(
1100
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1101
- 'requirestring',
1102
- "property `{0}` is mandatory and must be of type `string`",
1103
- propertyName
1104
- )));
1105
- return false;
1106
- }
1107
- else if (typeof localized !== 'string' && (isFalsyOrWhitespace(localized.original) || isFalsyOrWhitespace(localized.value))) {
1108
- collector.error(( localizeWithPath(
1109
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1110
- 'requirestrings',
1111
- "properties `{0}` and `{1}` are mandatory and must be of type `string`",
1112
- `${propertyName}.value`,
1113
- `${propertyName}.original`
1114
- )));
1115
- return false;
1116
- }
1117
- return true;
1118
- }
1119
- const commandType = {
1120
- type: 'object',
1121
- required: ['command', 'title'],
1122
- properties: {
1123
- command: {
1124
- description: ( localizeWithPath(
1125
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1126
- 'vscode.extension.contributes.commandType.command',
1127
- 'Identifier of the command to execute'
1128
- )),
1129
- type: 'string'
1130
- },
1131
- title: {
1132
- description: ( localizeWithPath(
1133
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1134
- 'vscode.extension.contributes.commandType.title',
1135
- 'Title by which the command is represented in the UI'
1136
- )),
1137
- type: 'string'
1138
- },
1139
- shortTitle: {
1140
- markdownDescription: ( localizeWithPath(
1141
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1142
- 'vscode.extension.contributes.commandType.shortTitle',
1143
- '(Optional) Short title by which the command is represented in the UI. Menus pick either `title` or `shortTitle` depending on the context in which they show commands.'
1144
- )),
1145
- type: 'string'
1146
- },
1147
- category: {
1148
- description: ( localizeWithPath(
1149
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1150
- 'vscode.extension.contributes.commandType.category',
1151
- '(Optional) Category string by which the command is grouped in the UI'
1152
- )),
1153
- type: 'string'
1154
- },
1155
- enablement: {
1156
- description: ( localizeWithPath(
1157
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1158
- 'vscode.extension.contributes.commandType.precondition',
1159
- '(Optional) Condition which must be true to enable the command in the UI (menu and keybindings). Does not prevent executing the command by other means, like the `executeCommand`-api.'
1160
- )),
1161
- type: 'string'
1162
- },
1163
- icon: {
1164
- description: ( localizeWithPath(
1165
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1166
- { key: 'vscode.extension.contributes.commandType.icon', comment: ['do not translate or change `\\$(zap)`, \\ in front of $ is important.'] },
1167
- '(Optional) Icon which is used to represent the command in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\\$(zap)`'
1168
- )),
1169
- anyOf: [{
1170
- type: 'string'
1171
- },
1172
- {
1173
- type: 'object',
1174
- properties: {
1175
- light: {
1176
- description: ( localizeWithPath(
1177
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1178
- 'vscode.extension.contributes.commandType.icon.light',
1179
- 'Icon path when a light theme is used'
1180
- )),
1181
- type: 'string'
1182
- },
1183
- dark: {
1184
- description: ( localizeWithPath(
1185
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1186
- 'vscode.extension.contributes.commandType.icon.dark',
1187
- 'Icon path when a dark theme is used'
1188
- )),
1189
- type: 'string'
1190
- }
1191
- }
1192
- }]
1193
- }
1194
- }
1195
- };
1196
- schema.commandsContribution = {
1197
- description: ( localizeWithPath(
1198
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1199
- 'vscode.extension.contributes.commands',
1200
- "Contributes commands to the command palette."
1201
- )),
1202
- oneOf: [
1203
- commandType,
1204
- {
1205
- type: 'array',
1206
- items: commandType
1207
- }
1208
- ]
1209
- };
1210
- })(schema || (schema = {})));
1211
- const _commandRegistrations = ( new DisposableStore());
1212
- const commandsExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
1213
- extensionPoint: 'commands',
1214
- jsonSchema: schema.commandsContribution,
1215
- activationEventsGenerator: (contribs, result) => {
1216
- for (const contrib of contribs) {
1217
- if (contrib.command) {
1218
- result.push(`onCommand:${contrib.command}`);
1219
- }
1220
- }
1221
- }
1222
- });
1223
- commandsExtensionPoint.setHandler(extensions => {
1224
- function handleCommand(userFriendlyCommand, extension) {
1225
- if (!schema.isValidCommand(userFriendlyCommand, extension.collector)) {
1226
- return;
1227
- }
1228
- const { icon, enablement, category, title, shortTitle, command } = userFriendlyCommand;
1229
- let absoluteIcon;
1230
- if (icon) {
1231
- if (typeof icon === 'string') {
1232
- absoluteIcon = ThemeIcon.fromString(icon) ?? { dark: joinPath(extension.description.extensionLocation, icon), light: joinPath(extension.description.extensionLocation, icon) };
1233
- }
1234
- else {
1235
- absoluteIcon = {
1236
- dark: joinPath(extension.description.extensionLocation, icon.dark),
1237
- light: joinPath(extension.description.extensionLocation, icon.light)
1238
- };
1239
- }
1240
- }
1241
- const existingCmd = MenuRegistry.getCommand(command);
1242
- if (existingCmd) {
1243
- if (existingCmd.source) {
1244
- extension.collector.info(( localizeWithPath(
1245
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1246
- 'dup1',
1247
- "Command `{0}` already registered by {1} ({2})",
1248
- userFriendlyCommand.command,
1249
- existingCmd.source.title,
1250
- existingCmd.source.id
1251
- )));
1252
- }
1253
- else {
1254
- extension.collector.info(( localizeWithPath(
1255
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1256
- 'dup0',
1257
- "Command `{0}` already registered",
1258
- userFriendlyCommand.command
1259
- )));
1260
- }
1261
- }
1262
- _commandRegistrations.add(MenuRegistry.addCommand({
1263
- id: command,
1264
- title,
1265
- source: { id: extension.description.identifier.value, title: extension.description.displayName ?? extension.description.name },
1266
- shortTitle,
1267
- tooltip: title,
1268
- category,
1269
- precondition: ContextKeyExpr.deserialize(enablement),
1270
- icon: absoluteIcon
1271
- }));
1272
- }
1273
- _commandRegistrations.clear();
1274
- for (const extension of extensions) {
1275
- const { value } = extension;
1276
- if (Array.isArray(value)) {
1277
- for (const command of value) {
1278
- handleCommand(command, extension);
1279
- }
1280
- }
1281
- else {
1282
- handleCommand(value, extension);
1283
- }
1284
- }
1285
- });
1286
- const _submenus = ( new Map());
1287
- const submenusExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
1288
- extensionPoint: 'submenus',
1289
- jsonSchema: schema.submenusContribution
1290
- });
1291
- submenusExtensionPoint.setHandler(extensions => {
1292
- _submenus.clear();
1293
- for (const extension of extensions) {
1294
- const { value, collector } = extension;
1295
- for (const [, submenuInfo] of Object.entries(value)) {
1296
- if (!schema.isValidSubmenu(submenuInfo, collector)) {
1297
- continue;
1298
- }
1299
- if (!submenuInfo.id) {
1300
- collector.warn(( localizeWithPath(
1301
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1302
- 'submenuId.invalid.id',
1303
- "`{0}` is not a valid submenu identifier",
1304
- submenuInfo.id
1305
- )));
1306
- continue;
1307
- }
1308
- if (( _submenus.has(submenuInfo.id))) {
1309
- collector.info(( localizeWithPath(
1310
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1311
- 'submenuId.duplicate.id',
1312
- "The `{0}` submenu was already previously registered.",
1313
- submenuInfo.id
1314
- )));
1315
- continue;
1316
- }
1317
- if (!submenuInfo.label) {
1318
- collector.warn(( localizeWithPath(
1319
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1320
- 'submenuId.invalid.label',
1321
- "`{0}` is not a valid submenu label",
1322
- submenuInfo.label
1323
- )));
1324
- continue;
1325
- }
1326
- let absoluteIcon;
1327
- if (submenuInfo.icon) {
1328
- if (typeof submenuInfo.icon === 'string') {
1329
- absoluteIcon = ThemeIcon.fromString(submenuInfo.icon) || { dark: joinPath(extension.description.extensionLocation, submenuInfo.icon) };
1330
- }
1331
- else {
1332
- absoluteIcon = {
1333
- dark: joinPath(extension.description.extensionLocation, submenuInfo.icon.dark),
1334
- light: joinPath(extension.description.extensionLocation, submenuInfo.icon.light)
1335
- };
1336
- }
1337
- }
1338
- const item = {
1339
- id: MenuId.for(`api:${submenuInfo.id}`),
1340
- label: submenuInfo.label,
1341
- icon: absoluteIcon
1342
- };
1343
- _submenus.set(submenuInfo.id, item);
1344
- }
1345
- }
1346
- });
1347
- const _apiMenusByKey = ( new Map(( apiMenus.map(menu => ([menu.key, menu])))));
1348
- const _menuRegistrations = ( new DisposableStore());
1349
- const _submenuMenuItems = ( new Map());
1350
- const menusExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
1351
- extensionPoint: 'menus',
1352
- jsonSchema: schema.menusContribution,
1353
- deps: [submenusExtensionPoint]
1354
- });
1355
- menusExtensionPoint.setHandler(extensions => {
1356
- _menuRegistrations.clear();
1357
- _submenuMenuItems.clear();
1358
- for (const extension of extensions) {
1359
- const { value, collector } = extension;
1360
- for (const entry of Object.entries(value)) {
1361
- if (!schema.isValidItems(entry[1], collector)) {
1362
- continue;
1363
- }
1364
- let menu = _apiMenusByKey.get(entry[0]);
1365
- if (!menu) {
1366
- const submenu = _submenus.get(entry[0]);
1367
- if (submenu) {
1368
- menu = {
1369
- key: entry[0],
1370
- id: submenu.id,
1371
- description: ''
1372
- };
1373
- }
1374
- }
1375
- if (!menu) {
1376
- continue;
1377
- }
1378
- if (menu.proposed && !isProposedApiEnabled(extension.description, menu.proposed)) {
1379
- collector.error(( localizeWithPath(
1380
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1381
- 'proposedAPI.invalid',
1382
- "{0} is a proposed menu identifier. It requires 'package.json#enabledApiProposals: [\"{1}\"]' and is only available when running out of dev or with the following command line switch: --enable-proposed-api {2}",
1383
- entry[0],
1384
- menu.proposed,
1385
- extension.description.identifier.value
1386
- )));
1387
- continue;
1388
- }
1389
- for (const menuItem of entry[1]) {
1390
- let item;
1391
- if (schema.isMenuItem(menuItem)) {
1392
- const command = MenuRegistry.getCommand(menuItem.command);
1393
- const alt = menuItem.alt && MenuRegistry.getCommand(menuItem.alt) || undefined;
1394
- if (!command) {
1395
- collector.error(( localizeWithPath(
1396
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1397
- 'missing.command',
1398
- "Menu item references a command `{0}` which is not defined in the 'commands' section.",
1399
- menuItem.command
1400
- )));
1401
- continue;
1402
- }
1403
- if (menuItem.alt && !alt) {
1404
- collector.warn(( localizeWithPath(
1405
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1406
- 'missing.altCommand',
1407
- "Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",
1408
- menuItem.alt
1409
- )));
1410
- }
1411
- if (menuItem.command === menuItem.alt) {
1412
- collector.info(( localizeWithPath(
1413
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1414
- 'dupe.command',
1415
- "Menu item references the same command as default and alt-command"
1416
- )));
1417
- }
1418
- item = { command, alt, group: undefined, order: undefined, when: undefined };
1419
- }
1420
- else {
1421
- if (menu.supportsSubmenus === false) {
1422
- collector.error(( localizeWithPath(
1423
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1424
- 'unsupported.submenureference',
1425
- "Menu item references a submenu for a menu which doesn't have submenu support."
1426
- )));
1427
- continue;
1428
- }
1429
- const submenu = _submenus.get(menuItem.submenu);
1430
- if (!submenu) {
1431
- collector.error(( localizeWithPath(
1432
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1433
- 'missing.submenu',
1434
- "Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",
1435
- menuItem.submenu
1436
- )));
1437
- continue;
1438
- }
1439
- let submenuRegistrations = _submenuMenuItems.get(menu.id.id);
1440
- if (!submenuRegistrations) {
1441
- submenuRegistrations = ( new Set());
1442
- _submenuMenuItems.set(menu.id.id, submenuRegistrations);
1443
- }
1444
- if (( submenuRegistrations.has(submenu.id.id))) {
1445
- collector.warn(( localizeWithPath(
1446
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1447
- 'submenuItem.duplicate',
1448
- "The `{0}` submenu was already contributed to the `{1}` menu.",
1449
- menuItem.submenu,
1450
- entry[0]
1451
- )));
1452
- continue;
1453
- }
1454
- submenuRegistrations.add(submenu.id.id);
1455
- item = { submenu: submenu.id, icon: submenu.icon, title: submenu.label, group: undefined, order: undefined, when: undefined };
1456
- }
1457
- if (menuItem.group) {
1458
- const idx = menuItem.group.lastIndexOf('@');
1459
- if (idx > 0) {
1460
- item.group = menuItem.group.substr(0, idx);
1461
- item.order = Number(menuItem.group.substr(idx + 1)) || undefined;
1462
- }
1463
- else {
1464
- item.group = menuItem.group;
1465
- }
1466
- }
1467
- item.when = ContextKeyExpr.deserialize(menuItem.when);
1468
- _menuRegistrations.add(MenuRegistry.appendMenuItem(menu.id, item));
1469
- }
1470
- }
1471
- }
1472
- });
1473
- let CommandsTableRenderer = class CommandsTableRenderer extends Disposable {
1474
- constructor(_keybindingService) {
1475
- super();
1476
- this._keybindingService = _keybindingService;
1477
- this.type = 'table';
1478
- }
1479
- shouldRender(manifest) {
1480
- return !!manifest.contributes?.commands;
1481
- }
1482
- render(manifest) {
1483
- const rawCommands = manifest.contributes?.commands || [];
1484
- const commands = ( rawCommands.map(c => ({
1485
- id: c.command,
1486
- title: c.title,
1487
- keybindings: [],
1488
- menus: []
1489
- })));
1490
- const byId = index(commands, c => c.id);
1491
- const menus = manifest.contributes?.menus || {};
1492
- for (const context in menus) {
1493
- for (const menu of menus[context]) {
1494
- if (menu.command) {
1495
- let command = byId[menu.command];
1496
- if (command) {
1497
- command.menus.push(context);
1498
- }
1499
- else {
1500
- command = { id: menu.command, title: '', keybindings: [], menus: [context] };
1501
- byId[command.id] = command;
1502
- commands.push(command);
1503
- }
1504
- }
1505
- }
1506
- }
1507
- const rawKeybindings = manifest.contributes?.keybindings ? (Array.isArray(manifest.contributes.keybindings) ? manifest.contributes.keybindings : [manifest.contributes.keybindings]) : [];
1508
- rawKeybindings.forEach(rawKeybinding => {
1509
- const keybinding = this.resolveKeybinding(rawKeybinding);
1510
- if (!keybinding) {
1511
- return;
1512
- }
1513
- let command = byId[rawKeybinding.command];
1514
- if (command) {
1515
- command.keybindings.push(keybinding);
1516
- }
1517
- else {
1518
- command = { id: rawKeybinding.command, title: '', keybindings: [keybinding], menus: [] };
1519
- byId[command.id] = command;
1520
- commands.push(command);
1521
- }
1522
- });
1523
- if (!commands.length) {
1524
- return { data: { headers: [], rows: [] }, dispose: () => { } };
1525
- }
1526
- const headers = [
1527
- ( localizeWithPath(
1528
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1529
- 'command name',
1530
- "ID"
1531
- )),
1532
- ( localizeWithPath(
1533
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1534
- 'command title',
1535
- "Title"
1536
- )),
1537
- ( localizeWithPath(
1538
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1539
- 'keyboard shortcuts',
1540
- "Keyboard Shortcuts"
1541
- )),
1542
- ( localizeWithPath(
1543
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1544
- 'menuContexts',
1545
- "Menu Contexts"
1546
- ))
1547
- ];
1548
- const rows = ( commands.sort((a, b) => a.id.localeCompare(b.id))
1549
- .map(command => {
1550
- return [
1551
- ( new MarkdownString()).appendMarkdown(`\`${command.id}\``),
1552
- typeof command.title === 'string' ? command.title : command.title.value,
1553
- command.keybindings,
1554
- ( new MarkdownString()).appendMarkdown(`${( command.menus.map(menu => `\`${menu}\``)).join(' ')}`),
1555
- ];
1556
- }));
1557
- return {
1558
- data: {
1559
- headers,
1560
- rows
1561
- },
1562
- dispose: () => { }
1563
- };
1564
- }
1565
- resolveKeybinding(rawKeyBinding) {
1566
- let key;
1567
- switch (platform) {
1568
- case 'win32':
1569
- key = rawKeyBinding.win;
1570
- break;
1571
- case 'linux':
1572
- key = rawKeyBinding.linux;
1573
- break;
1574
- case 'darwin':
1575
- key = rawKeyBinding.mac;
1576
- break;
1577
- }
1578
- return this._keybindingService.resolveUserBinding(key ?? rawKeyBinding.key)[0];
1579
- }
1580
- };
1581
- CommandsTableRenderer = ( __decorate([
1582
- ( __param(0, IKeybindingService))
1583
- ], CommandsTableRenderer));
1584
- ( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
1585
- id: 'commands',
1586
- label: ( localizeWithPath(
1587
- 'vs/workbench/services/actions/common/menusExtensionPoint',
1588
- 'commands',
1589
- "Commands"
1590
- )),
1591
- access: {
1592
- canToggle: false,
1593
- },
1594
- renderer: ( new SyncDescriptor(CommandsTableRenderer)),
1595
- });
1596
-
1597
- export { commandsExtensionPoint };