@codingame/monaco-vscode-keybindings-service-override 25.1.2 → 26.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +20 -17
- package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js +45 -56
- package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +25 -17
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js +39 -36
- package/vscode/src/vs/workbench/contrib/preferences/common/smartSnippetInserter.js +37 -40
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +678 -724
- package/vscode/src/vs/workbench/services/commands/common/commandService.js +13 -17
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +245 -208
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +64 -71
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js +3 -1
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.js +20 -25
- package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.js +21 -22
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +185 -173
- package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +49 -45
|
@@ -17,525 +17,451 @@ import { platform } from '@codingame/monaco-vscode-api/vscode/vs/base/common/pro
|
|
|
17
17
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
18
18
|
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
19
19
|
|
|
20
|
-
const apiMenus = [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
key: 'mergeEditor/result/title',
|
|
440
|
-
id: MenuId.MergeInputResultToolbar,
|
|
441
|
-
description: ( localize(13658, "The result toolbar of the merge editor")),
|
|
442
|
-
proposed: 'contribMergeEditorMenus'
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
key: 'multiDiffEditor/content',
|
|
446
|
-
id: MenuId.MultiDiffEditorContent,
|
|
447
|
-
description: ( localize(13659, "A prominent button overlaying the multi diff editor")),
|
|
448
|
-
proposed: 'contribEditorContentMenu'
|
|
449
|
-
},
|
|
450
|
-
{
|
|
451
|
-
key: 'multiDiffEditor/resource/title',
|
|
452
|
-
id: MenuId.MultiDiffEditorFileToolbar,
|
|
453
|
-
description: ( localize(13660, "The resource toolbar in the multi diff editor")),
|
|
454
|
-
proposed: 'contribMultiDiffEditorMenus'
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
key: 'diffEditor/gutter/hunk',
|
|
458
|
-
id: MenuId.DiffEditorHunkToolbar,
|
|
459
|
-
description: ( localize(13661, "The gutter toolbar in the diff editor")),
|
|
460
|
-
proposed: 'contribDiffEditorGutterToolBarMenus'
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
key: 'diffEditor/gutter/selection',
|
|
464
|
-
id: MenuId.DiffEditorSelectionToolbar,
|
|
465
|
-
description: ( localize(13661, "The gutter toolbar in the diff editor")),
|
|
466
|
-
proposed: 'contribDiffEditorGutterToolBarMenus'
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
key: 'searchPanel/aiResults/commands',
|
|
470
|
-
id: MenuId.SearchActionMenu,
|
|
471
|
-
description: ( localize(
|
|
472
|
-
13662,
|
|
473
|
-
"The commands that will contribute to the menu rendered as buttons next to the AI search title"
|
|
474
|
-
)),
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
key: 'editor/context/chat',
|
|
478
|
-
id: MenuId.ChatTextEditorMenu,
|
|
479
|
-
description: ( localize(13663, "The Chat submenu in the text editor context menu.")),
|
|
480
|
-
supportsSubmenus: false,
|
|
481
|
-
proposed: 'chatParticipantPrivate'
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
key: 'chat/input/editing/sessionToolbar',
|
|
485
|
-
id: MenuId.ChatEditingSessionChangesToolbar,
|
|
486
|
-
description: ( localize(13664, "The Chat Editing widget toolbar menu for session changes.")),
|
|
487
|
-
proposed: 'chatSessionsProvider'
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
key: 'chat/chatSessions',
|
|
491
|
-
id: MenuId.AgentSessionsContext,
|
|
492
|
-
description: ( localize(13665, "The Chat Sessions menu.")),
|
|
493
|
-
supportsSubmenus: false,
|
|
494
|
-
proposed: 'chatSessionsProvider'
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
key: 'chatSessions/newSession',
|
|
498
|
-
id: MenuId.AgentSessionsCreateSubMenu,
|
|
499
|
-
description: ( localize(13666, "Menu for new chat sessions.")),
|
|
500
|
-
supportsSubmenus: false,
|
|
501
|
-
proposed: 'chatSessionsProvider'
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
key: 'chat/multiDiff/context',
|
|
505
|
-
id: MenuId.ChatMultiDiffContext,
|
|
506
|
-
description: ( localize(13667, "The Chat Multi-Diff context menu.")),
|
|
507
|
-
supportsSubmenus: false,
|
|
508
|
-
proposed: 'chatSessionsProvider',
|
|
509
|
-
},
|
|
510
|
-
];
|
|
20
|
+
const apiMenus = [{
|
|
21
|
+
key: "commandPalette",
|
|
22
|
+
id: MenuId.CommandPalette,
|
|
23
|
+
description: ( localize(13966, "The Command Palette")),
|
|
24
|
+
supportsSubmenus: false
|
|
25
|
+
}, {
|
|
26
|
+
key: "touchBar",
|
|
27
|
+
id: MenuId.TouchBarContext,
|
|
28
|
+
description: ( localize(13967, "The touch bar (macOS only)")),
|
|
29
|
+
supportsSubmenus: false
|
|
30
|
+
}, {
|
|
31
|
+
key: "editor/title",
|
|
32
|
+
id: MenuId.EditorTitle,
|
|
33
|
+
description: ( localize(13968, "The editor title menu"))
|
|
34
|
+
}, {
|
|
35
|
+
key: "editor/title/run",
|
|
36
|
+
id: MenuId.EditorTitleRun,
|
|
37
|
+
description: ( localize(13969, "Run submenu inside the editor title menu"))
|
|
38
|
+
}, {
|
|
39
|
+
key: "editor/context",
|
|
40
|
+
id: MenuId.EditorContext,
|
|
41
|
+
description: ( localize(13970, "The editor context menu"))
|
|
42
|
+
}, {
|
|
43
|
+
key: "editor/context/copy",
|
|
44
|
+
id: MenuId.EditorContextCopy,
|
|
45
|
+
description: ( localize(13971, "'Copy as' submenu in the editor context menu"))
|
|
46
|
+
}, {
|
|
47
|
+
key: "editor/context/share",
|
|
48
|
+
id: MenuId.EditorContextShare,
|
|
49
|
+
description: ( localize(13972, "'Share' submenu in the editor context menu")),
|
|
50
|
+
proposed: "contribShareMenu"
|
|
51
|
+
}, {
|
|
52
|
+
key: "explorer/context",
|
|
53
|
+
id: MenuId.ExplorerContext,
|
|
54
|
+
description: ( localize(13973, "The file explorer context menu"))
|
|
55
|
+
}, {
|
|
56
|
+
key: "explorer/context/share",
|
|
57
|
+
id: MenuId.ExplorerContextShare,
|
|
58
|
+
description: ( localize(13974, "'Share' submenu in the file explorer context menu")),
|
|
59
|
+
proposed: "contribShareMenu"
|
|
60
|
+
}, {
|
|
61
|
+
key: "editor/title/context",
|
|
62
|
+
id: MenuId.EditorTitleContext,
|
|
63
|
+
description: ( localize(13975, "The editor tabs context menu"))
|
|
64
|
+
}, {
|
|
65
|
+
key: "editor/title/context/share",
|
|
66
|
+
id: MenuId.EditorTitleContextShare,
|
|
67
|
+
description: ( localize(13976, "'Share' submenu inside the editor title context menu")),
|
|
68
|
+
proposed: "contribShareMenu"
|
|
69
|
+
}, {
|
|
70
|
+
key: "debug/callstack/context",
|
|
71
|
+
id: MenuId.DebugCallStackContext,
|
|
72
|
+
description: ( localize(13977, "The debug callstack view context menu"))
|
|
73
|
+
}, {
|
|
74
|
+
key: "debug/variables/context",
|
|
75
|
+
id: MenuId.DebugVariablesContext,
|
|
76
|
+
description: ( localize(13978, "The debug variables view context menu"))
|
|
77
|
+
}, {
|
|
78
|
+
key: "debug/watch/context",
|
|
79
|
+
id: MenuId.DebugWatchContext,
|
|
80
|
+
description: ( localize(13979, "The debug watch view context menu"))
|
|
81
|
+
}, {
|
|
82
|
+
key: "debug/toolBar",
|
|
83
|
+
id: MenuId.DebugToolBar,
|
|
84
|
+
description: ( localize(13980, "The debug toolbar menu"))
|
|
85
|
+
}, {
|
|
86
|
+
key: "debug/createConfiguration",
|
|
87
|
+
id: MenuId.DebugCreateConfiguration,
|
|
88
|
+
proposed: "contribDebugCreateConfiguration",
|
|
89
|
+
description: ( localize(13981, "The debug create configuration menu"))
|
|
90
|
+
}, {
|
|
91
|
+
key: "notebook/variables/context",
|
|
92
|
+
id: MenuId.NotebookVariablesContext,
|
|
93
|
+
description: ( localize(13982, "The notebook variables view context menu"))
|
|
94
|
+
}, {
|
|
95
|
+
key: "menuBar/home",
|
|
96
|
+
id: MenuId.MenubarHomeMenu,
|
|
97
|
+
description: ( localize(13983, "The home indicator context menu (web only)")),
|
|
98
|
+
proposed: "contribMenuBarHome",
|
|
99
|
+
supportsSubmenus: false
|
|
100
|
+
}, {
|
|
101
|
+
key: "menuBar/edit/copy",
|
|
102
|
+
id: MenuId.MenubarCopy,
|
|
103
|
+
description: ( localize(13984, "'Copy as' submenu in the top level Edit menu"))
|
|
104
|
+
}, {
|
|
105
|
+
key: "scm/title",
|
|
106
|
+
id: MenuId.SCMTitle,
|
|
107
|
+
description: ( localize(13985, "The Source Control title menu"))
|
|
108
|
+
}, {
|
|
109
|
+
key: "scm/sourceControl",
|
|
110
|
+
id: MenuId.SCMSourceControl,
|
|
111
|
+
description: ( localize(13986, "The Source Control menu"))
|
|
112
|
+
}, {
|
|
113
|
+
key: "scm/repositories/title",
|
|
114
|
+
id: MenuId.SCMSourceControlTitle,
|
|
115
|
+
description: ( localize(13987, "The Source Control Repositories title menu")),
|
|
116
|
+
proposed: "contribSourceControlTitleMenu"
|
|
117
|
+
}, {
|
|
118
|
+
key: "scm/repository",
|
|
119
|
+
id: MenuId.SCMSourceControlInline,
|
|
120
|
+
description: ( localize(13988, "The Source Control repository menu"))
|
|
121
|
+
}, {
|
|
122
|
+
key: "scm/resourceState/context",
|
|
123
|
+
id: MenuId.SCMResourceContext,
|
|
124
|
+
description: ( localize(13989, "The Source Control resource state context menu"))
|
|
125
|
+
}, {
|
|
126
|
+
key: "scm/resourceFolder/context",
|
|
127
|
+
id: MenuId.SCMResourceFolderContext,
|
|
128
|
+
description: ( localize(13990, "The Source Control resource folder context menu"))
|
|
129
|
+
}, {
|
|
130
|
+
key: "scm/resourceGroup/context",
|
|
131
|
+
id: MenuId.SCMResourceGroupContext,
|
|
132
|
+
description: ( localize(13991, "The Source Control resource group context menu"))
|
|
133
|
+
}, {
|
|
134
|
+
key: "scm/change/title",
|
|
135
|
+
id: MenuId.SCMChangeContext,
|
|
136
|
+
description: ( localize(13992, "The Source Control inline change menu"))
|
|
137
|
+
}, {
|
|
138
|
+
key: "scm/inputBox",
|
|
139
|
+
id: MenuId.SCMInputBox,
|
|
140
|
+
description: ( localize(13993, "The Source Control input box menu")),
|
|
141
|
+
proposed: "contribSourceControlInputBoxMenu"
|
|
142
|
+
}, {
|
|
143
|
+
key: "scm/history/title",
|
|
144
|
+
id: MenuId.SCMHistoryTitle,
|
|
145
|
+
description: ( localize(13994, "The Source Control History title menu")),
|
|
146
|
+
proposed: "contribSourceControlHistoryTitleMenu"
|
|
147
|
+
}, {
|
|
148
|
+
key: "scm/historyItem/context",
|
|
149
|
+
id: MenuId.SCMHistoryItemContext,
|
|
150
|
+
description: ( localize(13995, "The Source Control history item context menu")),
|
|
151
|
+
proposed: "contribSourceControlHistoryItemMenu"
|
|
152
|
+
}, {
|
|
153
|
+
key: "scm/historyItemRef/context",
|
|
154
|
+
id: MenuId.SCMHistoryItemRefContext,
|
|
155
|
+
description: ( localize(13996, "The Source Control history item reference context menu")),
|
|
156
|
+
proposed: "contribSourceControlHistoryItemMenu"
|
|
157
|
+
}, {
|
|
158
|
+
key: "scm/artifactGroup/context",
|
|
159
|
+
id: MenuId.SCMArtifactGroupContext,
|
|
160
|
+
description: ( localize(13997, "The Source Control artifact group context menu")),
|
|
161
|
+
proposed: "contribSourceControlArtifactGroupMenu"
|
|
162
|
+
}, {
|
|
163
|
+
key: "scm/artifact/context",
|
|
164
|
+
id: MenuId.SCMArtifactContext,
|
|
165
|
+
description: ( localize(13998, "The Source Control artifact context menu")),
|
|
166
|
+
proposed: "contribSourceControlArtifactMenu"
|
|
167
|
+
}, {
|
|
168
|
+
key: "statusBar/remoteIndicator",
|
|
169
|
+
id: MenuId.StatusBarRemoteIndicatorMenu,
|
|
170
|
+
description: ( localize(13999, "The remote indicator menu in the status bar")),
|
|
171
|
+
supportsSubmenus: false
|
|
172
|
+
}, {
|
|
173
|
+
key: "terminal/context",
|
|
174
|
+
id: MenuId.TerminalInstanceContext,
|
|
175
|
+
description: ( localize(14000, "The terminal context menu"))
|
|
176
|
+
}, {
|
|
177
|
+
key: "terminal/title/context",
|
|
178
|
+
id: MenuId.TerminalTabContext,
|
|
179
|
+
description: ( localize(14001, "The terminal tabs context menu"))
|
|
180
|
+
}, {
|
|
181
|
+
key: "view/title",
|
|
182
|
+
id: MenuId.ViewTitle,
|
|
183
|
+
description: ( localize(14002, "The contributed view title menu"))
|
|
184
|
+
}, {
|
|
185
|
+
key: "viewContainer/title",
|
|
186
|
+
id: MenuId.ViewContainerTitle,
|
|
187
|
+
description: ( localize(14003, "The contributed view container title menu")),
|
|
188
|
+
proposed: "contribViewContainerTitle"
|
|
189
|
+
}, {
|
|
190
|
+
key: "view/item/context",
|
|
191
|
+
id: MenuId.ViewItemContext,
|
|
192
|
+
description: ( localize(14004, "The contributed view item context menu"))
|
|
193
|
+
}, {
|
|
194
|
+
key: "comments/comment/editorActions",
|
|
195
|
+
id: MenuId.CommentEditorActions,
|
|
196
|
+
description: ( localize(14005, "The contributed comment editor actions")),
|
|
197
|
+
proposed: "contribCommentEditorActionsMenu"
|
|
198
|
+
}, {
|
|
199
|
+
key: "comments/commentThread/title",
|
|
200
|
+
id: MenuId.CommentThreadTitle,
|
|
201
|
+
description: ( localize(14006, "The contributed comment thread title menu"))
|
|
202
|
+
}, {
|
|
203
|
+
key: "comments/commentThread/context",
|
|
204
|
+
id: MenuId.CommentThreadActions,
|
|
205
|
+
description: ( localize(
|
|
206
|
+
14007,
|
|
207
|
+
"The contributed comment thread context menu, rendered as buttons below the comment editor"
|
|
208
|
+
)),
|
|
209
|
+
supportsSubmenus: false
|
|
210
|
+
}, {
|
|
211
|
+
key: "comments/commentThread/additionalActions",
|
|
212
|
+
id: MenuId.CommentThreadAdditionalActions,
|
|
213
|
+
description: ( localize(
|
|
214
|
+
14007,
|
|
215
|
+
"The contributed comment thread context menu, rendered as buttons below the comment editor"
|
|
216
|
+
)),
|
|
217
|
+
supportsSubmenus: true,
|
|
218
|
+
proposed: "contribCommentThreadAdditionalMenu"
|
|
219
|
+
}, {
|
|
220
|
+
key: "comments/commentThread/title/context",
|
|
221
|
+
id: MenuId.CommentThreadTitleContext,
|
|
222
|
+
description: ( localize(
|
|
223
|
+
14008,
|
|
224
|
+
"The contributed comment thread title's peek context menu, rendered as a right click menu on the comment thread's peek title."
|
|
225
|
+
)),
|
|
226
|
+
proposed: "contribCommentPeekContext"
|
|
227
|
+
}, {
|
|
228
|
+
key: "comments/comment/title",
|
|
229
|
+
id: MenuId.CommentTitle,
|
|
230
|
+
description: ( localize(14009, "The contributed comment title menu"))
|
|
231
|
+
}, {
|
|
232
|
+
key: "comments/comment/context",
|
|
233
|
+
id: MenuId.CommentActions,
|
|
234
|
+
description: ( localize(
|
|
235
|
+
14010,
|
|
236
|
+
"The contributed comment context menu, rendered as buttons below the comment editor"
|
|
237
|
+
)),
|
|
238
|
+
supportsSubmenus: false
|
|
239
|
+
}, {
|
|
240
|
+
key: "comments/commentThread/comment/context",
|
|
241
|
+
id: MenuId.CommentThreadCommentContext,
|
|
242
|
+
description: ( localize(
|
|
243
|
+
14011,
|
|
244
|
+
"The contributed comment context menu, rendered as a right click menu on the an individual comment in the comment thread's peek view."
|
|
245
|
+
)),
|
|
246
|
+
proposed: "contribCommentPeekContext"
|
|
247
|
+
}, {
|
|
248
|
+
key: "commentsView/commentThread/context",
|
|
249
|
+
id: MenuId.CommentsViewThreadActions,
|
|
250
|
+
description: ( localize(14012, "The contributed comment thread context menu in the comments view")),
|
|
251
|
+
proposed: "contribCommentsViewThreadMenus"
|
|
252
|
+
}, {
|
|
253
|
+
key: "notebook/toolbar",
|
|
254
|
+
id: MenuId.NotebookToolbar,
|
|
255
|
+
description: ( localize(14013, "The contributed notebook toolbar menu"))
|
|
256
|
+
}, {
|
|
257
|
+
key: "notebook/kernelSource",
|
|
258
|
+
id: MenuId.NotebookKernelSource,
|
|
259
|
+
description: ( localize(14014, "The contributed notebook kernel sources menu")),
|
|
260
|
+
proposed: "notebookKernelSource"
|
|
261
|
+
}, {
|
|
262
|
+
key: "notebook/cell/title",
|
|
263
|
+
id: MenuId.NotebookCellTitle,
|
|
264
|
+
description: ( localize(14015, "The contributed notebook cell title menu"))
|
|
265
|
+
}, {
|
|
266
|
+
key: "notebook/cell/execute",
|
|
267
|
+
id: MenuId.NotebookCellExecute,
|
|
268
|
+
description: ( localize(14016, "The contributed notebook cell execution menu"))
|
|
269
|
+
}, {
|
|
270
|
+
key: "interactive/toolbar",
|
|
271
|
+
id: MenuId.InteractiveToolbar,
|
|
272
|
+
description: ( localize(14017, "The contributed interactive toolbar menu"))
|
|
273
|
+
}, {
|
|
274
|
+
key: "interactive/cell/title",
|
|
275
|
+
id: MenuId.InteractiveCellTitle,
|
|
276
|
+
description: ( localize(14018, "The contributed interactive cell title menu"))
|
|
277
|
+
}, {
|
|
278
|
+
key: "issue/reporter",
|
|
279
|
+
id: MenuId.IssueReporter,
|
|
280
|
+
description: ( localize(14019, "The contributed issue reporter menu"))
|
|
281
|
+
}, {
|
|
282
|
+
key: "testing/item/context",
|
|
283
|
+
id: MenuId.TestItem,
|
|
284
|
+
description: ( localize(14020, "The contributed test item menu"))
|
|
285
|
+
}, {
|
|
286
|
+
key: "testing/item/gutter",
|
|
287
|
+
id: MenuId.TestItemGutter,
|
|
288
|
+
description: ( localize(14021, "The menu for a gutter decoration for a test item"))
|
|
289
|
+
}, {
|
|
290
|
+
key: "testing/profiles/context",
|
|
291
|
+
id: MenuId.TestProfilesContext,
|
|
292
|
+
description: ( localize(14022, "The menu for configuring testing profiles."))
|
|
293
|
+
}, {
|
|
294
|
+
key: "testing/item/result",
|
|
295
|
+
id: MenuId.TestPeekElement,
|
|
296
|
+
description: ( localize(14023, "The menu for an item in the Test Results view or peek."))
|
|
297
|
+
}, {
|
|
298
|
+
key: "testing/message/context",
|
|
299
|
+
id: MenuId.TestMessageContext,
|
|
300
|
+
description: ( localize(
|
|
301
|
+
14024,
|
|
302
|
+
"A prominent button overlaying editor content where the message is displayed"
|
|
303
|
+
))
|
|
304
|
+
}, {
|
|
305
|
+
key: "testing/message/content",
|
|
306
|
+
id: MenuId.TestMessageContent,
|
|
307
|
+
description: ( localize(14025, "Context menu for the message in the results tree"))
|
|
308
|
+
}, {
|
|
309
|
+
key: "extension/context",
|
|
310
|
+
id: MenuId.ExtensionContext,
|
|
311
|
+
description: ( localize(14026, "The extension context menu"))
|
|
312
|
+
}, {
|
|
313
|
+
key: "timeline/title",
|
|
314
|
+
id: MenuId.TimelineTitle,
|
|
315
|
+
description: ( localize(14027, "The Timeline view title menu"))
|
|
316
|
+
}, {
|
|
317
|
+
key: "timeline/item/context",
|
|
318
|
+
id: MenuId.TimelineItemContext,
|
|
319
|
+
description: ( localize(14028, "The Timeline view item context menu"))
|
|
320
|
+
}, {
|
|
321
|
+
key: "ports/item/context",
|
|
322
|
+
id: MenuId.TunnelContext,
|
|
323
|
+
description: ( localize(14029, "The Ports view item context menu"))
|
|
324
|
+
}, {
|
|
325
|
+
key: "ports/item/origin/inline",
|
|
326
|
+
id: MenuId.TunnelOriginInline,
|
|
327
|
+
description: ( localize(14030, "The Ports view item origin inline menu"))
|
|
328
|
+
}, {
|
|
329
|
+
key: "ports/item/port/inline",
|
|
330
|
+
id: MenuId.TunnelPortInline,
|
|
331
|
+
description: ( localize(14031, "The Ports view item port inline menu"))
|
|
332
|
+
}, {
|
|
333
|
+
key: "file/newFile",
|
|
334
|
+
id: MenuId.NewFile,
|
|
335
|
+
description: ( localize(
|
|
336
|
+
14032,
|
|
337
|
+
"The 'New File...' quick pick, shown on welcome page and File menu."
|
|
338
|
+
)),
|
|
339
|
+
supportsSubmenus: false
|
|
340
|
+
}, {
|
|
341
|
+
key: "webview/context",
|
|
342
|
+
id: MenuId.WebviewContext,
|
|
343
|
+
description: ( localize(14033, "The webview context menu"))
|
|
344
|
+
}, {
|
|
345
|
+
key: "file/share",
|
|
346
|
+
id: MenuId.MenubarShare,
|
|
347
|
+
description: ( localize(14034, "Share submenu shown in the top level File menu.")),
|
|
348
|
+
proposed: "contribShareMenu"
|
|
349
|
+
}, {
|
|
350
|
+
key: "editor/inlineCompletions/actions",
|
|
351
|
+
id: MenuId.InlineCompletionsActions,
|
|
352
|
+
description: ( localize(14035, "The actions shown when hovering on an inline completion")),
|
|
353
|
+
supportsSubmenus: false,
|
|
354
|
+
proposed: "inlineCompletionsAdditions"
|
|
355
|
+
}, {
|
|
356
|
+
key: "editor/content",
|
|
357
|
+
id: MenuId.EditorContent,
|
|
358
|
+
description: ( localize(14036, "The prominent button in an editor, overlays its content")),
|
|
359
|
+
proposed: "contribEditorContentMenu"
|
|
360
|
+
}, {
|
|
361
|
+
key: "editor/lineNumber/context",
|
|
362
|
+
id: MenuId.EditorLineNumberContext,
|
|
363
|
+
description: ( localize(14037, "The contributed editor line number context menu"))
|
|
364
|
+
}, {
|
|
365
|
+
key: "mergeEditor/result/title",
|
|
366
|
+
id: MenuId.MergeInputResultToolbar,
|
|
367
|
+
description: ( localize(14038, "The result toolbar of the merge editor")),
|
|
368
|
+
proposed: "contribMergeEditorMenus"
|
|
369
|
+
}, {
|
|
370
|
+
key: "multiDiffEditor/content",
|
|
371
|
+
id: MenuId.MultiDiffEditorContent,
|
|
372
|
+
description: ( localize(14039, "A prominent button overlaying the multi diff editor")),
|
|
373
|
+
proposed: "contribEditorContentMenu"
|
|
374
|
+
}, {
|
|
375
|
+
key: "multiDiffEditor/resource/title",
|
|
376
|
+
id: MenuId.MultiDiffEditorFileToolbar,
|
|
377
|
+
description: ( localize(14040, "The resource toolbar in the multi diff editor")),
|
|
378
|
+
proposed: "contribMultiDiffEditorMenus"
|
|
379
|
+
}, {
|
|
380
|
+
key: "diffEditor/gutter/hunk",
|
|
381
|
+
id: MenuId.DiffEditorHunkToolbar,
|
|
382
|
+
description: ( localize(14041, "The gutter toolbar in the diff editor")),
|
|
383
|
+
proposed: "contribDiffEditorGutterToolBarMenus"
|
|
384
|
+
}, {
|
|
385
|
+
key: "diffEditor/gutter/selection",
|
|
386
|
+
id: MenuId.DiffEditorSelectionToolbar,
|
|
387
|
+
description: ( localize(14041, "The gutter toolbar in the diff editor")),
|
|
388
|
+
proposed: "contribDiffEditorGutterToolBarMenus"
|
|
389
|
+
}, {
|
|
390
|
+
key: "searchPanel/aiResults/commands",
|
|
391
|
+
id: MenuId.SearchActionMenu,
|
|
392
|
+
description: ( localize(
|
|
393
|
+
14042,
|
|
394
|
+
"The commands that will contribute to the menu rendered as buttons next to the AI search title"
|
|
395
|
+
))
|
|
396
|
+
}, {
|
|
397
|
+
key: "editor/context/chat",
|
|
398
|
+
id: MenuId.ChatTextEditorMenu,
|
|
399
|
+
description: ( localize(14043, "The Chat submenu in the text editor context menu.")),
|
|
400
|
+
supportsSubmenus: false,
|
|
401
|
+
proposed: "chatParticipantPrivate"
|
|
402
|
+
}, {
|
|
403
|
+
key: "chat/input/editing/sessionToolbar",
|
|
404
|
+
id: MenuId.ChatEditingSessionChangesToolbar,
|
|
405
|
+
description: ( localize(14044, "The Chat Editing widget toolbar menu for session changes.")),
|
|
406
|
+
proposed: "chatSessionsProvider"
|
|
407
|
+
}, {
|
|
408
|
+
key: "chat/chatSessions",
|
|
409
|
+
id: MenuId.AgentSessionsContext,
|
|
410
|
+
description: ( localize(14045, "The Chat Sessions menu.")),
|
|
411
|
+
supportsSubmenus: false,
|
|
412
|
+
proposed: "chatSessionsProvider"
|
|
413
|
+
}, {
|
|
414
|
+
key: "chatSessions/newSession",
|
|
415
|
+
id: MenuId.AgentSessionsCreateSubMenu,
|
|
416
|
+
description: ( localize(14046, "Menu for new chat sessions.")),
|
|
417
|
+
supportsSubmenus: false,
|
|
418
|
+
proposed: "chatSessionsProvider"
|
|
419
|
+
}, {
|
|
420
|
+
key: "chat/multiDiff/context",
|
|
421
|
+
id: MenuId.ChatMultiDiffContext,
|
|
422
|
+
description: ( localize(14047, "The Chat Multi-Diff context menu.")),
|
|
423
|
+
supportsSubmenus: false,
|
|
424
|
+
proposed: "chatSessionsProvider"
|
|
425
|
+
}, {
|
|
426
|
+
key: "chat/editor/inlineGutter",
|
|
427
|
+
id: MenuId.ChatEditorInlineGutter,
|
|
428
|
+
description: ( localize(14048, "The inline gutter menu in the chat editor.")),
|
|
429
|
+
supportsSubmenus: false,
|
|
430
|
+
proposed: "contribChatEditorInlineGutterMenu"
|
|
431
|
+
}, {
|
|
432
|
+
key: "chat/contextUsage/actions",
|
|
433
|
+
id: MenuId.ChatContextUsageActions,
|
|
434
|
+
description: ( localize(14049, "Actions in the chat context usage details popup.")),
|
|
435
|
+
proposed: "chatParticipantAdditions"
|
|
436
|
+
}];
|
|
511
437
|
var schema;
|
|
512
|
-
(function
|
|
438
|
+
(function(schema) {
|
|
513
439
|
function isMenuItem(item) {
|
|
514
|
-
return typeof item.command ===
|
|
440
|
+
return typeof item.command === "string";
|
|
515
441
|
}
|
|
516
442
|
schema.isMenuItem = isMenuItem;
|
|
517
443
|
function isValidMenuItem(item, collector) {
|
|
518
|
-
if (typeof item.command !==
|
|
444
|
+
if (typeof item.command !== "string") {
|
|
519
445
|
collector.error(( localize(
|
|
520
|
-
|
|
446
|
+
14050,
|
|
521
447
|
"property `{0}` is mandatory and must be of type `string`",
|
|
522
|
-
|
|
448
|
+
"command"
|
|
523
449
|
)));
|
|
524
450
|
return false;
|
|
525
451
|
}
|
|
526
|
-
if (item.alt && typeof item.alt !==
|
|
527
|
-
collector.error(( localize(
|
|
452
|
+
if (item.alt && typeof item.alt !== "string") {
|
|
453
|
+
collector.error(( localize(14051, "property `{0}` can be omitted or must be of type `string`", "alt")));
|
|
528
454
|
return false;
|
|
529
455
|
}
|
|
530
|
-
if (item.when && typeof item.when !==
|
|
531
|
-
collector.error(( localize(
|
|
456
|
+
if (item.when && typeof item.when !== "string") {
|
|
457
|
+
collector.error(( localize(14051, "property `{0}` can be omitted or must be of type `string`", "when")));
|
|
532
458
|
return false;
|
|
533
459
|
}
|
|
534
|
-
if (item.group && typeof item.group !==
|
|
460
|
+
if (item.group && typeof item.group !== "string") {
|
|
535
461
|
collector.error(( localize(
|
|
536
|
-
|
|
462
|
+
14051,
|
|
537
463
|
"property `{0}` can be omitted or must be of type `string`",
|
|
538
|
-
|
|
464
|
+
"group"
|
|
539
465
|
)));
|
|
540
466
|
return false;
|
|
541
467
|
}
|
|
@@ -543,23 +469,23 @@ var schema;
|
|
|
543
469
|
}
|
|
544
470
|
schema.isValidMenuItem = isValidMenuItem;
|
|
545
471
|
function isValidSubmenuItem(item, collector) {
|
|
546
|
-
if (typeof item.submenu !==
|
|
472
|
+
if (typeof item.submenu !== "string") {
|
|
547
473
|
collector.error(( localize(
|
|
548
|
-
|
|
474
|
+
14050,
|
|
549
475
|
"property `{0}` is mandatory and must be of type `string`",
|
|
550
|
-
|
|
476
|
+
"submenu"
|
|
551
477
|
)));
|
|
552
478
|
return false;
|
|
553
479
|
}
|
|
554
|
-
if (item.when && typeof item.when !==
|
|
555
|
-
collector.error(( localize(
|
|
480
|
+
if (item.when && typeof item.when !== "string") {
|
|
481
|
+
collector.error(( localize(14051, "property `{0}` can be omitted or must be of type `string`", "when")));
|
|
556
482
|
return false;
|
|
557
483
|
}
|
|
558
|
-
if (item.group && typeof item.group !==
|
|
484
|
+
if (item.group && typeof item.group !== "string") {
|
|
559
485
|
collector.error(( localize(
|
|
560
|
-
|
|
486
|
+
14051,
|
|
561
487
|
"property `{0}` can be omitted or must be of type `string`",
|
|
562
|
-
|
|
488
|
+
"group"
|
|
563
489
|
)));
|
|
564
490
|
return false;
|
|
565
491
|
}
|
|
@@ -568,7 +494,7 @@ var schema;
|
|
|
568
494
|
schema.isValidSubmenuItem = isValidSubmenuItem;
|
|
569
495
|
function isValidItems(items, collector) {
|
|
570
496
|
if (!Array.isArray(items)) {
|
|
571
|
-
collector.error(( localize(
|
|
497
|
+
collector.error(( localize(14052, "submenu items must be an array")));
|
|
572
498
|
return false;
|
|
573
499
|
}
|
|
574
500
|
for (const item of items) {
|
|
@@ -576,8 +502,7 @@ var schema;
|
|
|
576
502
|
if (!isValidMenuItem(item, collector)) {
|
|
577
503
|
return false;
|
|
578
504
|
}
|
|
579
|
-
}
|
|
580
|
-
else {
|
|
505
|
+
} else {
|
|
581
506
|
if (!isValidSubmenuItem(item, collector)) {
|
|
582
507
|
return false;
|
|
583
508
|
}
|
|
@@ -587,155 +512,158 @@ var schema;
|
|
|
587
512
|
}
|
|
588
513
|
schema.isValidItems = isValidItems;
|
|
589
514
|
function isValidSubmenu(submenu, collector) {
|
|
590
|
-
if (typeof submenu !==
|
|
591
|
-
collector.error(( localize(
|
|
515
|
+
if (typeof submenu !== "object") {
|
|
516
|
+
collector.error(( localize(14053, "submenu items must be an object")));
|
|
592
517
|
return false;
|
|
593
518
|
}
|
|
594
|
-
if (typeof submenu.id !==
|
|
595
|
-
collector.error(( localize(
|
|
519
|
+
if (typeof submenu.id !== "string") {
|
|
520
|
+
collector.error(( localize(14050, "property `{0}` is mandatory and must be of type `string`", "id")));
|
|
596
521
|
return false;
|
|
597
522
|
}
|
|
598
|
-
if (typeof submenu.label !==
|
|
599
|
-
collector.error(( localize(
|
|
523
|
+
if (typeof submenu.label !== "string") {
|
|
524
|
+
collector.error(( localize(14050, "property `{0}` is mandatory and must be of type `string`", "label")));
|
|
600
525
|
return false;
|
|
601
526
|
}
|
|
602
527
|
return true;
|
|
603
528
|
}
|
|
604
529
|
schema.isValidSubmenu = isValidSubmenu;
|
|
605
530
|
const menuItem = {
|
|
606
|
-
type:
|
|
607
|
-
required: [
|
|
531
|
+
type: "object",
|
|
532
|
+
required: ["command"],
|
|
608
533
|
properties: {
|
|
609
534
|
command: {
|
|
610
535
|
description: ( localize(
|
|
611
|
-
|
|
612
|
-
|
|
536
|
+
14054,
|
|
537
|
+
"Identifier of the command to execute. The command must be declared in the 'commands'-section"
|
|
613
538
|
)),
|
|
614
|
-
type:
|
|
539
|
+
type: "string"
|
|
615
540
|
},
|
|
616
541
|
alt: {
|
|
617
542
|
description: ( localize(
|
|
618
|
-
|
|
619
|
-
|
|
543
|
+
14055,
|
|
544
|
+
"Identifier of an alternative command to execute. The command must be declared in the 'commands'-section"
|
|
620
545
|
)),
|
|
621
|
-
type:
|
|
546
|
+
type: "string"
|
|
622
547
|
},
|
|
623
548
|
when: {
|
|
624
|
-
description: ( localize(
|
|
625
|
-
type:
|
|
549
|
+
description: ( localize(14056, "Condition which must be true to show this item")),
|
|
550
|
+
type: "string"
|
|
626
551
|
},
|
|
627
552
|
group: {
|
|
628
|
-
description: ( localize(
|
|
629
|
-
type:
|
|
553
|
+
description: ( localize(14057, "Group into which this item belongs")),
|
|
554
|
+
type: "string"
|
|
630
555
|
}
|
|
631
556
|
}
|
|
632
557
|
};
|
|
633
558
|
const submenuItem = {
|
|
634
|
-
type:
|
|
635
|
-
required: [
|
|
559
|
+
type: "object",
|
|
560
|
+
required: ["submenu"],
|
|
636
561
|
properties: {
|
|
637
562
|
submenu: {
|
|
638
|
-
description: ( localize(
|
|
639
|
-
type:
|
|
563
|
+
description: ( localize(14058, "Identifier of the submenu to display in this item.")),
|
|
564
|
+
type: "string"
|
|
640
565
|
},
|
|
641
566
|
when: {
|
|
642
|
-
description: ( localize(
|
|
643
|
-
type:
|
|
567
|
+
description: ( localize(14056, "Condition which must be true to show this item")),
|
|
568
|
+
type: "string"
|
|
644
569
|
},
|
|
645
570
|
group: {
|
|
646
|
-
description: ( localize(
|
|
647
|
-
type:
|
|
571
|
+
description: ( localize(14057, "Group into which this item belongs")),
|
|
572
|
+
type: "string"
|
|
648
573
|
}
|
|
649
574
|
}
|
|
650
575
|
};
|
|
651
576
|
const submenu = {
|
|
652
|
-
type:
|
|
653
|
-
required: [
|
|
577
|
+
type: "object",
|
|
578
|
+
required: ["id", "label"],
|
|
654
579
|
properties: {
|
|
655
580
|
id: {
|
|
656
|
-
description: ( localize(
|
|
657
|
-
type:
|
|
581
|
+
description: ( localize(14059, "Identifier of the menu to display as a submenu.")),
|
|
582
|
+
type: "string"
|
|
658
583
|
},
|
|
659
584
|
label: {
|
|
660
|
-
description: ( localize(
|
|
661
|
-
type:
|
|
585
|
+
description: ( localize(14060, "The label of the menu item which leads to this submenu.")),
|
|
586
|
+
type: "string"
|
|
662
587
|
},
|
|
663
588
|
icon: {
|
|
664
589
|
description: ( localize(
|
|
665
|
-
|
|
666
|
-
|
|
590
|
+
14061,
|
|
591
|
+
"(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)\""
|
|
667
592
|
)),
|
|
668
593
|
anyOf: [{
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
type: 'string'
|
|
681
|
-
}
|
|
594
|
+
type: "string"
|
|
595
|
+
}, {
|
|
596
|
+
type: "object",
|
|
597
|
+
properties: {
|
|
598
|
+
light: {
|
|
599
|
+
description: ( localize(14062, "Icon path when a light theme is used")),
|
|
600
|
+
type: "string"
|
|
601
|
+
},
|
|
602
|
+
dark: {
|
|
603
|
+
description: ( localize(14063, "Icon path when a dark theme is used")),
|
|
604
|
+
type: "string"
|
|
682
605
|
}
|
|
683
|
-
}
|
|
606
|
+
}
|
|
607
|
+
}]
|
|
684
608
|
}
|
|
685
609
|
}
|
|
686
610
|
};
|
|
687
611
|
schema.menusContribution = {
|
|
688
|
-
description: ( localize(
|
|
689
|
-
type:
|
|
612
|
+
description: ( localize(14064, "Contributes menu items to the editor")),
|
|
613
|
+
type: "object",
|
|
690
614
|
properties: index(apiMenus, menu => menu.key, menu => ({
|
|
691
615
|
markdownDescription: menu.proposed ? ( localize(
|
|
692
|
-
|
|
616
|
+
14065,
|
|
693
617
|
"Proposed API, requires `enabledApiProposal: [\"{0}\"]` - {1}",
|
|
694
618
|
menu.proposed,
|
|
695
619
|
menu.description
|
|
696
620
|
)) : menu.description,
|
|
697
|
-
type:
|
|
698
|
-
items: menu.supportsSubmenus === false ? menuItem : {
|
|
621
|
+
type: "array",
|
|
622
|
+
items: menu.supportsSubmenus === false ? menuItem : {
|
|
623
|
+
oneOf: [menuItem, submenuItem]
|
|
624
|
+
}
|
|
699
625
|
})),
|
|
700
626
|
additionalProperties: {
|
|
701
|
-
description:
|
|
702
|
-
type:
|
|
703
|
-
items: {
|
|
627
|
+
description: "Submenu",
|
|
628
|
+
type: "array",
|
|
629
|
+
items: {
|
|
630
|
+
oneOf: [menuItem, submenuItem]
|
|
631
|
+
}
|
|
704
632
|
}
|
|
705
633
|
};
|
|
706
634
|
schema.submenusContribution = {
|
|
707
|
-
description: ( localize(
|
|
708
|
-
type:
|
|
635
|
+
description: ( localize(14066, "Contributes submenu items to the editor")),
|
|
636
|
+
type: "array",
|
|
709
637
|
items: submenu
|
|
710
638
|
};
|
|
711
639
|
function isValidCommand(command, collector) {
|
|
712
640
|
if (!command) {
|
|
713
|
-
collector.error(( localize(
|
|
641
|
+
collector.error(( localize(14067, "expected non-empty value.")));
|
|
714
642
|
return false;
|
|
715
643
|
}
|
|
716
644
|
if (isFalsyOrWhitespace(command.command)) {
|
|
717
645
|
collector.error(( localize(
|
|
718
|
-
|
|
646
|
+
14050,
|
|
719
647
|
"property `{0}` is mandatory and must be of type `string`",
|
|
720
|
-
|
|
648
|
+
"command"
|
|
721
649
|
)));
|
|
722
650
|
return false;
|
|
723
651
|
}
|
|
724
|
-
if (!isValidLocalizedString(command.title, collector,
|
|
652
|
+
if (!isValidLocalizedString(command.title, collector, "title")) {
|
|
725
653
|
return false;
|
|
726
654
|
}
|
|
727
|
-
if (command.shortTitle && !isValidLocalizedString(command.shortTitle, collector,
|
|
655
|
+
if (command.shortTitle && !isValidLocalizedString(command.shortTitle, collector, "shortTitle")) {
|
|
728
656
|
return false;
|
|
729
657
|
}
|
|
730
|
-
if (command.enablement && typeof command.enablement !==
|
|
658
|
+
if (command.enablement && typeof command.enablement !== "string") {
|
|
731
659
|
collector.error(( localize(
|
|
732
|
-
|
|
660
|
+
14051,
|
|
733
661
|
"property `{0}` can be omitted or must be of type `string`",
|
|
734
|
-
|
|
662
|
+
"precondition"
|
|
735
663
|
)));
|
|
736
664
|
return false;
|
|
737
665
|
}
|
|
738
|
-
if (command.category && !isValidLocalizedString(command.category, collector,
|
|
666
|
+
if (command.category && !isValidLocalizedString(command.category, collector, "category")) {
|
|
739
667
|
return false;
|
|
740
668
|
}
|
|
741
669
|
if (!isValidIcon(command.icon, collector)) {
|
|
@@ -745,41 +673,38 @@ var schema;
|
|
|
745
673
|
}
|
|
746
674
|
schema.isValidCommand = isValidCommand;
|
|
747
675
|
function isValidIcon(icon, collector) {
|
|
748
|
-
if (typeof icon ===
|
|
676
|
+
if (typeof icon === "undefined") {
|
|
749
677
|
return true;
|
|
750
678
|
}
|
|
751
|
-
if (typeof icon ===
|
|
679
|
+
if (typeof icon === "string") {
|
|
752
680
|
return true;
|
|
753
|
-
}
|
|
754
|
-
else if (typeof icon.dark === 'string' && typeof icon.light === 'string') {
|
|
681
|
+
} else if (typeof icon.dark === "string" && typeof icon.light === "string") {
|
|
755
682
|
return true;
|
|
756
683
|
}
|
|
757
684
|
collector.error(( localize(
|
|
758
|
-
|
|
685
|
+
14068,
|
|
759
686
|
"property `icon` can be omitted or must be either a string or a literal like `{dark, light}`"
|
|
760
687
|
)));
|
|
761
688
|
return false;
|
|
762
689
|
}
|
|
763
690
|
function isValidLocalizedString(localized, collector, propertyName) {
|
|
764
|
-
if (typeof localized ===
|
|
691
|
+
if (typeof localized === "undefined") {
|
|
765
692
|
collector.error(( localize(
|
|
766
|
-
|
|
693
|
+
14069,
|
|
767
694
|
"property `{0}` is mandatory and must be of type `string` or `object`",
|
|
768
695
|
propertyName
|
|
769
696
|
)));
|
|
770
697
|
return false;
|
|
771
|
-
}
|
|
772
|
-
else if (typeof localized === 'string' && isFalsyOrWhitespace(localized)) {
|
|
698
|
+
} else if (typeof localized === "string" && isFalsyOrWhitespace(localized)) {
|
|
773
699
|
collector.error(( localize(
|
|
774
|
-
|
|
700
|
+
14050,
|
|
775
701
|
"property `{0}` is mandatory and must be of type `string`",
|
|
776
702
|
propertyName
|
|
777
703
|
)));
|
|
778
704
|
return false;
|
|
779
|
-
}
|
|
780
|
-
else if (typeof localized !== 'string' && (isFalsyOrWhitespace(localized.original) || isFalsyOrWhitespace(localized.value))) {
|
|
705
|
+
} else if (typeof localized !== "string" && (isFalsyOrWhitespace(localized.original) || isFalsyOrWhitespace(localized.value))) {
|
|
781
706
|
collector.error(( localize(
|
|
782
|
-
|
|
707
|
+
14070,
|
|
783
708
|
"properties `{0}` and `{1}` are mandatory and must be of type `string`",
|
|
784
709
|
`${propertyName}.value`,
|
|
785
710
|
`${propertyName}.original`
|
|
@@ -789,78 +714,74 @@ var schema;
|
|
|
789
714
|
return true;
|
|
790
715
|
}
|
|
791
716
|
const commandType = {
|
|
792
|
-
type:
|
|
793
|
-
required: [
|
|
717
|
+
type: "object",
|
|
718
|
+
required: ["command", "title"],
|
|
794
719
|
properties: {
|
|
795
720
|
command: {
|
|
796
|
-
description: ( localize(
|
|
797
|
-
type:
|
|
721
|
+
description: ( localize(14071, "Identifier of the command to execute")),
|
|
722
|
+
type: "string"
|
|
798
723
|
},
|
|
799
724
|
title: {
|
|
800
|
-
description: ( localize(
|
|
801
|
-
type:
|
|
725
|
+
description: ( localize(14072, "Title by which the command is represented in the UI")),
|
|
726
|
+
type: "string"
|
|
802
727
|
},
|
|
803
728
|
shortTitle: {
|
|
804
729
|
markdownDescription: ( localize(
|
|
805
|
-
|
|
806
|
-
|
|
730
|
+
14073,
|
|
731
|
+
"(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."
|
|
807
732
|
)),
|
|
808
|
-
type:
|
|
733
|
+
type: "string"
|
|
809
734
|
},
|
|
810
735
|
category: {
|
|
811
736
|
description: ( localize(
|
|
812
|
-
|
|
813
|
-
|
|
737
|
+
14074,
|
|
738
|
+
"(Optional) Category string by which the command is grouped in the UI"
|
|
814
739
|
)),
|
|
815
|
-
type:
|
|
740
|
+
type: "string"
|
|
816
741
|
},
|
|
817
742
|
enablement: {
|
|
818
743
|
description: ( localize(
|
|
819
|
-
|
|
820
|
-
|
|
744
|
+
14075,
|
|
745
|
+
"(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."
|
|
821
746
|
)),
|
|
822
|
-
type:
|
|
747
|
+
type: "string"
|
|
823
748
|
},
|
|
824
749
|
icon: {
|
|
825
750
|
description: ( localize(
|
|
826
|
-
|
|
827
|
-
|
|
751
|
+
14076,
|
|
752
|
+
"(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)\""
|
|
828
753
|
)),
|
|
829
754
|
anyOf: [{
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
type: 'string'
|
|
842
|
-
}
|
|
755
|
+
type: "string"
|
|
756
|
+
}, {
|
|
757
|
+
type: "object",
|
|
758
|
+
properties: {
|
|
759
|
+
light: {
|
|
760
|
+
description: ( localize(14077, "Icon path when a light theme is used")),
|
|
761
|
+
type: "string"
|
|
762
|
+
},
|
|
763
|
+
dark: {
|
|
764
|
+
description: ( localize(14078, "Icon path when a dark theme is used")),
|
|
765
|
+
type: "string"
|
|
843
766
|
}
|
|
844
|
-
}
|
|
767
|
+
}
|
|
768
|
+
}]
|
|
845
769
|
}
|
|
846
770
|
}
|
|
847
771
|
};
|
|
848
772
|
schema.commandsContribution = {
|
|
849
|
-
description: ( localize(
|
|
850
|
-
oneOf: [
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
items: commandType
|
|
855
|
-
}
|
|
856
|
-
]
|
|
773
|
+
description: ( localize(14079, "Contributes commands to the command palette.")),
|
|
774
|
+
oneOf: [commandType, {
|
|
775
|
+
type: "array",
|
|
776
|
+
items: commandType
|
|
777
|
+
}]
|
|
857
778
|
};
|
|
858
779
|
})(schema || (schema = {}));
|
|
859
780
|
const _commandRegistrations = ( new DisposableStore());
|
|
860
781
|
const commandsExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
861
|
-
extensionPoint:
|
|
782
|
+
extensionPoint: "commands",
|
|
862
783
|
jsonSchema: schema.commandsContribution,
|
|
863
|
-
activationEventsGenerator: function*
|
|
784
|
+
activationEventsGenerator: function*(contribs) {
|
|
864
785
|
for (const contrib of contribs) {
|
|
865
786
|
if (contrib.command) {
|
|
866
787
|
yield `onCommand:${contrib.command}`;
|
|
@@ -873,13 +794,22 @@ commandsExtensionPoint.setHandler(extensions => {
|
|
|
873
794
|
if (!schema.isValidCommand(userFriendlyCommand, extension.collector)) {
|
|
874
795
|
return;
|
|
875
796
|
}
|
|
876
|
-
const {
|
|
797
|
+
const {
|
|
798
|
+
icon,
|
|
799
|
+
enablement,
|
|
800
|
+
category,
|
|
801
|
+
title,
|
|
802
|
+
shortTitle,
|
|
803
|
+
command
|
|
804
|
+
} = userFriendlyCommand;
|
|
877
805
|
let absoluteIcon;
|
|
878
806
|
if (icon) {
|
|
879
|
-
if (typeof icon ===
|
|
880
|
-
absoluteIcon = ThemeIcon.fromString(icon) ?? {
|
|
881
|
-
|
|
882
|
-
|
|
807
|
+
if (typeof icon === "string") {
|
|
808
|
+
absoluteIcon = ThemeIcon.fromString(icon) ?? {
|
|
809
|
+
dark: joinPath(extension.description.extensionLocation, icon),
|
|
810
|
+
light: joinPath(extension.description.extensionLocation, icon)
|
|
811
|
+
};
|
|
812
|
+
} else {
|
|
883
813
|
absoluteIcon = {
|
|
884
814
|
dark: joinPath(extension.description.extensionLocation, icon.dark),
|
|
885
815
|
light: joinPath(extension.description.extensionLocation, icon.light)
|
|
@@ -890,21 +820,23 @@ commandsExtensionPoint.setHandler(extensions => {
|
|
|
890
820
|
if (existingCmd) {
|
|
891
821
|
if (existingCmd.source) {
|
|
892
822
|
extension.collector.info(( localize(
|
|
893
|
-
|
|
823
|
+
14080,
|
|
894
824
|
"Command `{0}` already registered by {1} ({2})",
|
|
895
825
|
userFriendlyCommand.command,
|
|
896
826
|
existingCmd.source.title,
|
|
897
827
|
existingCmd.source.id
|
|
898
828
|
)));
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
extension.collector.info(( localize(13699, "Command `{0}` already registered", userFriendlyCommand.command)));
|
|
829
|
+
} else {
|
|
830
|
+
extension.collector.info(( localize(14081, "Command `{0}` already registered", userFriendlyCommand.command)));
|
|
902
831
|
}
|
|
903
832
|
}
|
|
904
833
|
_commandRegistrations.add(MenuRegistry.addCommand({
|
|
905
834
|
id: command,
|
|
906
835
|
title,
|
|
907
|
-
source: {
|
|
836
|
+
source: {
|
|
837
|
+
id: extension.description.identifier.value,
|
|
838
|
+
title: extension.description.displayName ?? extension.description.name
|
|
839
|
+
},
|
|
908
840
|
shortTitle,
|
|
909
841
|
tooltip: title,
|
|
910
842
|
category,
|
|
@@ -914,52 +846,57 @@ commandsExtensionPoint.setHandler(extensions => {
|
|
|
914
846
|
}
|
|
915
847
|
_commandRegistrations.clear();
|
|
916
848
|
for (const extension of extensions) {
|
|
917
|
-
const {
|
|
849
|
+
const {
|
|
850
|
+
value
|
|
851
|
+
} = extension;
|
|
918
852
|
if (Array.isArray(value)) {
|
|
919
853
|
for (const command of value) {
|
|
920
854
|
handleCommand(command, extension);
|
|
921
855
|
}
|
|
922
|
-
}
|
|
923
|
-
else {
|
|
856
|
+
} else {
|
|
924
857
|
handleCommand(value, extension);
|
|
925
858
|
}
|
|
926
859
|
}
|
|
927
860
|
});
|
|
928
861
|
const _submenus = ( new Map());
|
|
929
862
|
const submenusExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
930
|
-
extensionPoint:
|
|
863
|
+
extensionPoint: "submenus",
|
|
931
864
|
jsonSchema: schema.submenusContribution
|
|
932
865
|
});
|
|
933
866
|
submenusExtensionPoint.setHandler(extensions => {
|
|
934
867
|
_submenus.clear();
|
|
935
868
|
for (const extension of extensions) {
|
|
936
|
-
const {
|
|
869
|
+
const {
|
|
870
|
+
value,
|
|
871
|
+
collector
|
|
872
|
+
} = extension;
|
|
937
873
|
for (const [, submenuInfo] of Object.entries(value)) {
|
|
938
874
|
if (!schema.isValidSubmenu(submenuInfo, collector)) {
|
|
939
875
|
continue;
|
|
940
876
|
}
|
|
941
877
|
if (!submenuInfo.id) {
|
|
942
|
-
collector.warn(( localize(
|
|
878
|
+
collector.warn(( localize(14082, "`{0}` is not a valid submenu identifier", submenuInfo.id)));
|
|
943
879
|
continue;
|
|
944
880
|
}
|
|
945
881
|
if (( _submenus.has(submenuInfo.id))) {
|
|
946
882
|
collector.info(( localize(
|
|
947
|
-
|
|
883
|
+
14083,
|
|
948
884
|
"The `{0}` submenu was already previously registered.",
|
|
949
885
|
submenuInfo.id
|
|
950
886
|
)));
|
|
951
887
|
continue;
|
|
952
888
|
}
|
|
953
889
|
if (!submenuInfo.label) {
|
|
954
|
-
collector.warn(( localize(
|
|
890
|
+
collector.warn(( localize(14084, "`{0}` is not a valid submenu label", submenuInfo.label)));
|
|
955
891
|
continue;
|
|
956
892
|
}
|
|
957
893
|
let absoluteIcon;
|
|
958
894
|
if (submenuInfo.icon) {
|
|
959
|
-
if (typeof submenuInfo.icon ===
|
|
960
|
-
absoluteIcon = ThemeIcon.fromString(submenuInfo.icon) || {
|
|
961
|
-
|
|
962
|
-
|
|
895
|
+
if (typeof submenuInfo.icon === "string") {
|
|
896
|
+
absoluteIcon = ThemeIcon.fromString(submenuInfo.icon) || {
|
|
897
|
+
dark: joinPath(extension.description.extensionLocation, submenuInfo.icon)
|
|
898
|
+
};
|
|
899
|
+
} else {
|
|
963
900
|
absoluteIcon = {
|
|
964
901
|
dark: joinPath(extension.description.extensionLocation, submenuInfo.icon.dark),
|
|
965
902
|
light: joinPath(extension.description.extensionLocation, submenuInfo.icon.light)
|
|
@@ -979,7 +916,7 @@ const _apiMenusByKey = ( new Map(( apiMenus.map(menu => ([menu.key, menu])))));
|
|
|
979
916
|
const _menuRegistrations = ( new DisposableStore());
|
|
980
917
|
const _submenuMenuItems = ( new Map());
|
|
981
918
|
const menusExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
982
|
-
extensionPoint:
|
|
919
|
+
extensionPoint: "menus",
|
|
983
920
|
jsonSchema: schema.menusContribution,
|
|
984
921
|
deps: [submenusExtensionPoint]
|
|
985
922
|
});
|
|
@@ -987,7 +924,10 @@ menusExtensionPoint.setHandler(extensions => {
|
|
|
987
924
|
_menuRegistrations.clear();
|
|
988
925
|
_submenuMenuItems.clear();
|
|
989
926
|
for (const extension of extensions) {
|
|
990
|
-
const {
|
|
927
|
+
const {
|
|
928
|
+
value,
|
|
929
|
+
collector
|
|
930
|
+
} = extension;
|
|
991
931
|
for (const entry of Object.entries(value)) {
|
|
992
932
|
if (!schema.isValidItems(entry[1], collector)) {
|
|
993
933
|
continue;
|
|
@@ -999,7 +939,7 @@ menusExtensionPoint.setHandler(extensions => {
|
|
|
999
939
|
menu = {
|
|
1000
940
|
key: entry[0],
|
|
1001
941
|
id: submenu.id,
|
|
1002
|
-
description:
|
|
942
|
+
description: ""
|
|
1003
943
|
};
|
|
1004
944
|
}
|
|
1005
945
|
}
|
|
@@ -1008,7 +948,7 @@ menusExtensionPoint.setHandler(extensions => {
|
|
|
1008
948
|
}
|
|
1009
949
|
if (menu.proposed && !isProposedApiEnabled(extension.description, menu.proposed)) {
|
|
1010
950
|
collector.error(( localize(
|
|
1011
|
-
|
|
951
|
+
14085,
|
|
1012
952
|
"{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}",
|
|
1013
953
|
entry[0],
|
|
1014
954
|
menu.proposed,
|
|
@@ -1023,7 +963,7 @@ menusExtensionPoint.setHandler(extensions => {
|
|
|
1023
963
|
const alt = menuItem.alt && MenuRegistry.getCommand(menuItem.alt) || undefined;
|
|
1024
964
|
if (!command) {
|
|
1025
965
|
collector.error(( localize(
|
|
1026
|
-
|
|
966
|
+
14086,
|
|
1027
967
|
"Menu item references a command `{0}` which is not defined in the 'commands' section.",
|
|
1028
968
|
menuItem.command
|
|
1029
969
|
)));
|
|
@@ -1031,20 +971,25 @@ menusExtensionPoint.setHandler(extensions => {
|
|
|
1031
971
|
}
|
|
1032
972
|
if (menuItem.alt && !alt) {
|
|
1033
973
|
collector.warn(( localize(
|
|
1034
|
-
|
|
974
|
+
14087,
|
|
1035
975
|
"Menu item references an alt-command `{0}` which is not defined in the 'commands' section.",
|
|
1036
976
|
menuItem.alt
|
|
1037
977
|
)));
|
|
1038
978
|
}
|
|
1039
979
|
if (menuItem.command === menuItem.alt) {
|
|
1040
|
-
collector.info(( localize(
|
|
980
|
+
collector.info(( localize(14088, "Menu item references the same command as default and alt-command")));
|
|
1041
981
|
}
|
|
1042
|
-
item = {
|
|
1043
|
-
|
|
1044
|
-
|
|
982
|
+
item = {
|
|
983
|
+
command,
|
|
984
|
+
alt,
|
|
985
|
+
group: undefined,
|
|
986
|
+
order: undefined,
|
|
987
|
+
when: undefined
|
|
988
|
+
};
|
|
989
|
+
} else {
|
|
1045
990
|
if (menu.supportsSubmenus === false) {
|
|
1046
991
|
collector.error(( localize(
|
|
1047
|
-
|
|
992
|
+
14089,
|
|
1048
993
|
"Menu item references a submenu for a menu which doesn't have submenu support."
|
|
1049
994
|
)));
|
|
1050
995
|
continue;
|
|
@@ -1052,7 +997,7 @@ menusExtensionPoint.setHandler(extensions => {
|
|
|
1052
997
|
const submenu = _submenus.get(menuItem.submenu);
|
|
1053
998
|
if (!submenu) {
|
|
1054
999
|
collector.error(( localize(
|
|
1055
|
-
|
|
1000
|
+
14090,
|
|
1056
1001
|
"Menu item references a submenu `{0}` which is not defined in the 'submenus' section.",
|
|
1057
1002
|
menuItem.submenu
|
|
1058
1003
|
)));
|
|
@@ -1065,7 +1010,7 @@ menusExtensionPoint.setHandler(extensions => {
|
|
|
1065
1010
|
}
|
|
1066
1011
|
if (( submenuRegistrations.has(submenu.id.id))) {
|
|
1067
1012
|
collector.warn(( localize(
|
|
1068
|
-
|
|
1013
|
+
14091,
|
|
1069
1014
|
"The `{0}` submenu was already contributed to the `{1}` menu.",
|
|
1070
1015
|
menuItem.submenu,
|
|
1071
1016
|
entry[0]
|
|
@@ -1073,25 +1018,31 @@ menusExtensionPoint.setHandler(extensions => {
|
|
|
1073
1018
|
continue;
|
|
1074
1019
|
}
|
|
1075
1020
|
submenuRegistrations.add(submenu.id.id);
|
|
1076
|
-
item = {
|
|
1021
|
+
item = {
|
|
1022
|
+
submenu: submenu.id,
|
|
1023
|
+
icon: submenu.icon,
|
|
1024
|
+
title: submenu.label,
|
|
1025
|
+
group: undefined,
|
|
1026
|
+
order: undefined,
|
|
1027
|
+
when: undefined
|
|
1028
|
+
};
|
|
1077
1029
|
}
|
|
1078
1030
|
if (menuItem.group) {
|
|
1079
|
-
const idx = menuItem.group.lastIndexOf(
|
|
1031
|
+
const idx = menuItem.group.lastIndexOf("@");
|
|
1080
1032
|
if (idx > 0) {
|
|
1081
1033
|
item.group = menuItem.group.substr(0, idx);
|
|
1082
1034
|
item.order = Number(menuItem.group.substr(idx + 1)) || undefined;
|
|
1083
|
-
}
|
|
1084
|
-
else {
|
|
1035
|
+
} else {
|
|
1085
1036
|
item.group = menuItem.group;
|
|
1086
1037
|
}
|
|
1087
1038
|
}
|
|
1088
|
-
if (menu.id === MenuId.ViewContainerTitle && !menuItem.when?.includes(
|
|
1039
|
+
if (menu.id === MenuId.ViewContainerTitle && !menuItem.when?.includes("viewContainer == workbench.view.debug")) {
|
|
1089
1040
|
collector.error(( localize(
|
|
1090
|
-
|
|
1041
|
+
14092,
|
|
1091
1042
|
"The {0} menu contribution must check {1} in its {2} clause.",
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1043
|
+
"`viewContainer/title`",
|
|
1044
|
+
"`viewContainer == workbench.view.debug`",
|
|
1045
|
+
"\"when\""
|
|
1095
1046
|
)));
|
|
1096
1047
|
continue;
|
|
1097
1048
|
}
|
|
@@ -1105,7 +1056,7 @@ let CommandsTableRenderer = class CommandsTableRenderer extends Disposable {
|
|
|
1105
1056
|
constructor(_keybindingService) {
|
|
1106
1057
|
super();
|
|
1107
1058
|
this._keybindingService = _keybindingService;
|
|
1108
|
-
this.type =
|
|
1059
|
+
this.type = "table";
|
|
1109
1060
|
}
|
|
1110
1061
|
shouldRender(manifest) {
|
|
1111
1062
|
return !!manifest.contributes?.commands;
|
|
@@ -1121,22 +1072,24 @@ let CommandsTableRenderer = class CommandsTableRenderer extends Disposable {
|
|
|
1121
1072
|
const byId = index(commands, c => c.id);
|
|
1122
1073
|
const menus = manifest.contributes?.menus || {};
|
|
1123
1074
|
const implicitlyOnCommandPalette = index(commands, c => c.id);
|
|
1124
|
-
if (menus[
|
|
1125
|
-
for (const command of menus[
|
|
1075
|
+
if (menus["commandPalette"]) {
|
|
1076
|
+
for (const command of menus["commandPalette"]) {
|
|
1126
1077
|
delete implicitlyOnCommandPalette[command.command];
|
|
1127
1078
|
}
|
|
1128
1079
|
}
|
|
1129
1080
|
if (( Object.keys(implicitlyOnCommandPalette)).length) {
|
|
1130
|
-
if (!menus[
|
|
1131
|
-
menus[
|
|
1081
|
+
if (!menus["commandPalette"]) {
|
|
1082
|
+
menus["commandPalette"] = [];
|
|
1132
1083
|
}
|
|
1133
1084
|
for (const command in implicitlyOnCommandPalette) {
|
|
1134
|
-
menus[
|
|
1085
|
+
menus["commandPalette"].push({
|
|
1086
|
+
command
|
|
1087
|
+
});
|
|
1135
1088
|
}
|
|
1136
1089
|
}
|
|
1137
1090
|
for (const context in menus) {
|
|
1138
1091
|
for (const menu of menus[context]) {
|
|
1139
|
-
if (menu.when ===
|
|
1092
|
+
if (menu.when === "false") {
|
|
1140
1093
|
continue;
|
|
1141
1094
|
}
|
|
1142
1095
|
if (menu.command) {
|
|
@@ -1145,9 +1098,13 @@ let CommandsTableRenderer = class CommandsTableRenderer extends Disposable {
|
|
|
1145
1098
|
if (!command.menus.includes(context)) {
|
|
1146
1099
|
command.menus.push(context);
|
|
1147
1100
|
}
|
|
1148
|
-
}
|
|
1149
|
-
|
|
1150
|
-
|
|
1101
|
+
} else {
|
|
1102
|
+
command = {
|
|
1103
|
+
id: menu.command,
|
|
1104
|
+
title: "",
|
|
1105
|
+
keybindings: [],
|
|
1106
|
+
menus: [context]
|
|
1107
|
+
};
|
|
1151
1108
|
byId[command.id] = command;
|
|
1152
1109
|
commands.push(command);
|
|
1153
1110
|
}
|
|
@@ -1163,65 +1120,62 @@ let CommandsTableRenderer = class CommandsTableRenderer extends Disposable {
|
|
|
1163
1120
|
let command = byId[rawKeybinding.command];
|
|
1164
1121
|
if (command) {
|
|
1165
1122
|
command.keybindings.push(keybinding);
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1123
|
+
} else {
|
|
1124
|
+
command = {
|
|
1125
|
+
id: rawKeybinding.command,
|
|
1126
|
+
title: "",
|
|
1127
|
+
keybindings: [keybinding],
|
|
1128
|
+
menus: []
|
|
1129
|
+
};
|
|
1169
1130
|
byId[command.id] = command;
|
|
1170
1131
|
commands.push(command);
|
|
1171
1132
|
}
|
|
1172
1133
|
});
|
|
1173
1134
|
if (!commands.length) {
|
|
1174
|
-
return {
|
|
1135
|
+
return {
|
|
1136
|
+
data: {
|
|
1137
|
+
headers: [],
|
|
1138
|
+
rows: []
|
|
1139
|
+
},
|
|
1140
|
+
dispose: () => {}
|
|
1141
|
+
};
|
|
1175
1142
|
}
|
|
1176
|
-
const headers = [
|
|
1177
|
-
|
|
1178
|
-
(
|
|
1179
|
-
( localize(13713, "Keyboard Shortcuts")),
|
|
1180
|
-
( localize(13714, "Menu Contexts"))
|
|
1181
|
-
];
|
|
1182
|
-
const rows = ( commands.sort((a, b) => a.id.localeCompare(b.id))
|
|
1183
|
-
.map(command => {
|
|
1184
|
-
return [
|
|
1185
|
-
( new MarkdownString()).appendMarkdown(`\`${command.id}\``),
|
|
1186
|
-
typeof command.title === 'string' ? command.title : command.title.value,
|
|
1187
|
-
command.keybindings,
|
|
1188
|
-
( new MarkdownString()).appendMarkdown(`${( command.menus.sort((a, b) => a.localeCompare(b)).map(menu => `\`${menu}\``)).join(' ')}`),
|
|
1189
|
-
];
|
|
1143
|
+
const headers = [( localize(14093, "ID")), ( localize(14094, "Title")), ( localize(14095, "Keyboard Shortcuts")), ( localize(14096, "Menu Contexts"))];
|
|
1144
|
+
const rows = ( commands.sort((a, b) => a.id.localeCompare(b.id)).map(command => {
|
|
1145
|
+
return [( new MarkdownString()).appendMarkdown(`\`${command.id}\``), typeof command.title === "string" ? command.title : command.title.value, command.keybindings, ( new MarkdownString()).appendMarkdown(`${( command.menus.sort((a, b) => a.localeCompare(b)).map(menu => `\`${menu}\``)).join(" ")}`)];
|
|
1190
1146
|
}));
|
|
1191
1147
|
return {
|
|
1192
1148
|
data: {
|
|
1193
1149
|
headers,
|
|
1194
1150
|
rows
|
|
1195
1151
|
},
|
|
1196
|
-
dispose: () => {
|
|
1152
|
+
dispose: () => {}
|
|
1197
1153
|
};
|
|
1198
1154
|
}
|
|
1199
1155
|
resolveKeybinding(rawKeyBinding) {
|
|
1200
1156
|
let key;
|
|
1201
1157
|
switch (platform) {
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1158
|
+
case "win32":
|
|
1159
|
+
key = rawKeyBinding.win;
|
|
1160
|
+
break;
|
|
1161
|
+
case "linux":
|
|
1162
|
+
key = rawKeyBinding.linux;
|
|
1163
|
+
break;
|
|
1164
|
+
case "darwin":
|
|
1165
|
+
key = rawKeyBinding.mac;
|
|
1166
|
+
break;
|
|
1211
1167
|
}
|
|
1212
1168
|
return this._keybindingService.resolveUserBinding(key ?? rawKeyBinding.key)[0];
|
|
1213
1169
|
}
|
|
1214
1170
|
};
|
|
1215
|
-
CommandsTableRenderer = ( __decorate([
|
|
1216
|
-
( __param(0, IKeybindingService))
|
|
1217
|
-
], CommandsTableRenderer));
|
|
1171
|
+
CommandsTableRenderer = ( __decorate([( __param(0, IKeybindingService))], CommandsTableRenderer));
|
|
1218
1172
|
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
1219
|
-
id:
|
|
1220
|
-
label: ( localize(
|
|
1173
|
+
id: "commands",
|
|
1174
|
+
label: ( localize(14097, "Commands")),
|
|
1221
1175
|
access: {
|
|
1222
|
-
canToggle: false
|
|
1176
|
+
canToggle: false
|
|
1223
1177
|
},
|
|
1224
|
-
renderer: ( new SyncDescriptor(CommandsTableRenderer))
|
|
1178
|
+
renderer: ( new SyncDescriptor(CommandsTableRenderer))
|
|
1225
1179
|
});
|
|
1226
1180
|
|
|
1227
1181
|
export { commandsExtensionPoint };
|