@codingame/monaco-vscode-api 3.0.0 → 3.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 (38) hide show
  1. package/api.js +1 -1
  2. package/assets/continue-tb.png +0 -0
  3. package/assets/pause-tb.png +0 -0
  4. package/assets/restart-tb.png +0 -0
  5. package/assets/run-with-debugging-tb.png +0 -0
  6. package/assets/stepinto-tb.png +0 -0
  7. package/assets/stepout-tb.png +0 -0
  8. package/assets/stepover-tb.png +0 -0
  9. package/assets/stop-tb.png +0 -0
  10. package/contributions.js +2 -0
  11. package/missing-services.js +17 -2
  12. package/package.json +8 -8
  13. package/service-override/tools/editorAssets.js +3 -0
  14. package/services.d.ts +6 -3
  15. package/services.js +17 -3
  16. package/vscode/src/vs/base/common/lifecycle.js +158 -1
  17. package/vscode/src/vs/base/common/observableInternal/autorun.js +3 -1
  18. package/vscode/src/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -0
  19. package/vscode/src/vs/platform/tunnel/common/tunnel.js +267 -1
  20. package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +1 -1
  21. package/vscode/src/vs/workbench/api/common/extHostNotebookDocument.js +1 -11
  22. package/vscode/src/vs/workbench/browser/actions/developerActions.js +703 -0
  23. package/vscode/src/vs/workbench/browser/actions/media/actions.css.js +4 -0
  24. package/vscode/src/vs/workbench/browser/actions/navigationActions.js +300 -0
  25. package/vscode/src/vs/workbench/browser/actions/textInputActions.js +83 -0
  26. package/vscode/src/vs/workbench/browser/dnd.js +2 -1
  27. package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +323 -8
  28. package/vscode/src/vs/workbench/common/contributions.d.ts +44 -1
  29. package/vscode/src/vs/workbench/common/contributions.js +8 -1
  30. package/vscode/src/vs/workbench/common/views.js +1 -3
  31. package/vscode/src/vs/workbench/contrib/debug/browser/media/all.png.js +11 -0
  32. package/vscode/src/vs/workbench/contrib/files/browser/files.editorPane.contribution.js +67 -0
  33. package/vscode/src/vs/workbench/contrib/logs/common/defaultLogLevels.js +140 -0
  34. package/vscode/src/vs/workbench/services/workspaces/common/workspaceIdentityService.js +102 -0
  35. package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +0 -430
  36. package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +0 -786
  37. package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +0 -510
  38. package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +0 -522
@@ -1,786 +0,0 @@
1
- import { localizeWithPath, localize2WithPath } from '../../../../nls.js';
2
- import { renameHandler, moveFileToTrashHandler, deleteFileHandler, cutFileHandler, copyFileHandler, pasteFileHandler, openFilePreserveFocusHandler, NEW_FILE_COMMAND_ID, NEW_FILE_LABEL, NEW_FOLDER_COMMAND_ID, NEW_FOLDER_LABEL, COPY_FILE_LABEL, PASTE_FILE_LABEL, FileCopiedContext, DOWNLOAD_COMMAND_ID, DOWNLOAD_LABEL, UPLOAD_COMMAND_ID, UPLOAD_LABEL, TRIGGER_RENAME_LABEL, MOVE_FILE_TO_TRASH_LABEL, ToggleAutoSaveAction, GlobalCompareResourcesAction, FocusFilesExplorer, ShowActiveFileInExplorer, CompareWithClipboardAction, CompareNewUntitledTextFilesAction, OpenActiveFileInEmptyWorkspace, SetActiveEditorReadonlyInSession, SetActiveEditorWriteableInSession, ToggleActiveEditorReadonlyInSession, ResetActiveEditorReadonlyInSession } from './fileActions.js';
3
- import { CONFLICT_RESOLUTION_CONTEXT, acceptLocalChangesCommand, revertLocalChangesCommand } from './editors/textFileSaveErrorHandler.js';
4
- import { registerAction2, MenuRegistry, MenuId } from '../../../../platform/actions/common/actions.js';
5
- import { openWindowCommand, newWindowCommand } from './fileCommands.js';
6
- import { SAVE_FILE_COMMAND_ID, SAVE_FILE_LABEL, OpenEditorsDirtyEditorContext, OpenEditorsGroupContext, OpenEditorsReadonlyEditorContext, REVERT_FILE_COMMAND_ID, SAVE_ALL_IN_GROUP_COMMAND_ID, COMPARE_WITH_SAVED_COMMAND_ID, COMPARE_RESOURCE_COMMAND_ID, ResourceSelectedForCompareContext, SELECT_FOR_COMPARE_COMMAND_ID, COMPARE_SELECTED_COMMAND_ID, OPEN_WITH_EXPLORER_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, REMOVE_ROOT_FOLDER_LABEL, NEW_UNTITLED_FILE_COMMAND_ID, SAVE_FILE_AS_COMMAND_ID, SAVE_ALL_COMMAND_ID, COPY_PATH_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_LABEL, SAVE_FILES_COMMAND_ID, SAVE_FILE_AS_LABEL, NEW_UNTITLED_FILE_LABEL, OPEN_TO_SIDE_COMMAND_ID } from './fileConstants.js';
7
- import { CommandsRegistry } from '../../../../platform/commands/common/commands.js';
8
- import { ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js';
9
- import { KeybindingsRegistry } from '../../../../platform/keybinding/common/keybindingsRegistry.js';
10
- import { FilesExplorerFocusCondition, ExplorerRootContext, ExplorerResourceNotReadonlyContext, ExplorerResourceMoveableToTrash, ExplorerResourceCut, ExplorerFolderContext, ExplorerResourceAvailableEditorIdsContext, FoldersViewVisibleContext } from '../common/files.js';
11
- import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL } from '../../../browser/actions/workspaceCommands.js';
12
- import { REOPEN_WITH_COMMAND_ID, CLOSE_EDITOR_COMMAND_ID, CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID, CLOSE_SAVED_EDITORS_COMMAND_ID, CLOSE_EDITORS_IN_GROUP_COMMAND_ID } from '../../../browser/parts/editor/editorCommands.js';
13
- import { AutoSaveAfterShortDelayContext } from '../../../services/filesConfiguration/common/filesConfigurationService.js';
14
- import { WorkbenchListDoubleSelection } from '../../../../platform/list/browser/listService.js';
15
- import { Schemas } from '../../../../base/common/network.js';
16
- import { ActiveEditorAvailableEditorIdsContext, ResourceContextKey, DirtyWorkingCopiesContext, HasWebFileSystemAccess, EnterMultiRootWorkspaceSupportContext, WorkbenchStateContext, WorkspaceFolderCountContext, ActiveEditorContext, SidebarFocusContext, ActiveEditorCanRevertContext } from '../../../common/contextkeys.js';
17
- import { IsWebContext } from '../../../../platform/contextkey/common/contextkeys.js';
18
- import { IExplorerService } from './files.js';
19
- import { Codicon } from '../../../../base/common/codicons.js';
20
- import { Categories } from '../../../../platform/action/common/actionCommonCategories.js';
21
- registerAction2(GlobalCompareResourcesAction);
22
- registerAction2(FocusFilesExplorer);
23
- registerAction2(ShowActiveFileInExplorer);
24
- registerAction2(CompareWithClipboardAction);
25
- registerAction2(CompareNewUntitledTextFilesAction);
26
- registerAction2(ToggleAutoSaveAction);
27
- registerAction2(OpenActiveFileInEmptyWorkspace);
28
- registerAction2(SetActiveEditorReadonlyInSession);
29
- registerAction2(SetActiveEditorWriteableInSession);
30
- registerAction2(ToggleActiveEditorReadonlyInSession);
31
- registerAction2(ResetActiveEditorReadonlyInSession);
32
- CommandsRegistry.registerCommand('_files.windowOpen', openWindowCommand);
33
- CommandsRegistry.registerCommand('_files.newWindow', newWindowCommand);
34
- const explorerCommandsWeightBonus = 10;
35
- const RENAME_ID = 'renameFile';
36
- KeybindingsRegistry.registerCommandAndKeybindingRule({
37
- id: RENAME_ID,
38
- weight: 200 + explorerCommandsWeightBonus,
39
- when: ( ContextKeyExpr.and(FilesExplorerFocusCondition, ( ExplorerRootContext.toNegated()), ExplorerResourceNotReadonlyContext)),
40
- primary: 60 ,
41
- mac: {
42
- primary: 3
43
- },
44
- handler: renameHandler
45
- });
46
- const MOVE_FILE_TO_TRASH_ID = 'moveFileToTrash';
47
- KeybindingsRegistry.registerCommandAndKeybindingRule({
48
- id: MOVE_FILE_TO_TRASH_ID,
49
- weight: 200 + explorerCommandsWeightBonus,
50
- when: ( ContextKeyExpr.and(
51
- FilesExplorerFocusCondition,
52
- ExplorerResourceNotReadonlyContext,
53
- ExplorerResourceMoveableToTrash
54
- )),
55
- primary: 20 ,
56
- mac: {
57
- primary: 2048 | 1 ,
58
- secondary: [20 ]
59
- },
60
- handler: moveFileToTrashHandler
61
- });
62
- const DELETE_FILE_ID = 'deleteFile';
63
- KeybindingsRegistry.registerCommandAndKeybindingRule({
64
- id: DELETE_FILE_ID,
65
- weight: 200 + explorerCommandsWeightBonus,
66
- when: ( ContextKeyExpr.and(FilesExplorerFocusCondition, ExplorerResourceNotReadonlyContext)),
67
- primary: 1024 | 20 ,
68
- mac: {
69
- primary: 2048 | 512 | 1
70
- },
71
- handler: deleteFileHandler
72
- });
73
- KeybindingsRegistry.registerCommandAndKeybindingRule({
74
- id: DELETE_FILE_ID,
75
- weight: 200 + explorerCommandsWeightBonus,
76
- when: ( ContextKeyExpr.and(
77
- FilesExplorerFocusCondition,
78
- ExplorerResourceNotReadonlyContext,
79
- ( ExplorerResourceMoveableToTrash.toNegated())
80
- )),
81
- primary: 20 ,
82
- mac: {
83
- primary: 2048 | 1
84
- },
85
- handler: deleteFileHandler
86
- });
87
- const CUT_FILE_ID = 'filesExplorer.cut';
88
- KeybindingsRegistry.registerCommandAndKeybindingRule({
89
- id: CUT_FILE_ID,
90
- weight: 200 + explorerCommandsWeightBonus,
91
- when: ( ContextKeyExpr.and(FilesExplorerFocusCondition, ( ExplorerRootContext.toNegated()), ExplorerResourceNotReadonlyContext)),
92
- primary: 2048 | 54 ,
93
- handler: cutFileHandler,
94
- });
95
- const COPY_FILE_ID = 'filesExplorer.copy';
96
- KeybindingsRegistry.registerCommandAndKeybindingRule({
97
- id: COPY_FILE_ID,
98
- weight: 200 + explorerCommandsWeightBonus,
99
- when: ( ContextKeyExpr.and(FilesExplorerFocusCondition, ( ExplorerRootContext.toNegated()))),
100
- primary: 2048 | 33 ,
101
- handler: copyFileHandler,
102
- });
103
- const PASTE_FILE_ID = 'filesExplorer.paste';
104
- CommandsRegistry.registerCommand(PASTE_FILE_ID, pasteFileHandler);
105
- KeybindingsRegistry.registerKeybindingRule({
106
- id: `^${PASTE_FILE_ID}`,
107
- weight: 200 + explorerCommandsWeightBonus,
108
- when: ( ContextKeyExpr.and(FilesExplorerFocusCondition, ExplorerResourceNotReadonlyContext)),
109
- primary: 2048 | 52 ,
110
- });
111
- KeybindingsRegistry.registerCommandAndKeybindingRule({
112
- id: 'filesExplorer.cancelCut',
113
- weight: 200 + explorerCommandsWeightBonus,
114
- when: ( ContextKeyExpr.and(FilesExplorerFocusCondition, ExplorerResourceCut)),
115
- primary: 9 ,
116
- handler: async (accessor) => {
117
- const explorerService = accessor.get(IExplorerService);
118
- await explorerService.setToCopy([], true);
119
- }
120
- });
121
- KeybindingsRegistry.registerCommandAndKeybindingRule({
122
- id: 'filesExplorer.openFilePreserveFocus',
123
- weight: 200 + explorerCommandsWeightBonus,
124
- when: ( ContextKeyExpr.and(FilesExplorerFocusCondition, ( ExplorerFolderContext.toNegated()))),
125
- primary: 10 ,
126
- handler: openFilePreserveFocusHandler
127
- });
128
- const copyPathCommand = {
129
- id: COPY_PATH_COMMAND_ID,
130
- title: ( localizeWithPath(
131
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
132
- 'copyPath',
133
- "Copy Path"
134
- ))
135
- };
136
- const copyRelativePathCommand = {
137
- id: COPY_RELATIVE_PATH_COMMAND_ID,
138
- title: ( localizeWithPath(
139
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
140
- 'copyRelativePath',
141
- "Copy Relative Path"
142
- ))
143
- };
144
- appendEditorTitleContextMenuItem(COPY_PATH_COMMAND_ID, copyPathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste');
145
- appendEditorTitleContextMenuItem(COPY_RELATIVE_PATH_COMMAND_ID, copyRelativePathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste');
146
- appendEditorTitleContextMenuItem(REVEAL_IN_EXPLORER_COMMAND_ID, ( localizeWithPath(
147
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
148
- 'revealInSideBar',
149
- "Reveal in Explorer View"
150
- )), ResourceContextKey.IsFileSystemResource, '2_files', 1);
151
- function appendEditorTitleContextMenuItem(id, title, when, group, order) {
152
- MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, {
153
- command: { id, title },
154
- when,
155
- group,
156
- order
157
- });
158
- }
159
- appendSaveConflictEditorTitleAction('workbench.files.action.acceptLocalChanges', ( localizeWithPath(
160
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
161
- 'acceptLocalChanges',
162
- "Use your changes and overwrite file contents"
163
- )), Codicon.check, -10, acceptLocalChangesCommand);
164
- appendSaveConflictEditorTitleAction('workbench.files.action.revertLocalChanges', ( localizeWithPath(
165
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
166
- 'revertLocalChanges',
167
- "Discard your changes and revert to file contents"
168
- )), Codicon.discard, -9, revertLocalChangesCommand);
169
- function appendSaveConflictEditorTitleAction(id, title, icon, order, command) {
170
- CommandsRegistry.registerCommand(id, command);
171
- MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
172
- command: { id, title, icon },
173
- when: ( ContextKeyExpr.equals(CONFLICT_RESOLUTION_CONTEXT, true)),
174
- group: 'navigation',
175
- order
176
- });
177
- }
178
- function appendToCommandPalette({ id, title, category, metadata }, when) {
179
- MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
180
- command: {
181
- id,
182
- title,
183
- category,
184
- metadata
185
- },
186
- when
187
- });
188
- }
189
- appendToCommandPalette({
190
- id: COPY_PATH_COMMAND_ID,
191
- title: ( localize2WithPath(
192
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
193
- 'copyPathOfActive',
194
- "Copy Path of Active File"
195
- )),
196
- category: Categories.File
197
- });
198
- appendToCommandPalette({
199
- id: COPY_RELATIVE_PATH_COMMAND_ID,
200
- title: ( localize2WithPath(
201
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
202
- 'copyRelativePathOfActive',
203
- "Copy Relative Path of Active File"
204
- )),
205
- category: Categories.File
206
- });
207
- appendToCommandPalette({
208
- id: SAVE_FILE_COMMAND_ID,
209
- title: SAVE_FILE_LABEL,
210
- category: Categories.File
211
- });
212
- appendToCommandPalette({
213
- id: SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID,
214
- title: SAVE_FILE_WITHOUT_FORMATTING_LABEL,
215
- category: Categories.File
216
- });
217
- appendToCommandPalette({
218
- id: SAVE_ALL_IN_GROUP_COMMAND_ID,
219
- title: ( localize2WithPath(
220
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
221
- 'saveAllInGroup',
222
- "Save All in Group"
223
- )),
224
- category: Categories.File
225
- });
226
- appendToCommandPalette({
227
- id: SAVE_FILES_COMMAND_ID,
228
- title: ( localize2WithPath(
229
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
230
- 'saveFiles',
231
- "Save All Files"
232
- )),
233
- category: Categories.File
234
- });
235
- appendToCommandPalette({
236
- id: REVERT_FILE_COMMAND_ID,
237
- title: ( localize2WithPath(
238
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
239
- 'revert',
240
- "Revert File"
241
- )),
242
- category: Categories.File
243
- });
244
- appendToCommandPalette({
245
- id: COMPARE_WITH_SAVED_COMMAND_ID,
246
- title: ( localize2WithPath(
247
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
248
- 'compareActiveWithSaved',
249
- "Compare Active File with Saved"
250
- )),
251
- category: Categories.File
252
- });
253
- appendToCommandPalette({
254
- id: SAVE_FILE_AS_COMMAND_ID,
255
- title: SAVE_FILE_AS_LABEL,
256
- category: Categories.File
257
- });
258
- appendToCommandPalette({
259
- id: NEW_FILE_COMMAND_ID,
260
- title: NEW_FILE_LABEL,
261
- category: Categories.File
262
- }, ( WorkspaceFolderCountContext.notEqualsTo('0')));
263
- appendToCommandPalette({
264
- id: NEW_FOLDER_COMMAND_ID,
265
- title: NEW_FOLDER_LABEL,
266
- category: Categories.File,
267
- metadata: { description: ( localize2WithPath(
268
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
269
- 'newFolderDescription',
270
- "Create a new folder or directory"
271
- )) }
272
- }, ( WorkspaceFolderCountContext.notEqualsTo('0')));
273
- appendToCommandPalette({
274
- id: NEW_UNTITLED_FILE_COMMAND_ID,
275
- title: NEW_UNTITLED_FILE_LABEL,
276
- category: Categories.File
277
- });
278
- const isFileOrUntitledResourceContextKey = ( ContextKeyExpr.or(ResourceContextKey.IsFileSystemResource, ( ResourceContextKey.Scheme.isEqualTo(Schemas.untitled))));
279
- const openToSideCommand = {
280
- id: OPEN_TO_SIDE_COMMAND_ID,
281
- title: ( localizeWithPath(
282
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
283
- 'openToSide',
284
- "Open to the Side"
285
- ))
286
- };
287
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
288
- group: 'navigation',
289
- order: 10,
290
- command: openToSideCommand,
291
- when: isFileOrUntitledResourceContextKey
292
- });
293
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
294
- group: '1_open',
295
- order: 10,
296
- command: {
297
- id: REOPEN_WITH_COMMAND_ID,
298
- title: ( localizeWithPath(
299
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
300
- 'reopenWith',
301
- "Reopen Editor With..."
302
- ))
303
- },
304
- when: ActiveEditorAvailableEditorIdsContext
305
- });
306
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
307
- group: '1_cutcopypaste',
308
- order: 10,
309
- command: copyPathCommand,
310
- when: ResourceContextKey.IsFileSystemResource
311
- });
312
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
313
- group: '1_cutcopypaste',
314
- order: 20,
315
- command: copyRelativePathCommand,
316
- when: ResourceContextKey.IsFileSystemResource
317
- });
318
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
319
- group: '2_save',
320
- order: 10,
321
- command: {
322
- id: SAVE_FILE_COMMAND_ID,
323
- title: SAVE_FILE_LABEL,
324
- precondition: OpenEditorsDirtyEditorContext
325
- },
326
- when: ( ContextKeyExpr.or((
327
- ResourceContextKey.Scheme.isEqualTo(Schemas.untitled)), (
328
- ContextKeyExpr.and((
329
- OpenEditorsGroupContext.toNegated()), (
330
- OpenEditorsReadonlyEditorContext.toNegated()), (
331
- AutoSaveAfterShortDelayContext.toNegated())))))
332
- });
333
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
334
- group: '2_save',
335
- order: 20,
336
- command: {
337
- id: REVERT_FILE_COMMAND_ID,
338
- title: ( localizeWithPath(
339
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
340
- 'revert',
341
- "Revert File"
342
- )),
343
- precondition: OpenEditorsDirtyEditorContext
344
- },
345
- when: ( ContextKeyExpr.and((
346
- OpenEditorsGroupContext.toNegated()), (
347
- OpenEditorsReadonlyEditorContext.toNegated()), (
348
- ResourceContextKey.Scheme.notEqualsTo(Schemas.untitled)), (
349
- AutoSaveAfterShortDelayContext.toNegated())))
350
- });
351
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
352
- group: '2_save',
353
- order: 30,
354
- command: {
355
- id: SAVE_ALL_IN_GROUP_COMMAND_ID,
356
- title: ( localizeWithPath(
357
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
358
- 'saveAll',
359
- "Save All"
360
- )),
361
- precondition: DirtyWorkingCopiesContext
362
- },
363
- when: OpenEditorsGroupContext
364
- });
365
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
366
- group: '3_compare',
367
- order: 10,
368
- command: {
369
- id: COMPARE_WITH_SAVED_COMMAND_ID,
370
- title: ( localizeWithPath(
371
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
372
- 'compareWithSaved',
373
- "Compare with Saved"
374
- )),
375
- precondition: OpenEditorsDirtyEditorContext
376
- },
377
- when: ( ContextKeyExpr.and(ResourceContextKey.IsFileSystemResource, ( AutoSaveAfterShortDelayContext.toNegated()), ( WorkbenchListDoubleSelection.toNegated())))
378
- });
379
- const compareResourceCommand = {
380
- id: COMPARE_RESOURCE_COMMAND_ID,
381
- title: ( localizeWithPath(
382
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
383
- 'compareWithSelected',
384
- "Compare with Selected"
385
- ))
386
- };
387
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
388
- group: '3_compare',
389
- order: 20,
390
- command: compareResourceCommand,
391
- when: ( ContextKeyExpr.and(
392
- ResourceContextKey.HasResource,
393
- ResourceSelectedForCompareContext,
394
- isFileOrUntitledResourceContextKey,
395
- ( WorkbenchListDoubleSelection.toNegated())
396
- ))
397
- });
398
- const selectForCompareCommand = {
399
- id: SELECT_FOR_COMPARE_COMMAND_ID,
400
- title: ( localizeWithPath(
401
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
402
- 'compareSource',
403
- "Select for Compare"
404
- ))
405
- };
406
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
407
- group: '3_compare',
408
- order: 30,
409
- command: selectForCompareCommand,
410
- when: ( ContextKeyExpr.and(
411
- ResourceContextKey.HasResource,
412
- isFileOrUntitledResourceContextKey,
413
- ( WorkbenchListDoubleSelection.toNegated())
414
- ))
415
- });
416
- const compareSelectedCommand = {
417
- id: COMPARE_SELECTED_COMMAND_ID,
418
- title: ( localizeWithPath(
419
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
420
- 'compareSelected',
421
- "Compare Selected"
422
- ))
423
- };
424
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
425
- group: '3_compare',
426
- order: 30,
427
- command: compareSelectedCommand,
428
- when: ( ContextKeyExpr.and(
429
- ResourceContextKey.HasResource,
430
- WorkbenchListDoubleSelection,
431
- isFileOrUntitledResourceContextKey
432
- ))
433
- });
434
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
435
- group: '4_close',
436
- order: 10,
437
- command: {
438
- id: CLOSE_EDITOR_COMMAND_ID,
439
- title: ( localizeWithPath(
440
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
441
- 'close',
442
- "Close"
443
- ))
444
- },
445
- when: ( OpenEditorsGroupContext.toNegated())
446
- });
447
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
448
- group: '4_close',
449
- order: 20,
450
- command: {
451
- id: CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID,
452
- title: ( localizeWithPath(
453
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
454
- 'closeOthers',
455
- "Close Others"
456
- ))
457
- },
458
- when: ( OpenEditorsGroupContext.toNegated())
459
- });
460
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
461
- group: '4_close',
462
- order: 30,
463
- command: {
464
- id: CLOSE_SAVED_EDITORS_COMMAND_ID,
465
- title: ( localizeWithPath(
466
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
467
- 'closeSaved',
468
- "Close Saved"
469
- ))
470
- }
471
- });
472
- MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
473
- group: '4_close',
474
- order: 40,
475
- command: {
476
- id: CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
477
- title: ( localizeWithPath(
478
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
479
- 'closeAll',
480
- "Close All"
481
- ))
482
- }
483
- });
484
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
485
- group: 'navigation',
486
- order: 4,
487
- command: {
488
- id: NEW_FILE_COMMAND_ID,
489
- title: NEW_FILE_LABEL,
490
- precondition: ExplorerResourceNotReadonlyContext
491
- },
492
- when: ExplorerFolderContext
493
- });
494
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
495
- group: 'navigation',
496
- order: 6,
497
- command: {
498
- id: NEW_FOLDER_COMMAND_ID,
499
- title: NEW_FOLDER_LABEL,
500
- precondition: ExplorerResourceNotReadonlyContext
501
- },
502
- when: ExplorerFolderContext
503
- });
504
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
505
- group: 'navigation',
506
- order: 10,
507
- command: openToSideCommand,
508
- when: ( ContextKeyExpr.and(( ExplorerFolderContext.toNegated()), ResourceContextKey.HasResource))
509
- });
510
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
511
- group: 'navigation',
512
- order: 20,
513
- command: {
514
- id: OPEN_WITH_EXPLORER_COMMAND_ID,
515
- title: ( localizeWithPath(
516
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
517
- 'explorerOpenWith',
518
- "Open With..."
519
- )),
520
- },
521
- when: ( ContextKeyExpr.and(( ExplorerFolderContext.toNegated()), ExplorerResourceAvailableEditorIdsContext)),
522
- });
523
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
524
- group: '3_compare',
525
- order: 20,
526
- command: compareResourceCommand,
527
- when: ( ContextKeyExpr.and(( ExplorerFolderContext.toNegated()), ResourceContextKey.HasResource, ResourceSelectedForCompareContext, ( WorkbenchListDoubleSelection.toNegated())))
528
- });
529
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
530
- group: '3_compare',
531
- order: 30,
532
- command: selectForCompareCommand,
533
- when: ( ContextKeyExpr.and(( ExplorerFolderContext.toNegated()), ResourceContextKey.HasResource, ( WorkbenchListDoubleSelection.toNegated())))
534
- });
535
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
536
- group: '3_compare',
537
- order: 30,
538
- command: compareSelectedCommand,
539
- when: ( ContextKeyExpr.and(( ExplorerFolderContext.toNegated()), ResourceContextKey.HasResource, WorkbenchListDoubleSelection))
540
- });
541
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
542
- group: '5_cutcopypaste',
543
- order: 8,
544
- command: {
545
- id: CUT_FILE_ID,
546
- title: ( localizeWithPath(
547
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
548
- 'cut',
549
- "Cut"
550
- ))
551
- },
552
- when: ( ContextKeyExpr.and(( ExplorerRootContext.toNegated()), ExplorerResourceNotReadonlyContext))
553
- });
554
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
555
- group: '5_cutcopypaste',
556
- order: 10,
557
- command: {
558
- id: COPY_FILE_ID,
559
- title: COPY_FILE_LABEL
560
- },
561
- when: ( ExplorerRootContext.toNegated())
562
- });
563
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
564
- group: '5_cutcopypaste',
565
- order: 20,
566
- command: {
567
- id: PASTE_FILE_ID,
568
- title: PASTE_FILE_LABEL,
569
- precondition: ( ContextKeyExpr.and(ExplorerResourceNotReadonlyContext, FileCopiedContext))
570
- },
571
- when: ExplorerFolderContext
572
- });
573
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, ({
574
- group: '5b_importexport',
575
- order: 10,
576
- command: {
577
- id: DOWNLOAD_COMMAND_ID,
578
- title: DOWNLOAD_LABEL
579
- },
580
- when: ( ContextKeyExpr.or((
581
- ContextKeyExpr.and(( IsWebContext.toNegated()), ( ResourceContextKey.Scheme.notEqualsTo(Schemas.file)))), (
582
- ContextKeyExpr.and(IsWebContext, ( ExplorerFolderContext.toNegated()), ( ExplorerRootContext.toNegated()))), (
583
- ContextKeyExpr.and(IsWebContext, HasWebFileSystemAccess))))
584
- }));
585
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, ({
586
- group: '5b_importexport',
587
- order: 20,
588
- command: {
589
- id: UPLOAD_COMMAND_ID,
590
- title: UPLOAD_LABEL,
591
- },
592
- when: ( ContextKeyExpr.and(
593
- IsWebContext,
594
- ExplorerFolderContext,
595
- ExplorerResourceNotReadonlyContext))
596
- }));
597
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
598
- group: '6_copypath',
599
- order: 10,
600
- command: copyPathCommand,
601
- when: ResourceContextKey.IsFileSystemResource
602
- });
603
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
604
- group: '6_copypath',
605
- order: 20,
606
- command: copyRelativePathCommand,
607
- when: ResourceContextKey.IsFileSystemResource
608
- });
609
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
610
- group: '2_workspace',
611
- order: 10,
612
- command: {
613
- id: ADD_ROOT_FOLDER_COMMAND_ID,
614
- title: ADD_ROOT_FOLDER_LABEL
615
- },
616
- when: ( ContextKeyExpr.and(ExplorerRootContext, ( ContextKeyExpr.or(EnterMultiRootWorkspaceSupportContext, ( WorkbenchStateContext.isEqualTo('workspace'))))))
617
- });
618
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
619
- group: '2_workspace',
620
- order: 30,
621
- command: {
622
- id: REMOVE_ROOT_FOLDER_COMMAND_ID,
623
- title: REMOVE_ROOT_FOLDER_LABEL
624
- },
625
- when: ( ContextKeyExpr.and(ExplorerRootContext, ExplorerFolderContext, ( ContextKeyExpr.and(( WorkspaceFolderCountContext.notEqualsTo('0')), ( ContextKeyExpr.or(EnterMultiRootWorkspaceSupportContext, ( WorkbenchStateContext.isEqualTo('workspace'))))))))
626
- });
627
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
628
- group: '7_modification',
629
- order: 10,
630
- command: {
631
- id: RENAME_ID,
632
- title: TRIGGER_RENAME_LABEL,
633
- precondition: ExplorerResourceNotReadonlyContext
634
- },
635
- when: ( ExplorerRootContext.toNegated())
636
- });
637
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
638
- group: '7_modification',
639
- order: 20,
640
- command: {
641
- id: MOVE_FILE_TO_TRASH_ID,
642
- title: MOVE_FILE_TO_TRASH_LABEL,
643
- precondition: ExplorerResourceNotReadonlyContext
644
- },
645
- alt: {
646
- id: DELETE_FILE_ID,
647
- title: ( localizeWithPath(
648
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
649
- 'deleteFile',
650
- "Delete Permanently"
651
- )),
652
- precondition: ExplorerResourceNotReadonlyContext
653
- },
654
- when: ( ContextKeyExpr.and(( ExplorerRootContext.toNegated()), ExplorerResourceMoveableToTrash))
655
- });
656
- MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
657
- group: '7_modification',
658
- order: 20,
659
- command: {
660
- id: DELETE_FILE_ID,
661
- title: ( localizeWithPath(
662
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
663
- 'deleteFile',
664
- "Delete Permanently"
665
- )),
666
- precondition: ExplorerResourceNotReadonlyContext
667
- },
668
- when: ( ContextKeyExpr.and(( ExplorerRootContext.toNegated()), ( ExplorerResourceMoveableToTrash.toNegated())))
669
- });
670
- for (const menuId of [MenuId.EmptyEditorGroupContext, MenuId.EditorTabsBarContext]) {
671
- MenuRegistry.appendMenuItem(menuId, { command: { id: NEW_UNTITLED_FILE_COMMAND_ID, title: ( localizeWithPath(
672
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
673
- 'newFile',
674
- "New Text File"
675
- )) }, group: '1_file', order: 10 });
676
- MenuRegistry.appendMenuItem(menuId, { command: { id: 'workbench.action.quickOpen', title: ( localizeWithPath(
677
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
678
- 'openFile',
679
- "Open File..."
680
- )) }, group: '1_file', order: 20 });
681
- }
682
- MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
683
- group: '1_new',
684
- command: {
685
- id: NEW_UNTITLED_FILE_COMMAND_ID,
686
- title: ( localizeWithPath(
687
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
688
- { key: 'miNewFile', comment: ['&& denotes a mnemonic'] },
689
- "&&New Text File"
690
- ))
691
- },
692
- order: 1
693
- });
694
- MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
695
- group: '4_save',
696
- command: {
697
- id: SAVE_FILE_COMMAND_ID,
698
- title: ( localizeWithPath(
699
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
700
- { key: 'miSave', comment: ['&& denotes a mnemonic'] },
701
- "&&Save"
702
- )),
703
- precondition: ( ContextKeyExpr.or(ActiveEditorContext, ( ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))))
704
- },
705
- order: 1
706
- });
707
- MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
708
- group: '4_save',
709
- command: {
710
- id: SAVE_FILE_AS_COMMAND_ID,
711
- title: ( localizeWithPath(
712
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
713
- { key: 'miSaveAs', comment: ['&& denotes a mnemonic'] },
714
- "Save &&As..."
715
- )),
716
- precondition: ( ContextKeyExpr.or(ActiveEditorContext, ( ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))))
717
- },
718
- order: 2
719
- });
720
- MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
721
- group: '4_save',
722
- command: {
723
- id: SAVE_ALL_COMMAND_ID,
724
- title: ( localizeWithPath(
725
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
726
- { key: 'miSaveAll', comment: ['&& denotes a mnemonic'] },
727
- "Save A&&ll"
728
- )),
729
- precondition: DirtyWorkingCopiesContext
730
- },
731
- order: 3
732
- });
733
- MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
734
- group: '5_autosave',
735
- command: {
736
- id: ToggleAutoSaveAction.ID,
737
- title: ( localizeWithPath(
738
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
739
- { key: 'miAutoSave', comment: ['&& denotes a mnemonic'] },
740
- "A&&uto Save"
741
- )),
742
- toggled: ( ContextKeyExpr.notEquals('config.files.autoSave', 'off'))
743
- },
744
- order: 1
745
- });
746
- MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
747
- group: '6_close',
748
- command: {
749
- id: REVERT_FILE_COMMAND_ID,
750
- title: ( localizeWithPath(
751
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
752
- { key: 'miRevert', comment: ['&& denotes a mnemonic'] },
753
- "Re&&vert File"
754
- )),
755
- precondition: ( ContextKeyExpr.or((
756
- ContextKeyExpr.and(ActiveEditorCanRevertContext)), (
757
- ContextKeyExpr.and(( ResourceContextKey.Scheme.notEqualsTo(Schemas.untitled)), FoldersViewVisibleContext, SidebarFocusContext)))),
758
- },
759
- order: 1
760
- });
761
- MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
762
- group: '6_close',
763
- command: {
764
- id: CLOSE_EDITOR_COMMAND_ID,
765
- title: ( localizeWithPath(
766
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
767
- { key: 'miCloseEditor', comment: ['&& denotes a mnemonic'] },
768
- "&&Close Editor"
769
- )),
770
- precondition: ( ContextKeyExpr.or(ActiveEditorContext, ( ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))))
771
- },
772
- order: 2
773
- });
774
- MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
775
- group: '3_global_nav',
776
- command: {
777
- id: 'workbench.action.quickOpen',
778
- title: ( localizeWithPath(
779
- 'vs/workbench/contrib/files/browser/fileActions.contribution',
780
- { key: 'miGotoFile', comment: ['&& denotes a mnemonic'] },
781
- "Go to &&File..."
782
- ))
783
- },
784
- order: 1
785
- });
786
- export { appendEditorTitleContextMenuItem, appendToCommandPalette };