@codingame/monaco-vscode-explorer-service-override 9.0.2 → 10.0.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.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +12 -15
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +147 -81
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +42 -43
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._explorer.js +66 -68
|
@@ -2,17 +2,16 @@ import { localize, localize2 } from 'vscode/vscode/vs/nls';
|
|
|
2
2
|
import { GlobalCompareResourcesAction, FocusFilesExplorer, ShowActiveFileInExplorer, CompareWithClipboardAction, CompareNewUntitledTextFilesAction, ToggleAutoSaveAction, OpenActiveFileInEmptyWorkspace, SetActiveEditorReadonlyInSession, SetActiveEditorWriteableInSession, ToggleActiveEditorReadonlyInSession, ResetActiveEditorReadonlyInSession, 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 } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileActions';
|
|
3
3
|
import { acceptLocalChangesCommand, revertLocalChangesCommand, CONFLICT_RESOLUTION_CONTEXT } from 'vscode/vscode/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler';
|
|
4
4
|
import { registerAction2, MenuRegistry, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
5
|
-
import { KeyCode, KeyMod } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
6
5
|
import { openWindowCommand, newWindowCommand } from './fileCommands.js';
|
|
7
6
|
import { COPY_PATH_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, SAVE_FILE_COMMAND_ID, SAVE_FILE_LABEL, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_LABEL, SAVE_ALL_IN_GROUP_COMMAND_ID, SAVE_FILES_COMMAND_ID, REVERT_FILE_COMMAND_ID, COMPARE_WITH_SAVED_COMMAND_ID, SAVE_FILE_AS_COMMAND_ID, SAVE_FILE_AS_LABEL, NEW_UNTITLED_FILE_COMMAND_ID, NEW_UNTITLED_FILE_LABEL, OPEN_TO_SIDE_COMMAND_ID, OpenEditorsGroupContext, OpenEditorsDirtyEditorContext, OpenEditorsReadonlyEditorContext, COMPARE_RESOURCE_COMMAND_ID, ResourceSelectedForCompareContext, SELECT_FOR_COMPARE_COMMAND_ID, COMPARE_SELECTED_COMMAND_ID, OpenEditorsSelectedFileOrUntitledContext, OPEN_WITH_EXPLORER_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, REMOVE_ROOT_FOLDER_LABEL, SAVE_ALL_COMMAND_ID } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileConstants';
|
|
8
7
|
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
9
8
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
10
|
-
import { KeybindingsRegistry
|
|
9
|
+
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
11
10
|
import { FilesExplorerFocusCondition, ExplorerRootContext, ExplorerResourceNotReadonlyContext, ExplorerResourceMoveableToTrash, ExplorerResourceCut, ExplorerFolderContext, ExplorerResourceAvailableEditorIdsContext, FoldersViewVisibleContext } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
|
|
12
11
|
import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL } from 'vscode/vscode/vs/workbench/browser/actions/workspaceCommands';
|
|
13
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 'vscode/vscode/vs/workbench/browser/parts/editor/editorCommands';
|
|
14
13
|
import { AutoSaveAfterShortDelayContext } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
15
|
-
import { WorkbenchListDoubleSelection } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
14
|
+
import { WorkbenchTreeFindOpen, WorkbenchListDoubleSelection } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
16
15
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
17
16
|
import { ResourceContextKey, MultipleEditorsSelectedInGroupContext, WorkspaceFolderCountContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey, HasWebFileSystemAccess, EnterMultiRootWorkspaceSupportContext, WorkbenchStateContext, ActiveEditorContext, SidebarFocusContext, ActiveEditorCanRevertContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
18
17
|
import { IsWebContext } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
@@ -37,95 +36,106 @@ const explorerCommandsWeightBonus = 10;
|
|
|
37
36
|
const RENAME_ID = 'renameFile';
|
|
38
37
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
39
38
|
id: RENAME_ID,
|
|
40
|
-
weight:
|
|
39
|
+
weight: 200 + explorerCommandsWeightBonus,
|
|
41
40
|
when: ( (ContextKeyExpr.and(
|
|
42
41
|
FilesExplorerFocusCondition,
|
|
43
42
|
(ExplorerRootContext.toNegated()),
|
|
44
43
|
ExplorerResourceNotReadonlyContext
|
|
45
44
|
))),
|
|
46
|
-
primary:
|
|
45
|
+
primary: 60 ,
|
|
47
46
|
mac: {
|
|
48
|
-
primary:
|
|
47
|
+
primary: 3
|
|
49
48
|
},
|
|
50
49
|
handler: renameHandler
|
|
51
50
|
});
|
|
52
51
|
const MOVE_FILE_TO_TRASH_ID = 'moveFileToTrash';
|
|
53
52
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
54
53
|
id: MOVE_FILE_TO_TRASH_ID,
|
|
55
|
-
weight:
|
|
54
|
+
weight: 200 + explorerCommandsWeightBonus,
|
|
56
55
|
when: ( (ContextKeyExpr.and(
|
|
57
56
|
FilesExplorerFocusCondition,
|
|
58
57
|
ExplorerResourceNotReadonlyContext,
|
|
59
|
-
ExplorerResourceMoveableToTrash
|
|
58
|
+
ExplorerResourceMoveableToTrash,
|
|
59
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
60
60
|
))),
|
|
61
|
-
primary:
|
|
61
|
+
primary: 20 ,
|
|
62
62
|
mac: {
|
|
63
|
-
primary:
|
|
64
|
-
secondary: [
|
|
63
|
+
primary: 2048 | 1 ,
|
|
64
|
+
secondary: [20 ]
|
|
65
65
|
},
|
|
66
66
|
handler: moveFileToTrashHandler
|
|
67
67
|
});
|
|
68
68
|
const DELETE_FILE_ID = 'deleteFile';
|
|
69
69
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
70
70
|
id: DELETE_FILE_ID,
|
|
71
|
-
weight:
|
|
72
|
-
when: ( (ContextKeyExpr.and(
|
|
73
|
-
|
|
71
|
+
weight: 200 + explorerCommandsWeightBonus,
|
|
72
|
+
when: ( (ContextKeyExpr.and(
|
|
73
|
+
FilesExplorerFocusCondition,
|
|
74
|
+
ExplorerResourceNotReadonlyContext,
|
|
75
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
76
|
+
))),
|
|
77
|
+
primary: 1024 | 20 ,
|
|
74
78
|
mac: {
|
|
75
|
-
primary:
|
|
79
|
+
primary: 2048 | 512 | 1
|
|
76
80
|
},
|
|
77
81
|
handler: deleteFileHandler
|
|
78
82
|
});
|
|
79
83
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
80
84
|
id: DELETE_FILE_ID,
|
|
81
|
-
weight:
|
|
85
|
+
weight: 200 + explorerCommandsWeightBonus,
|
|
82
86
|
when: ( (ContextKeyExpr.and(
|
|
83
87
|
FilesExplorerFocusCondition,
|
|
84
88
|
ExplorerResourceNotReadonlyContext,
|
|
85
|
-
(ExplorerResourceMoveableToTrash.toNegated())
|
|
89
|
+
(ExplorerResourceMoveableToTrash.toNegated()),
|
|
90
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
86
91
|
))),
|
|
87
|
-
primary:
|
|
92
|
+
primary: 20 ,
|
|
88
93
|
mac: {
|
|
89
|
-
primary:
|
|
94
|
+
primary: 2048 | 1
|
|
90
95
|
},
|
|
91
96
|
handler: deleteFileHandler
|
|
92
97
|
});
|
|
93
98
|
const CUT_FILE_ID = 'filesExplorer.cut';
|
|
94
99
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
95
100
|
id: CUT_FILE_ID,
|
|
96
|
-
weight:
|
|
101
|
+
weight: 200 + explorerCommandsWeightBonus,
|
|
97
102
|
when: ( (ContextKeyExpr.and(
|
|
98
103
|
FilesExplorerFocusCondition,
|
|
99
104
|
(ExplorerRootContext.toNegated()),
|
|
100
|
-
ExplorerResourceNotReadonlyContext
|
|
105
|
+
ExplorerResourceNotReadonlyContext,
|
|
106
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
101
107
|
))),
|
|
102
|
-
primary:
|
|
108
|
+
primary: 2048 | 54 ,
|
|
103
109
|
handler: cutFileHandler,
|
|
104
110
|
});
|
|
105
111
|
const COPY_FILE_ID = 'filesExplorer.copy';
|
|
106
112
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
107
113
|
id: COPY_FILE_ID,
|
|
108
|
-
weight:
|
|
114
|
+
weight: 200 + explorerCommandsWeightBonus,
|
|
109
115
|
when: ( (ContextKeyExpr.and(
|
|
110
116
|
FilesExplorerFocusCondition,
|
|
111
117
|
(ExplorerRootContext.toNegated())
|
|
112
118
|
))),
|
|
113
|
-
primary:
|
|
119
|
+
primary: 2048 | 33 ,
|
|
114
120
|
handler: copyFileHandler,
|
|
115
121
|
});
|
|
116
122
|
const PASTE_FILE_ID = 'filesExplorer.paste';
|
|
117
123
|
CommandsRegistry.registerCommand(PASTE_FILE_ID, pasteFileHandler);
|
|
118
124
|
KeybindingsRegistry.registerKeybindingRule({
|
|
119
125
|
id: `^${PASTE_FILE_ID}`,
|
|
120
|
-
weight:
|
|
121
|
-
when: ( (ContextKeyExpr.and(
|
|
122
|
-
|
|
126
|
+
weight: 200 + explorerCommandsWeightBonus,
|
|
127
|
+
when: ( (ContextKeyExpr.and(
|
|
128
|
+
FilesExplorerFocusCondition,
|
|
129
|
+
ExplorerResourceNotReadonlyContext,
|
|
130
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
131
|
+
))),
|
|
132
|
+
primary: 2048 | 52 ,
|
|
123
133
|
});
|
|
124
134
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
125
135
|
id: 'filesExplorer.cancelCut',
|
|
126
|
-
weight:
|
|
136
|
+
weight: 200 + explorerCommandsWeightBonus,
|
|
127
137
|
when: ( (ContextKeyExpr.and(FilesExplorerFocusCondition, ExplorerResourceCut))),
|
|
128
|
-
primary:
|
|
138
|
+
primary: 9 ,
|
|
129
139
|
handler: async (accessor) => {
|
|
130
140
|
const explorerService = accessor.get(IExplorerService);
|
|
131
141
|
await explorerService.setToCopy([], true);
|
|
@@ -133,25 +143,29 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
133
143
|
});
|
|
134
144
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
135
145
|
id: 'filesExplorer.openFilePreserveFocus',
|
|
136
|
-
weight:
|
|
146
|
+
weight: 200 + explorerCommandsWeightBonus,
|
|
137
147
|
when: ( (ContextKeyExpr.and(
|
|
138
148
|
FilesExplorerFocusCondition,
|
|
139
149
|
(ExplorerFolderContext.toNegated())
|
|
140
150
|
))),
|
|
141
|
-
primary:
|
|
151
|
+
primary: 10 ,
|
|
142
152
|
handler: openFilePreserveFocusHandler
|
|
143
153
|
});
|
|
144
154
|
const copyPathCommand = {
|
|
145
155
|
id: COPY_PATH_COMMAND_ID,
|
|
146
|
-
title: ( localize(
|
|
156
|
+
title: ( localize(2171, "Copy Path"))
|
|
147
157
|
};
|
|
148
158
|
const copyRelativePathCommand = {
|
|
149
159
|
id: COPY_RELATIVE_PATH_COMMAND_ID,
|
|
150
|
-
title: ( localize(
|
|
160
|
+
title: ( localize(2172, "Copy Relative Path"))
|
|
161
|
+
};
|
|
162
|
+
const revealInsideBarCommand = {
|
|
163
|
+
id: REVEAL_IN_EXPLORER_COMMAND_ID,
|
|
164
|
+
title: ( localize(2173, "Reveal in Explorer View"))
|
|
151
165
|
};
|
|
152
166
|
appendEditorTitleContextMenuItem(COPY_PATH_COMMAND_ID, copyPathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste', true);
|
|
153
167
|
appendEditorTitleContextMenuItem(COPY_RELATIVE_PATH_COMMAND_ID, copyRelativePathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste', true);
|
|
154
|
-
appendEditorTitleContextMenuItem(
|
|
168
|
+
appendEditorTitleContextMenuItem(revealInsideBarCommand.id, revealInsideBarCommand.title, ResourceContextKey.IsFileSystemResource, '2_files', false, 1);
|
|
155
169
|
function appendEditorTitleContextMenuItem(id, title, when, group, supportsMultiSelect, order) {
|
|
156
170
|
const precondition = supportsMultiSelect !== true ? ( (MultipleEditorsSelectedInGroupContext.negate())) : undefined;
|
|
157
171
|
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, {
|
|
@@ -161,8 +175,8 @@ function appendEditorTitleContextMenuItem(id, title, when, group, supportsMultiS
|
|
|
161
175
|
order,
|
|
162
176
|
});
|
|
163
177
|
}
|
|
164
|
-
appendSaveConflictEditorTitleAction('workbench.files.action.acceptLocalChanges', ( localize(
|
|
165
|
-
appendSaveConflictEditorTitleAction('workbench.files.action.revertLocalChanges', ( localize(
|
|
178
|
+
appendSaveConflictEditorTitleAction('workbench.files.action.acceptLocalChanges', ( localize(2174, "Use your changes and overwrite file contents")), Codicon.check, -10, acceptLocalChangesCommand);
|
|
179
|
+
appendSaveConflictEditorTitleAction('workbench.files.action.revertLocalChanges', ( localize(2175, "Discard your changes and revert to file contents")), Codicon.discard, -9, revertLocalChangesCommand);
|
|
166
180
|
function appendSaveConflictEditorTitleAction(id, title, icon, order, command) {
|
|
167
181
|
CommandsRegistry.registerCommand(id, command);
|
|
168
182
|
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|
@@ -185,12 +199,12 @@ function appendToCommandPalette({ id, title, category, metadata }, when) {
|
|
|
185
199
|
}
|
|
186
200
|
appendToCommandPalette({
|
|
187
201
|
id: COPY_PATH_COMMAND_ID,
|
|
188
|
-
title: ( localize2(
|
|
202
|
+
title: ( localize2(2176, "Copy Path of Active File")),
|
|
189
203
|
category: Categories.File
|
|
190
204
|
});
|
|
191
205
|
appendToCommandPalette({
|
|
192
206
|
id: COPY_RELATIVE_PATH_COMMAND_ID,
|
|
193
|
-
title: ( localize2(
|
|
207
|
+
title: ( localize2(2177, "Copy Relative Path of Active File")),
|
|
194
208
|
category: Categories.File
|
|
195
209
|
});
|
|
196
210
|
appendToCommandPalette({
|
|
@@ -205,26 +219,26 @@ appendToCommandPalette({
|
|
|
205
219
|
});
|
|
206
220
|
appendToCommandPalette({
|
|
207
221
|
id: SAVE_ALL_IN_GROUP_COMMAND_ID,
|
|
208
|
-
title: ( localize2(
|
|
222
|
+
title: ( localize2(2178, "Save All in Group")),
|
|
209
223
|
category: Categories.File
|
|
210
224
|
});
|
|
211
225
|
appendToCommandPalette({
|
|
212
226
|
id: SAVE_FILES_COMMAND_ID,
|
|
213
|
-
title: ( localize2(
|
|
227
|
+
title: ( localize2(2179, "Save All Files")),
|
|
214
228
|
category: Categories.File
|
|
215
229
|
});
|
|
216
230
|
appendToCommandPalette({
|
|
217
231
|
id: REVERT_FILE_COMMAND_ID,
|
|
218
|
-
title: ( localize2(
|
|
232
|
+
title: ( localize2(2180, "Revert File")),
|
|
219
233
|
category: Categories.File
|
|
220
234
|
});
|
|
221
235
|
appendToCommandPalette({
|
|
222
236
|
id: COMPARE_WITH_SAVED_COMMAND_ID,
|
|
223
|
-
title: ( localize2(
|
|
237
|
+
title: ( localize2(2181, "Compare Active File with Saved")),
|
|
224
238
|
category: Categories.File,
|
|
225
239
|
metadata: {
|
|
226
240
|
description: ( localize2(
|
|
227
|
-
|
|
241
|
+
2182,
|
|
228
242
|
"Opens a new diff editor to compare the active file with the version on disk."
|
|
229
243
|
))
|
|
230
244
|
}
|
|
@@ -243,7 +257,7 @@ appendToCommandPalette({
|
|
|
243
257
|
id: NEW_FOLDER_COMMAND_ID,
|
|
244
258
|
title: NEW_FOLDER_LABEL,
|
|
245
259
|
category: Categories.File,
|
|
246
|
-
metadata: { description: ( localize2(
|
|
260
|
+
metadata: { description: ( localize2(2183, "Create a new folder or directory")) }
|
|
247
261
|
}, ( (WorkspaceFolderCountContext.notEqualsTo('0'))));
|
|
248
262
|
appendToCommandPalette({
|
|
249
263
|
id: NEW_UNTITLED_FILE_COMMAND_ID,
|
|
@@ -256,7 +270,7 @@ const isFileOrUntitledResourceContextKey = ( (ContextKeyExpr.or(
|
|
|
256
270
|
)));
|
|
257
271
|
const openToSideCommand = {
|
|
258
272
|
id: OPEN_TO_SIDE_COMMAND_ID,
|
|
259
|
-
title: ( localize(
|
|
273
|
+
title: ( localize(2184, "Open to the Side"))
|
|
260
274
|
};
|
|
261
275
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
262
276
|
group: 'navigation',
|
|
@@ -269,7 +283,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
269
283
|
order: 10,
|
|
270
284
|
command: {
|
|
271
285
|
id: REOPEN_WITH_COMMAND_ID,
|
|
272
|
-
title: ( localize(
|
|
286
|
+
title: ( localize(2185, "Reopen Editor With..."))
|
|
273
287
|
},
|
|
274
288
|
when: ( (ContextKeyExpr.and(
|
|
275
289
|
ActiveEditorAvailableEditorIdsContext,
|
|
@@ -307,7 +321,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
307
321
|
order: 20,
|
|
308
322
|
command: {
|
|
309
323
|
id: REVERT_FILE_COMMAND_ID,
|
|
310
|
-
title: ( localize(
|
|
324
|
+
title: ( localize(2180, "Revert File")),
|
|
311
325
|
precondition: OpenEditorsDirtyEditorContext
|
|
312
326
|
},
|
|
313
327
|
when: ( (ContextKeyExpr.and(
|
|
@@ -321,7 +335,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
321
335
|
order: 30,
|
|
322
336
|
command: {
|
|
323
337
|
id: SAVE_ALL_IN_GROUP_COMMAND_ID,
|
|
324
|
-
title: ( localize(
|
|
338
|
+
title: ( localize(2186, "Save All")),
|
|
325
339
|
precondition: DirtyWorkingCopiesContext
|
|
326
340
|
},
|
|
327
341
|
when: OpenEditorsGroupContext
|
|
@@ -331,7 +345,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
331
345
|
order: 10,
|
|
332
346
|
command: {
|
|
333
347
|
id: COMPARE_WITH_SAVED_COMMAND_ID,
|
|
334
|
-
title: ( localize(
|
|
348
|
+
title: ( localize(2187, "Compare with Saved")),
|
|
335
349
|
precondition: OpenEditorsDirtyEditorContext
|
|
336
350
|
},
|
|
337
351
|
when: ( (ContextKeyExpr.and(
|
|
@@ -342,7 +356,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
342
356
|
});
|
|
343
357
|
const compareResourceCommand = {
|
|
344
358
|
id: COMPARE_RESOURCE_COMMAND_ID,
|
|
345
|
-
title: ( localize(
|
|
359
|
+
title: ( localize(2188, "Compare with Selected"))
|
|
346
360
|
};
|
|
347
361
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
348
362
|
group: '3_compare',
|
|
@@ -357,7 +371,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
357
371
|
});
|
|
358
372
|
const selectForCompareCommand = {
|
|
359
373
|
id: SELECT_FOR_COMPARE_COMMAND_ID,
|
|
360
|
-
title: ( localize(
|
|
374
|
+
title: ( localize(2189, "Select for Compare"))
|
|
361
375
|
};
|
|
362
376
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
363
377
|
group: '3_compare',
|
|
@@ -371,7 +385,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
371
385
|
});
|
|
372
386
|
const compareSelectedCommand = {
|
|
373
387
|
id: COMPARE_SELECTED_COMMAND_ID,
|
|
374
|
-
title: ( localize(
|
|
388
|
+
title: ( localize(2190, "Compare Selected"))
|
|
375
389
|
};
|
|
376
390
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
377
391
|
group: '3_compare',
|
|
@@ -398,7 +412,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
398
412
|
order: 10,
|
|
399
413
|
command: {
|
|
400
414
|
id: CLOSE_EDITOR_COMMAND_ID,
|
|
401
|
-
title: ( localize(
|
|
415
|
+
title: ( localize(2191, "Close"))
|
|
402
416
|
},
|
|
403
417
|
when: ( (OpenEditorsGroupContext.toNegated()))
|
|
404
418
|
});
|
|
@@ -407,7 +421,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
407
421
|
order: 20,
|
|
408
422
|
command: {
|
|
409
423
|
id: CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID,
|
|
410
|
-
title: ( localize(
|
|
424
|
+
title: ( localize(2192, "Close Others"))
|
|
411
425
|
},
|
|
412
426
|
when: ( (OpenEditorsGroupContext.toNegated()))
|
|
413
427
|
});
|
|
@@ -416,7 +430,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
416
430
|
order: 30,
|
|
417
431
|
command: {
|
|
418
432
|
id: CLOSE_SAVED_EDITORS_COMMAND_ID,
|
|
419
|
-
title: ( localize(
|
|
433
|
+
title: ( localize(2193, "Close Saved"))
|
|
420
434
|
}
|
|
421
435
|
});
|
|
422
436
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
@@ -424,7 +438,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
424
438
|
order: 40,
|
|
425
439
|
command: {
|
|
426
440
|
id: CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
|
|
427
|
-
title: ( localize(
|
|
441
|
+
title: ( localize(2194, "Close All"))
|
|
428
442
|
}
|
|
429
443
|
});
|
|
430
444
|
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
@@ -433,7 +447,10 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
433
447
|
command: {
|
|
434
448
|
id: NEW_FILE_COMMAND_ID,
|
|
435
449
|
title: NEW_FILE_LABEL,
|
|
436
|
-
precondition:
|
|
450
|
+
precondition: ( (ContextKeyExpr.and(
|
|
451
|
+
ExplorerResourceNotReadonlyContext,
|
|
452
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
453
|
+
)))
|
|
437
454
|
},
|
|
438
455
|
when: ExplorerFolderContext
|
|
439
456
|
});
|
|
@@ -443,7 +460,10 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
443
460
|
command: {
|
|
444
461
|
id: NEW_FOLDER_COMMAND_ID,
|
|
445
462
|
title: NEW_FOLDER_LABEL,
|
|
446
|
-
precondition:
|
|
463
|
+
precondition: ( (ContextKeyExpr.and(
|
|
464
|
+
ExplorerResourceNotReadonlyContext,
|
|
465
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
466
|
+
)))
|
|
447
467
|
},
|
|
448
468
|
when: ExplorerFolderContext
|
|
449
469
|
});
|
|
@@ -461,7 +481,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
461
481
|
order: 20,
|
|
462
482
|
command: {
|
|
463
483
|
id: OPEN_WITH_EXPLORER_COMMAND_ID,
|
|
464
|
-
title: ( localize(
|
|
484
|
+
title: ( localize(2195, "Open With...")),
|
|
465
485
|
},
|
|
466
486
|
when: ( (ContextKeyExpr.and(
|
|
467
487
|
(ExplorerFolderContext.toNegated()),
|
|
@@ -504,7 +524,8 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
504
524
|
order: 8,
|
|
505
525
|
command: {
|
|
506
526
|
id: CUT_FILE_ID,
|
|
507
|
-
title: ( localize(
|
|
527
|
+
title: ( localize(2196, "Cut")),
|
|
528
|
+
precondition: ( (WorkbenchTreeFindOpen.toNegated()))
|
|
508
529
|
},
|
|
509
530
|
when: ( (ContextKeyExpr.and(
|
|
510
531
|
(ExplorerRootContext.toNegated()),
|
|
@@ -516,7 +537,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
516
537
|
order: 10,
|
|
517
538
|
command: {
|
|
518
539
|
id: COPY_FILE_ID,
|
|
519
|
-
title: COPY_FILE_LABEL
|
|
540
|
+
title: COPY_FILE_LABEL,
|
|
520
541
|
},
|
|
521
542
|
when: ( (ExplorerRootContext.toNegated()))
|
|
522
543
|
});
|
|
@@ -526,7 +547,11 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
526
547
|
command: {
|
|
527
548
|
id: PASTE_FILE_ID,
|
|
528
549
|
title: PASTE_FILE_LABEL,
|
|
529
|
-
precondition: ( (ContextKeyExpr.and(
|
|
550
|
+
precondition: ( (ContextKeyExpr.and(
|
|
551
|
+
ExplorerResourceNotReadonlyContext,
|
|
552
|
+
FileCopiedContext,
|
|
553
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
554
|
+
)))
|
|
530
555
|
},
|
|
531
556
|
when: ExplorerFolderContext
|
|
532
557
|
});
|
|
@@ -578,7 +603,8 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
578
603
|
order: 10,
|
|
579
604
|
command: {
|
|
580
605
|
id: ADD_ROOT_FOLDER_COMMAND_ID,
|
|
581
|
-
title: ADD_ROOT_FOLDER_LABEL
|
|
606
|
+
title: ADD_ROOT_FOLDER_LABEL,
|
|
607
|
+
precondition: ( (WorkbenchTreeFindOpen.toNegated()))
|
|
582
608
|
},
|
|
583
609
|
when: ( (ContextKeyExpr.and(ExplorerRootContext, (ContextKeyExpr.or(
|
|
584
610
|
EnterMultiRootWorkspaceSupportContext,
|
|
@@ -590,7 +616,8 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
590
616
|
order: 30,
|
|
591
617
|
command: {
|
|
592
618
|
id: REMOVE_ROOT_FOLDER_COMMAND_ID,
|
|
593
|
-
title: REMOVE_ROOT_FOLDER_LABEL
|
|
619
|
+
title: REMOVE_ROOT_FOLDER_LABEL,
|
|
620
|
+
precondition: ( (WorkbenchTreeFindOpen.toNegated()))
|
|
594
621
|
},
|
|
595
622
|
when: ( (ContextKeyExpr.and(
|
|
596
623
|
ExplorerRootContext,
|
|
@@ -610,7 +637,10 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
610
637
|
command: {
|
|
611
638
|
id: RENAME_ID,
|
|
612
639
|
title: TRIGGER_RENAME_LABEL,
|
|
613
|
-
precondition:
|
|
640
|
+
precondition: ( (ContextKeyExpr.and(
|
|
641
|
+
ExplorerResourceNotReadonlyContext,
|
|
642
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
643
|
+
))),
|
|
614
644
|
},
|
|
615
645
|
when: ( (ExplorerRootContext.toNegated()))
|
|
616
646
|
});
|
|
@@ -620,12 +650,18 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
620
650
|
command: {
|
|
621
651
|
id: MOVE_FILE_TO_TRASH_ID,
|
|
622
652
|
title: MOVE_FILE_TO_TRASH_LABEL,
|
|
623
|
-
precondition:
|
|
653
|
+
precondition: ( (ContextKeyExpr.and(
|
|
654
|
+
ExplorerResourceNotReadonlyContext,
|
|
655
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
656
|
+
))),
|
|
624
657
|
},
|
|
625
658
|
alt: {
|
|
626
659
|
id: DELETE_FILE_ID,
|
|
627
|
-
title: ( localize(
|
|
628
|
-
precondition:
|
|
660
|
+
title: ( localize(2197, "Delete Permanently")),
|
|
661
|
+
precondition: ( (ContextKeyExpr.and(
|
|
662
|
+
ExplorerResourceNotReadonlyContext,
|
|
663
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
664
|
+
))),
|
|
629
665
|
},
|
|
630
666
|
when: ( (ContextKeyExpr.and(
|
|
631
667
|
(ExplorerRootContext.toNegated()),
|
|
@@ -637,8 +673,11 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
637
673
|
order: 20,
|
|
638
674
|
command: {
|
|
639
675
|
id: DELETE_FILE_ID,
|
|
640
|
-
title: ( localize(
|
|
641
|
-
precondition:
|
|
676
|
+
title: ( localize(2197, "Delete Permanently")),
|
|
677
|
+
precondition: ( (ContextKeyExpr.and(
|
|
678
|
+
ExplorerResourceNotReadonlyContext,
|
|
679
|
+
(WorkbenchTreeFindOpen.toNegated())
|
|
680
|
+
))),
|
|
642
681
|
},
|
|
643
682
|
when: ( (ContextKeyExpr.and(
|
|
644
683
|
(ExplorerRootContext.toNegated()),
|
|
@@ -646,14 +685,14 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
646
685
|
)))
|
|
647
686
|
});
|
|
648
687
|
for (const menuId of [MenuId.EmptyEditorGroupContext, MenuId.EditorTabsBarContext]) {
|
|
649
|
-
MenuRegistry.appendMenuItem(menuId, { command: { id: NEW_UNTITLED_FILE_COMMAND_ID, title: ( localize(
|
|
650
|
-
MenuRegistry.appendMenuItem(menuId, { command: { id: 'workbench.action.quickOpen', title: ( localize(
|
|
688
|
+
MenuRegistry.appendMenuItem(menuId, { command: { id: NEW_UNTITLED_FILE_COMMAND_ID, title: ( localize(2198, "New Text File")) }, group: '1_file', order: 10 });
|
|
689
|
+
MenuRegistry.appendMenuItem(menuId, { command: { id: 'workbench.action.quickOpen', title: ( localize(2199, "Open File...")) }, group: '1_file', order: 20 });
|
|
651
690
|
}
|
|
652
691
|
MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
653
692
|
group: '1_new',
|
|
654
693
|
command: {
|
|
655
694
|
id: NEW_UNTITLED_FILE_COMMAND_ID,
|
|
656
|
-
title: ( localize(
|
|
695
|
+
title: ( localize(2200, "&&New Text File"))
|
|
657
696
|
},
|
|
658
697
|
order: 1
|
|
659
698
|
});
|
|
@@ -661,7 +700,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
661
700
|
group: '4_save',
|
|
662
701
|
command: {
|
|
663
702
|
id: SAVE_FILE_COMMAND_ID,
|
|
664
|
-
title: ( localize(
|
|
703
|
+
title: ( localize(2201, "&&Save")),
|
|
665
704
|
precondition: ( (ContextKeyExpr.or(
|
|
666
705
|
ActiveEditorContext,
|
|
667
706
|
(ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))
|
|
@@ -673,7 +712,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
673
712
|
group: '4_save',
|
|
674
713
|
command: {
|
|
675
714
|
id: SAVE_FILE_AS_COMMAND_ID,
|
|
676
|
-
title: ( localize(
|
|
715
|
+
title: ( localize(2202, "Save &&As...")),
|
|
677
716
|
precondition: ( (ContextKeyExpr.or(
|
|
678
717
|
ActiveEditorContext,
|
|
679
718
|
(ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))
|
|
@@ -685,7 +724,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
685
724
|
group: '4_save',
|
|
686
725
|
command: {
|
|
687
726
|
id: SAVE_ALL_COMMAND_ID,
|
|
688
|
-
title: ( localize(
|
|
727
|
+
title: ( localize(2203, "Save A&&ll")),
|
|
689
728
|
precondition: DirtyWorkingCopiesContext
|
|
690
729
|
},
|
|
691
730
|
order: 3
|
|
@@ -694,7 +733,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
694
733
|
group: '5_autosave',
|
|
695
734
|
command: {
|
|
696
735
|
id: ToggleAutoSaveAction.ID,
|
|
697
|
-
title: ( localize(
|
|
736
|
+
title: ( localize(2204, "A&&uto Save")),
|
|
698
737
|
toggled: ( (ContextKeyExpr.notEquals('config.files.autoSave', 'off')))
|
|
699
738
|
},
|
|
700
739
|
order: 1
|
|
@@ -703,7 +742,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
703
742
|
group: '6_close',
|
|
704
743
|
command: {
|
|
705
744
|
id: REVERT_FILE_COMMAND_ID,
|
|
706
|
-
title: ( localize(
|
|
745
|
+
title: ( localize(2205, "Re&&vert File")),
|
|
707
746
|
precondition: ( (ContextKeyExpr.or(
|
|
708
747
|
(ContextKeyExpr.and(ActiveEditorCanRevertContext)),
|
|
709
748
|
(ContextKeyExpr.and(
|
|
@@ -718,7 +757,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
718
757
|
group: '6_close',
|
|
719
758
|
command: {
|
|
720
759
|
id: CLOSE_EDITOR_COMMAND_ID,
|
|
721
|
-
title: ( localize(
|
|
760
|
+
title: ( localize(2206, "&&Close Editor")),
|
|
722
761
|
precondition: ( (ContextKeyExpr.or(
|
|
723
762
|
ActiveEditorContext,
|
|
724
763
|
(ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))
|
|
@@ -730,9 +769,36 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
|
|
|
730
769
|
group: '3_global_nav',
|
|
731
770
|
command: {
|
|
732
771
|
id: 'workbench.action.quickOpen',
|
|
733
|
-
title: ( localize(
|
|
772
|
+
title: ( localize(2207, "Go to &&File..."))
|
|
734
773
|
},
|
|
735
774
|
order: 1
|
|
736
775
|
});
|
|
776
|
+
MenuRegistry.appendMenuItem(MenuId.ChatInlineResourceAnchorContext, {
|
|
777
|
+
group: 'navigation',
|
|
778
|
+
order: 10,
|
|
779
|
+
command: openToSideCommand,
|
|
780
|
+
when: ( (ContextKeyExpr.and(
|
|
781
|
+
ResourceContextKey.HasResource,
|
|
782
|
+
(ExplorerFolderContext.toNegated())
|
|
783
|
+
)))
|
|
784
|
+
});
|
|
785
|
+
MenuRegistry.appendMenuItem(MenuId.ChatInlineResourceAnchorContext, {
|
|
786
|
+
group: 'navigation',
|
|
787
|
+
order: 20,
|
|
788
|
+
command: revealInsideBarCommand,
|
|
789
|
+
when: ResourceContextKey.IsFileSystemResource
|
|
790
|
+
});
|
|
791
|
+
MenuRegistry.appendMenuItem(MenuId.ChatInlineResourceAnchorContext, {
|
|
792
|
+
group: '1_cutcopypaste',
|
|
793
|
+
order: 10,
|
|
794
|
+
command: copyPathCommand,
|
|
795
|
+
when: ResourceContextKey.IsFileSystemResource
|
|
796
|
+
});
|
|
797
|
+
MenuRegistry.appendMenuItem(MenuId.ChatInlineResourceAnchorContext, {
|
|
798
|
+
group: '1_cutcopypaste',
|
|
799
|
+
order: 20,
|
|
800
|
+
command: copyRelativePathCommand,
|
|
801
|
+
when: ResourceContextKey.IsFileSystemResource
|
|
802
|
+
});
|
|
737
803
|
|
|
738
|
-
export { appendEditorTitleContextMenuItem, appendToCommandPalette };
|
|
804
|
+
export { appendEditorTitleContextMenuItem, appendToCommandPalette, revealInsideBarCommand };
|