@codingame/monaco-vscode-explorer-service-override 7.1.0 → 7.1.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-explorer-service-override",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@7.1.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@7.1.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
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
5
|
import { KeyCode, KeyMod } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
6
6
|
import { openWindowCommand, newWindowCommand } from './fileCommands.js';
|
|
7
|
-
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, OpenEditorsDirtyEditorContext, OpenEditorsGroupContext, OpenEditorsReadonlyEditorContext, 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, SAVE_ALL_COMMAND_ID } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileConstants';
|
|
7
|
+
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, OpenEditorsDirtyEditorContext, OpenEditorsGroupContext, 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
8
|
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
9
9
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
10
10
|
import { KeybindingsRegistry, KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
@@ -14,13 +14,12 @@ import { REOPEN_WITH_COMMAND_ID, CLOSE_EDITOR_COMMAND_ID, CLOSE_OTHER_EDITORS_IN
|
|
|
14
14
|
import { AutoSaveAfterShortDelayContext } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
15
15
|
import { WorkbenchListDoubleSelection } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
16
16
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
17
|
-
import { ResourceContextKey, MultipleEditorsSelectedInGroupContext, WorkspaceFolderCountContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, TwoEditorsSelectedInGroupContext, HasWebFileSystemAccess, EnterMultiRootWorkspaceSupportContext, WorkbenchStateContext, ActiveEditorContext, SidebarFocusContext, ActiveEditorCanRevertContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
17
|
+
import { ResourceContextKey, MultipleEditorsSelectedInGroupContext, WorkspaceFolderCountContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, TwoEditorsSelectedInGroupContext, SelectedEditorsInGroupFileOrUntitledResourceContextKey, HasWebFileSystemAccess, EnterMultiRootWorkspaceSupportContext, WorkbenchStateContext, ActiveEditorContext, SidebarFocusContext, ActiveEditorCanRevertContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
18
18
|
import { IsWebContext } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
19
19
|
import { IExplorerService } from 'vscode/vscode/vs/workbench/contrib/files/browser/files.service';
|
|
20
20
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
21
21
|
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
22
22
|
|
|
23
|
-
const _moduleId = "vs/workbench/contrib/files/browser/fileActions.contribution";
|
|
24
23
|
registerAction2(GlobalCompareResourcesAction);
|
|
25
24
|
registerAction2(FocusFilesExplorer);
|
|
26
25
|
registerAction2(ShowActiveFileInExplorer);
|
|
@@ -144,15 +143,15 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
144
143
|
});
|
|
145
144
|
const copyPathCommand = {
|
|
146
145
|
id: COPY_PATH_COMMAND_ID,
|
|
147
|
-
title: (
|
|
146
|
+
title: ( localize(2140, "Copy Path"))
|
|
148
147
|
};
|
|
149
148
|
const copyRelativePathCommand = {
|
|
150
149
|
id: COPY_RELATIVE_PATH_COMMAND_ID,
|
|
151
|
-
title: (
|
|
150
|
+
title: ( localize(2141, "Copy Relative Path"))
|
|
152
151
|
};
|
|
153
152
|
appendEditorTitleContextMenuItem(COPY_PATH_COMMAND_ID, copyPathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste', true);
|
|
154
153
|
appendEditorTitleContextMenuItem(COPY_RELATIVE_PATH_COMMAND_ID, copyRelativePathCommand.title, ResourceContextKey.IsFileSystemResource, '1_cutcopypaste', true);
|
|
155
|
-
appendEditorTitleContextMenuItem(REVEAL_IN_EXPLORER_COMMAND_ID, (
|
|
154
|
+
appendEditorTitleContextMenuItem(REVEAL_IN_EXPLORER_COMMAND_ID, ( localize(2142, "Reveal in Explorer View")), ResourceContextKey.IsFileSystemResource, '2_files', false, 1);
|
|
156
155
|
function appendEditorTitleContextMenuItem(id, title, when, group, supportsMultiSelect, order) {
|
|
157
156
|
const precondition = supportsMultiSelect !== true ? ( (MultipleEditorsSelectedInGroupContext.negate())) : undefined;
|
|
158
157
|
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, {
|
|
@@ -162,8 +161,8 @@ function appendEditorTitleContextMenuItem(id, title, when, group, supportsMultiS
|
|
|
162
161
|
order,
|
|
163
162
|
});
|
|
164
163
|
}
|
|
165
|
-
appendSaveConflictEditorTitleAction('workbench.files.action.acceptLocalChanges', (
|
|
166
|
-
appendSaveConflictEditorTitleAction('workbench.files.action.revertLocalChanges', (
|
|
164
|
+
appendSaveConflictEditorTitleAction('workbench.files.action.acceptLocalChanges', ( localize(2143, "Use your changes and overwrite file contents")), Codicon.check, -10, acceptLocalChangesCommand);
|
|
165
|
+
appendSaveConflictEditorTitleAction('workbench.files.action.revertLocalChanges', ( localize(2144, "Discard your changes and revert to file contents")), Codicon.discard, -9, revertLocalChangesCommand);
|
|
167
166
|
function appendSaveConflictEditorTitleAction(id, title, icon, order, command) {
|
|
168
167
|
CommandsRegistry.registerCommand(id, command);
|
|
169
168
|
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
|
@@ -186,12 +185,12 @@ function appendToCommandPalette({ id, title, category, metadata }, when) {
|
|
|
186
185
|
}
|
|
187
186
|
appendToCommandPalette({
|
|
188
187
|
id: COPY_PATH_COMMAND_ID,
|
|
189
|
-
title: (
|
|
188
|
+
title: ( localize2(2145, "Copy Path of Active File")),
|
|
190
189
|
category: Categories.File
|
|
191
190
|
});
|
|
192
191
|
appendToCommandPalette({
|
|
193
192
|
id: COPY_RELATIVE_PATH_COMMAND_ID,
|
|
194
|
-
title: (
|
|
193
|
+
title: ( localize2(2146, "Copy Relative Path of Active File")),
|
|
195
194
|
category: Categories.File
|
|
196
195
|
});
|
|
197
196
|
appendToCommandPalette({
|
|
@@ -206,27 +205,26 @@ appendToCommandPalette({
|
|
|
206
205
|
});
|
|
207
206
|
appendToCommandPalette({
|
|
208
207
|
id: SAVE_ALL_IN_GROUP_COMMAND_ID,
|
|
209
|
-
title: (
|
|
208
|
+
title: ( localize2(2147, "Save All in Group")),
|
|
210
209
|
category: Categories.File
|
|
211
210
|
});
|
|
212
211
|
appendToCommandPalette({
|
|
213
212
|
id: SAVE_FILES_COMMAND_ID,
|
|
214
|
-
title: (
|
|
213
|
+
title: ( localize2(2148, "Save All Files")),
|
|
215
214
|
category: Categories.File
|
|
216
215
|
});
|
|
217
216
|
appendToCommandPalette({
|
|
218
217
|
id: REVERT_FILE_COMMAND_ID,
|
|
219
|
-
title: (
|
|
218
|
+
title: ( localize2(2149, "Revert File")),
|
|
220
219
|
category: Categories.File
|
|
221
220
|
});
|
|
222
221
|
appendToCommandPalette({
|
|
223
222
|
id: COMPARE_WITH_SAVED_COMMAND_ID,
|
|
224
|
-
title: (
|
|
223
|
+
title: ( localize2(2150, "Compare Active File with Saved")),
|
|
225
224
|
category: Categories.File,
|
|
226
225
|
metadata: {
|
|
227
|
-
description: (
|
|
228
|
-
|
|
229
|
-
11,
|
|
226
|
+
description: ( localize2(
|
|
227
|
+
2151,
|
|
230
228
|
"Opens a new diff editor to compare the active file with the version on disk."
|
|
231
229
|
))
|
|
232
230
|
}
|
|
@@ -245,7 +243,7 @@ appendToCommandPalette({
|
|
|
245
243
|
id: NEW_FOLDER_COMMAND_ID,
|
|
246
244
|
title: NEW_FOLDER_LABEL,
|
|
247
245
|
category: Categories.File,
|
|
248
|
-
metadata: { description: (
|
|
246
|
+
metadata: { description: ( localize2(2152, "Create a new folder or directory")) }
|
|
249
247
|
}, ( (WorkspaceFolderCountContext.notEqualsTo('0'))));
|
|
250
248
|
appendToCommandPalette({
|
|
251
249
|
id: NEW_UNTITLED_FILE_COMMAND_ID,
|
|
@@ -258,7 +256,7 @@ const isFileOrUntitledResourceContextKey = ( (ContextKeyExpr.or(
|
|
|
258
256
|
)));
|
|
259
257
|
const openToSideCommand = {
|
|
260
258
|
id: OPEN_TO_SIDE_COMMAND_ID,
|
|
261
|
-
title: (
|
|
259
|
+
title: ( localize(2153, "Open to the Side"))
|
|
262
260
|
};
|
|
263
261
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
264
262
|
group: 'navigation',
|
|
@@ -271,7 +269,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
271
269
|
order: 10,
|
|
272
270
|
command: {
|
|
273
271
|
id: REOPEN_WITH_COMMAND_ID,
|
|
274
|
-
title: (
|
|
272
|
+
title: ( localize(2154, "Reopen Editor With..."))
|
|
275
273
|
},
|
|
276
274
|
when: ActiveEditorAvailableEditorIdsContext
|
|
277
275
|
});
|
|
@@ -307,7 +305,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
307
305
|
order: 20,
|
|
308
306
|
command: {
|
|
309
307
|
id: REVERT_FILE_COMMAND_ID,
|
|
310
|
-
title: (
|
|
308
|
+
title: ( localize(2154, "Revert File")),
|
|
311
309
|
precondition: OpenEditorsDirtyEditorContext
|
|
312
310
|
},
|
|
313
311
|
when: ( (ContextKeyExpr.and(
|
|
@@ -321,7 +319,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
321
319
|
order: 30,
|
|
322
320
|
command: {
|
|
323
321
|
id: SAVE_ALL_IN_GROUP_COMMAND_ID,
|
|
324
|
-
title: (
|
|
322
|
+
title: ( localize(2155, "Save All")),
|
|
325
323
|
precondition: DirtyWorkingCopiesContext
|
|
326
324
|
},
|
|
327
325
|
when: OpenEditorsGroupContext
|
|
@@ -331,7 +329,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
331
329
|
order: 10,
|
|
332
330
|
command: {
|
|
333
331
|
id: COMPARE_WITH_SAVED_COMMAND_ID,
|
|
334
|
-
title: (
|
|
332
|
+
title: ( localize(2156, "Compare with Saved")),
|
|
335
333
|
precondition: OpenEditorsDirtyEditorContext
|
|
336
334
|
},
|
|
337
335
|
when: ( (ContextKeyExpr.and(
|
|
@@ -342,7 +340,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
342
340
|
});
|
|
343
341
|
const compareResourceCommand = {
|
|
344
342
|
id: COMPARE_RESOURCE_COMMAND_ID,
|
|
345
|
-
title: (
|
|
343
|
+
title: ( localize(2157, "Compare with Selected"))
|
|
346
344
|
};
|
|
347
345
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
348
346
|
group: '3_compare',
|
|
@@ -357,7 +355,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
357
355
|
});
|
|
358
356
|
const selectForCompareCommand = {
|
|
359
357
|
id: SELECT_FOR_COMPARE_COMMAND_ID,
|
|
360
|
-
title: (
|
|
358
|
+
title: ( localize(2158, "Select for Compare"))
|
|
361
359
|
};
|
|
362
360
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
363
361
|
group: '3_compare',
|
|
@@ -371,7 +369,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
371
369
|
});
|
|
372
370
|
const compareSelectedCommand = {
|
|
373
371
|
id: COMPARE_SELECTED_COMMAND_ID,
|
|
374
|
-
title: (
|
|
372
|
+
title: ( localize(2159, "Compare Selected"))
|
|
375
373
|
};
|
|
376
374
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
377
375
|
group: '3_compare',
|
|
@@ -380,17 +378,17 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
380
378
|
when: ( (ContextKeyExpr.and(
|
|
381
379
|
ResourceContextKey.HasResource,
|
|
382
380
|
WorkbenchListDoubleSelection,
|
|
383
|
-
|
|
381
|
+
OpenEditorsSelectedFileOrUntitledContext
|
|
384
382
|
)))
|
|
385
383
|
});
|
|
386
384
|
MenuRegistry.appendMenuItem(MenuId.EditorTitleContext, {
|
|
387
|
-
group: '
|
|
385
|
+
group: '1_compare',
|
|
388
386
|
order: 30,
|
|
389
387
|
command: compareSelectedCommand,
|
|
390
388
|
when: ( (ContextKeyExpr.and(
|
|
391
389
|
ResourceContextKey.HasResource,
|
|
392
390
|
TwoEditorsSelectedInGroupContext,
|
|
393
|
-
|
|
391
|
+
SelectedEditorsInGroupFileOrUntitledResourceContextKey
|
|
394
392
|
)))
|
|
395
393
|
});
|
|
396
394
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
@@ -398,7 +396,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
398
396
|
order: 10,
|
|
399
397
|
command: {
|
|
400
398
|
id: CLOSE_EDITOR_COMMAND_ID,
|
|
401
|
-
title: (
|
|
399
|
+
title: ( localize(2160, "Close"))
|
|
402
400
|
},
|
|
403
401
|
when: ( (OpenEditorsGroupContext.toNegated()))
|
|
404
402
|
});
|
|
@@ -407,7 +405,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
407
405
|
order: 20,
|
|
408
406
|
command: {
|
|
409
407
|
id: CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID,
|
|
410
|
-
title: (
|
|
408
|
+
title: ( localize(2161, "Close Others"))
|
|
411
409
|
},
|
|
412
410
|
when: ( (OpenEditorsGroupContext.toNegated()))
|
|
413
411
|
});
|
|
@@ -416,7 +414,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
416
414
|
order: 30,
|
|
417
415
|
command: {
|
|
418
416
|
id: CLOSE_SAVED_EDITORS_COMMAND_ID,
|
|
419
|
-
title: (
|
|
417
|
+
title: ( localize(2162, "Close Saved"))
|
|
420
418
|
}
|
|
421
419
|
});
|
|
422
420
|
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
@@ -424,7 +422,7 @@ MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
|
|
|
424
422
|
order: 40,
|
|
425
423
|
command: {
|
|
426
424
|
id: CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
|
|
427
|
-
title: (
|
|
425
|
+
title: ( localize(2163, "Close All"))
|
|
428
426
|
}
|
|
429
427
|
});
|
|
430
428
|
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
@@ -461,7 +459,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
461
459
|
order: 20,
|
|
462
460
|
command: {
|
|
463
461
|
id: OPEN_WITH_EXPLORER_COMMAND_ID,
|
|
464
|
-
title: (
|
|
462
|
+
title: ( localize(2164, "Open With...")),
|
|
465
463
|
},
|
|
466
464
|
when: ( (ContextKeyExpr.and(
|
|
467
465
|
(ExplorerFolderContext.toNegated()),
|
|
@@ -504,7 +502,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
504
502
|
order: 8,
|
|
505
503
|
command: {
|
|
506
504
|
id: CUT_FILE_ID,
|
|
507
|
-
title: (
|
|
505
|
+
title: ( localize(2165, "Cut"))
|
|
508
506
|
},
|
|
509
507
|
when: ( (ContextKeyExpr.and(
|
|
510
508
|
(ExplorerRootContext.toNegated()),
|
|
@@ -624,7 +622,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
624
622
|
},
|
|
625
623
|
alt: {
|
|
626
624
|
id: DELETE_FILE_ID,
|
|
627
|
-
title: (
|
|
625
|
+
title: ( localize(2166, "Delete Permanently")),
|
|
628
626
|
precondition: ExplorerResourceNotReadonlyContext
|
|
629
627
|
},
|
|
630
628
|
when: ( (ContextKeyExpr.and(
|
|
@@ -637,7 +635,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
637
635
|
order: 20,
|
|
638
636
|
command: {
|
|
639
637
|
id: DELETE_FILE_ID,
|
|
640
|
-
title: (
|
|
638
|
+
title: ( localize(2166, "Delete Permanently")),
|
|
641
639
|
precondition: ExplorerResourceNotReadonlyContext
|
|
642
640
|
},
|
|
643
641
|
when: ( (ContextKeyExpr.and(
|
|
@@ -646,14 +644,14 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
|
646
644
|
)))
|
|
647
645
|
});
|
|
648
646
|
for (const menuId of [MenuId.EmptyEditorGroupContext, MenuId.EditorTabsBarContext]) {
|
|
649
|
-
MenuRegistry.appendMenuItem(menuId, { command: { id: NEW_UNTITLED_FILE_COMMAND_ID, title: (
|
|
650
|
-
MenuRegistry.appendMenuItem(menuId, { command: { id: 'workbench.action.quickOpen', title: (
|
|
647
|
+
MenuRegistry.appendMenuItem(menuId, { command: { id: NEW_UNTITLED_FILE_COMMAND_ID, title: ( localize(2167, "New Text File")) }, group: '1_file', order: 10 });
|
|
648
|
+
MenuRegistry.appendMenuItem(menuId, { command: { id: 'workbench.action.quickOpen', title: ( localize(2168, "Open File...")) }, group: '1_file', order: 20 });
|
|
651
649
|
}
|
|
652
650
|
MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
653
651
|
group: '1_new',
|
|
654
652
|
command: {
|
|
655
653
|
id: NEW_UNTITLED_FILE_COMMAND_ID,
|
|
656
|
-
title: (
|
|
654
|
+
title: ( localize(2169, "&&New Text File"))
|
|
657
655
|
},
|
|
658
656
|
order: 1
|
|
659
657
|
});
|
|
@@ -661,7 +659,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
661
659
|
group: '4_save',
|
|
662
660
|
command: {
|
|
663
661
|
id: SAVE_FILE_COMMAND_ID,
|
|
664
|
-
title: (
|
|
662
|
+
title: ( localize(2170, "&&Save")),
|
|
665
663
|
precondition: ( (ContextKeyExpr.or(
|
|
666
664
|
ActiveEditorContext,
|
|
667
665
|
(ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))
|
|
@@ -673,7 +671,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
673
671
|
group: '4_save',
|
|
674
672
|
command: {
|
|
675
673
|
id: SAVE_FILE_AS_COMMAND_ID,
|
|
676
|
-
title: (
|
|
674
|
+
title: ( localize(2171, "Save &&As...")),
|
|
677
675
|
precondition: ( (ContextKeyExpr.or(
|
|
678
676
|
ActiveEditorContext,
|
|
679
677
|
(ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))
|
|
@@ -685,7 +683,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
685
683
|
group: '4_save',
|
|
686
684
|
command: {
|
|
687
685
|
id: SAVE_ALL_COMMAND_ID,
|
|
688
|
-
title: (
|
|
686
|
+
title: ( localize(2172, "Save A&&ll")),
|
|
689
687
|
precondition: DirtyWorkingCopiesContext
|
|
690
688
|
},
|
|
691
689
|
order: 3
|
|
@@ -694,7 +692,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
694
692
|
group: '5_autosave',
|
|
695
693
|
command: {
|
|
696
694
|
id: ToggleAutoSaveAction.ID,
|
|
697
|
-
title: (
|
|
695
|
+
title: ( localize(2173, "A&&uto Save")),
|
|
698
696
|
toggled: ( (ContextKeyExpr.notEquals('config.files.autoSave', 'off')))
|
|
699
697
|
},
|
|
700
698
|
order: 1
|
|
@@ -703,7 +701,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
703
701
|
group: '6_close',
|
|
704
702
|
command: {
|
|
705
703
|
id: REVERT_FILE_COMMAND_ID,
|
|
706
|
-
title: (
|
|
704
|
+
title: ( localize(2174, "Re&&vert File")),
|
|
707
705
|
precondition: ( (ContextKeyExpr.or(
|
|
708
706
|
(ContextKeyExpr.and(ActiveEditorCanRevertContext)),
|
|
709
707
|
(ContextKeyExpr.and(
|
|
@@ -718,7 +716,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
|
|
|
718
716
|
group: '6_close',
|
|
719
717
|
command: {
|
|
720
718
|
id: CLOSE_EDITOR_COMMAND_ID,
|
|
721
|
-
title: (
|
|
719
|
+
title: ( localize(2175, "&&Close Editor")),
|
|
722
720
|
precondition: ( (ContextKeyExpr.or(
|
|
723
721
|
ActiveEditorContext,
|
|
724
722
|
(ContextKeyExpr.and(FoldersViewVisibleContext, SidebarFocusContext))
|
|
@@ -730,7 +728,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarGoMenu, {
|
|
|
730
728
|
group: '3_global_nav',
|
|
731
729
|
command: {
|
|
732
730
|
id: 'workbench.action.quickOpen',
|
|
733
|
-
title: (
|
|
731
|
+
title: ( localize(2176, "Go to &&File..."))
|
|
734
732
|
},
|
|
735
733
|
order: 1
|
|
736
734
|
});
|
|
@@ -1,49 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
1
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
2
|
+
import { EditorResourceAccessor, SideBySideEditor } from 'vscode/vscode/vs/workbench/common/editor';
|
|
3
|
+
import { isWorkspaceToOpen } from 'vscode/vscode/vs/platform/window/common/window';
|
|
4
|
+
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
|
|
5
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
|
+
import { UNTITLED_WORKSPACE_NAME } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
7
|
+
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
8
|
+
import { ExplorerFocusCondition, FilesExplorerFocusCondition, ExplorerFolderContext, TextFileContentProvider, VIEW_ID, ExplorerCompressedFocusContext, ExplorerCompressedFirstFocusContext, VIEWLET_ID, ExplorerCompressedLastFocusContext } from 'vscode/vscode/vs/workbench/contrib/files/common/files';
|
|
10
9
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService.service';
|
|
11
10
|
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
12
11
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
13
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
14
12
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
15
13
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
16
|
-
import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
17
|
-
import { EditorResolution, EditorOpenSource } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
18
|
-
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
|
|
19
14
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
20
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
21
15
|
import { KeybindingsRegistry, KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { isWorkspaceToOpen } from 'vscode/vscode/vs/platform/window/common/window';
|
|
27
|
-
import { UNTITLED_WORKSPACE_NAME } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
28
|
-
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
29
|
-
import { RemoveRootFolderAction } from 'vscode/vscode/vs/workbench/browser/actions/workspaceActions';
|
|
30
|
-
import { EditorResourceAccessor, SideBySideEditor, EditorInputCapabilities } from 'vscode/vscode/vs/workbench/common/editor';
|
|
31
|
-
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
32
|
-
import { getMultiSelectedResources, getResourceForCommand, getOpenEditorsViewMultiSelection } from 'vscode/vscode/vs/workbench/contrib/files/browser/files';
|
|
16
|
+
import { KeyMod, KeyCode, KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
17
|
+
import { isWindows, isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
18
|
+
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
19
|
+
import { getMultiSelectedResources, getResourceForCommand } from 'vscode/vscode/vs/workbench/contrib/files/browser/files';
|
|
33
20
|
import { IExplorerService } from 'vscode/vscode/vs/workbench/contrib/files/browser/files.service';
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
21
|
+
import { IWorkspaceEditingService } from 'vscode/vscode/vs/workbench/services/workspaces/common/workspaceEditing.service';
|
|
22
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
23
|
+
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
37
24
|
import { SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
38
25
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
39
|
-
import {
|
|
26
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
27
|
+
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
28
|
+
import { joinPath, basename } from 'vscode/vscode/vs/base/common/resources';
|
|
29
|
+
import { dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
30
|
+
import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
|
|
31
|
+
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
32
|
+
import { EditorResolution, EditorOpenSource } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
33
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
40
34
|
import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
|
|
35
|
+
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
41
36
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
37
|
+
import { OPEN_TO_SIDE_COMMAND_ID, COMPARE_WITH_SAVED_COMMAND_ID, SELECT_FOR_COMPARE_COMMAND_ID, ResourceSelectedForCompareContext, COMPARE_SELECTED_COMMAND_ID, COMPARE_RESOURCE_COMMAND_ID, COPY_PATH_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, OPEN_WITH_EXPLORER_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, PREVIOUS_COMPRESSED_FOLDER, NEXT_COMPRESSED_FOLDER, FIRST_COMPRESSED_FOLDER, LAST_COMPRESSED_FOLDER, NEW_UNTITLED_FILE_COMMAND_ID, NEW_UNTITLED_FILE_LABEL, NEW_FILE_COMMAND_ID } from 'vscode/vscode/vs/workbench/contrib/files/browser/fileConstants';
|
|
38
|
+
import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
39
|
+
import { RemoveRootFolderAction } from 'vscode/vscode/vs/workbench/browser/actions/workspaceActions';
|
|
40
|
+
import { OpenEditorsView } from 'vscode/vscode/vs/workbench/contrib/files/browser/views/openEditorsView';
|
|
41
|
+
import { IListService } from 'vscode/vscode/vs/platform/list/browser/listService.service';
|
|
44
42
|
import 'vscode/vscode/vs/workbench/contrib/files/browser/fileCommands._save';
|
|
45
43
|
|
|
46
|
-
const _moduleId = "vs/workbench/contrib/files/browser/fileCommands";
|
|
47
44
|
const openWindowCommand = (accessor, toOpen, options) => {
|
|
48
45
|
if (Array.isArray(toOpen)) {
|
|
49
46
|
const hostService = accessor.get(IHostService);
|
|
@@ -72,11 +69,9 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
72
69
|
},
|
|
73
70
|
id: OPEN_TO_SIDE_COMMAND_ID, handler: async (accessor, resource) => {
|
|
74
71
|
const editorService = accessor.get(IEditorService);
|
|
75
|
-
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
76
|
-
const listService = accessor.get(IListService);
|
|
77
72
|
const fileService = accessor.get(IFileService);
|
|
78
73
|
const explorerService = accessor.get(IExplorerService);
|
|
79
|
-
const resources = getMultiSelectedResources(resource,
|
|
74
|
+
const resources = getMultiSelectedResources(resource, accessor.get(IListService), editorService, accessor.get(IEditorGroupsService), explorerService);
|
|
80
75
|
if (resources.length) {
|
|
81
76
|
const untitledResources = resources.filter(resource => resource.scheme === Schemas.untitled);
|
|
82
77
|
const fileResources = resources.filter(resource => resource.scheme !== Schemas.untitled);
|
|
@@ -131,6 +126,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
131
126
|
const textModelService = accessor.get(ITextModelService);
|
|
132
127
|
const editorService = accessor.get(IEditorService);
|
|
133
128
|
const fileService = accessor.get(IFileService);
|
|
129
|
+
const listService = accessor.get(IListService);
|
|
134
130
|
let registerEditorListener = false;
|
|
135
131
|
if (providerDisposables.length === 0) {
|
|
136
132
|
registerEditorListener = true;
|
|
@@ -138,10 +134,10 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
|
138
134
|
providerDisposables.push(provider);
|
|
139
135
|
providerDisposables.push(textModelService.registerTextModelContentProvider(COMPARE_WITH_SAVED_SCHEMA, provider));
|
|
140
136
|
}
|
|
141
|
-
const uri = getResourceForCommand(resource,
|
|
137
|
+
const uri = getResourceForCommand(resource, editorService, listService);
|
|
142
138
|
if (uri && fileService.hasProvider(uri)) {
|
|
143
139
|
const name = basename(uri);
|
|
144
|
-
const editorLabel = (
|
|
140
|
+
const editorLabel = ( localize(2138, "{0} (in file) ↔ {1}", name, name));
|
|
145
141
|
try {
|
|
146
142
|
await TextFileContentProvider.open(uri, COMPARE_WITH_SAVED_SCHEMA, editorLabel, editorService, { pinned: true });
|
|
147
143
|
if (registerEditorListener) {
|
|
@@ -165,8 +161,7 @@ let resourceSelectedForCompareContext;
|
|
|
165
161
|
CommandsRegistry.registerCommand({
|
|
166
162
|
id: SELECT_FOR_COMPARE_COMMAND_ID,
|
|
167
163
|
handler: (accessor, resource) => {
|
|
168
|
-
|
|
169
|
-
globalResourceToCompare = getResourceForCommand(resource, listService, accessor.get(IEditorService));
|
|
164
|
+
globalResourceToCompare = getResourceForCommand(resource, accessor.get(IEditorService), accessor.get(IListService));
|
|
170
165
|
if (!resourceSelectedForCompareContext) {
|
|
171
166
|
resourceSelectedForCompareContext = ResourceSelectedForCompareContext.bindTo(accessor.get(IContextKeyService));
|
|
172
167
|
}
|
|
@@ -177,13 +172,11 @@ CommandsRegistry.registerCommand({
|
|
|
177
172
|
id: COMPARE_SELECTED_COMMAND_ID,
|
|
178
173
|
handler: async (accessor, resource) => {
|
|
179
174
|
const editorService = accessor.get(IEditorService);
|
|
180
|
-
const
|
|
181
|
-
const explorerService = accessor.get(IExplorerService);
|
|
182
|
-
const resources = getMultiSelectedResources(resource, accessor.get(IListService), editorService, editorGroupService, explorerService);
|
|
175
|
+
const resources = getMultiSelectedResources(resource, accessor.get(IListService), editorService, accessor.get(IEditorGroupsService), accessor.get(IExplorerService));
|
|
183
176
|
if (resources.length === 2) {
|
|
184
177
|
return editorService.openEditor({
|
|
185
|
-
original: { resource: resources[
|
|
186
|
-
modified: { resource: resources[
|
|
178
|
+
original: { resource: resources[1] },
|
|
179
|
+
modified: { resource: resources[0] },
|
|
187
180
|
options: { pinned: true }
|
|
188
181
|
});
|
|
189
182
|
}
|
|
@@ -194,8 +187,7 @@ CommandsRegistry.registerCommand({
|
|
|
194
187
|
id: COMPARE_RESOURCE_COMMAND_ID,
|
|
195
188
|
handler: (accessor, resource) => {
|
|
196
189
|
const editorService = accessor.get(IEditorService);
|
|
197
|
-
const
|
|
198
|
-
const rightResource = getResourceForCommand(resource, listService, editorService);
|
|
190
|
+
const rightResource = getResourceForCommand(resource, editorService, accessor.get(IListService));
|
|
199
191
|
if (globalResourceToCompare && rightResource) {
|
|
200
192
|
editorService.openEditor({
|
|
201
193
|
original: { resource: globalResourceToCompare },
|
|
@@ -288,7 +280,9 @@ CommandsRegistry.registerCommand({
|
|
|
288
280
|
const viewService = accessor.get(IViewsService);
|
|
289
281
|
const contextService = accessor.get(IWorkspaceContextService);
|
|
290
282
|
const explorerService = accessor.get(IExplorerService);
|
|
291
|
-
const
|
|
283
|
+
const editorService = accessor.get(IEditorService);
|
|
284
|
+
const listService = accessor.get(IListService);
|
|
285
|
+
const uri = getResourceForCommand(resource, editorService, listService);
|
|
292
286
|
if (uri && contextService.isInsideWorkspace(uri)) {
|
|
293
287
|
const explorerView = await viewService.openView(VIEW_ID, false);
|
|
294
288
|
if (explorerView) {
|
|
@@ -313,48 +307,17 @@ CommandsRegistry.registerCommand({
|
|
|
313
307
|
id: OPEN_WITH_EXPLORER_COMMAND_ID,
|
|
314
308
|
handler: async (accessor, resource) => {
|
|
315
309
|
const editorService = accessor.get(IEditorService);
|
|
316
|
-
const
|
|
310
|
+
const listService = accessor.get(IListService);
|
|
311
|
+
const uri = getResourceForCommand(resource, editorService, listService);
|
|
317
312
|
if (uri) {
|
|
318
313
|
return editorService.openEditor({ resource: uri, options: { override: EditorResolution.PICK, source: EditorOpenSource.USER } });
|
|
319
314
|
}
|
|
320
315
|
return undefined;
|
|
321
316
|
}
|
|
322
317
|
});
|
|
323
|
-
CommandsRegistry.registerCommand({
|
|
324
|
-
id: REVERT_FILE_COMMAND_ID,
|
|
325
|
-
handler: async (accessor) => {
|
|
326
|
-
const notificationService = accessor.get(INotificationService);
|
|
327
|
-
const listService = accessor.get(IListService);
|
|
328
|
-
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
329
|
-
const editorService = accessor.get(IEditorService);
|
|
330
|
-
let editors = getOpenEditorsViewMultiSelection(listService);
|
|
331
|
-
if (!editors) {
|
|
332
|
-
const activeGroup = editorGroupService.activeGroup;
|
|
333
|
-
if (activeGroup.activeEditor) {
|
|
334
|
-
editors = [{ groupId: activeGroup.id, editor: activeGroup.activeEditor }];
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
if (!editors || editors.length === 0) {
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
try {
|
|
341
|
-
await editorService.revert(editors.filter(({ editor }) => !editor.hasCapability(EditorInputCapabilities.Untitled) ), { force: true });
|
|
342
|
-
}
|
|
343
|
-
catch (error) {
|
|
344
|
-
notificationService.error(( localizeWithPath(
|
|
345
|
-
_moduleId,
|
|
346
|
-
1,
|
|
347
|
-
"Failed to revert '{0}': {1}",
|
|
348
|
-
( (editors.map(({ editor }) => editor.getName()))).join(', '),
|
|
349
|
-
toErrorMessage(error, false)
|
|
350
|
-
)));
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
318
|
CommandsRegistry.registerCommand({
|
|
355
319
|
id: REMOVE_ROOT_FOLDER_COMMAND_ID,
|
|
356
320
|
handler: (accessor, resource) => {
|
|
357
|
-
const workspaceEditingService = accessor.get(IWorkspaceEditingService);
|
|
358
321
|
const contextService = accessor.get(IWorkspaceContextService);
|
|
359
322
|
const uriIdentityService = accessor.get(IUriIdentityService);
|
|
360
323
|
const workspace = contextService.getWorkspace();
|
|
@@ -364,6 +327,7 @@ CommandsRegistry.registerCommand({
|
|
|
364
327
|
const commandService = accessor.get(ICommandService);
|
|
365
328
|
return commandService.executeCommand(RemoveRootFolderAction.ID);
|
|
366
329
|
}
|
|
330
|
+
const workspaceEditingService = accessor.get(IWorkspaceEditingService);
|
|
367
331
|
return workspaceEditingService.removeFolders(resources);
|
|
368
332
|
}
|
|
369
333
|
});
|
|
@@ -492,7 +456,7 @@ CommandsRegistry.registerCommand({
|
|
|
492
456
|
const editorService = accessor.get(IEditorService);
|
|
493
457
|
const dialogService = accessor.get(IFileDialogService);
|
|
494
458
|
const fileService = accessor.get(IFileService);
|
|
495
|
-
const createFileLocalized = (
|
|
459
|
+
const createFileLocalized = ( localize(2139, "Create File"));
|
|
496
460
|
const defaultFileUri = joinPath(await dialogService.defaultFilePath(), args?.fileName ?? 'Untitled.txt');
|
|
497
461
|
const saveUri = await dialogService.showSaveDialog({ saveLabel: createFileLocalized, title: createFileLocalized, defaultUri: defaultFileUri });
|
|
498
462
|
if (!saveUri) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UndoCommand, RedoCommand } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
2
|
-
import {
|
|
2
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
4
4
|
import { Extensions, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
5
5
|
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
@@ -14,20 +14,18 @@ import 'vscode/vscode/vs/workbench/contrib/files/browser/files.contribution._con
|
|
|
14
14
|
import 'vscode/vscode/vs/workbench/contrib/files/browser/files.contribution._editorPane';
|
|
15
15
|
import 'vscode/vscode/vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory';
|
|
16
16
|
|
|
17
|
-
const _moduleId = "vs/workbench/contrib/files/browser/files.contribution";
|
|
18
17
|
registerWorkbenchContribution2(ExplorerViewletViewsContribution.ID, ExplorerViewletViewsContribution, WorkbenchPhase.BlockStartup);
|
|
19
18
|
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
20
19
|
configurationRegistry.registerConfiguration({
|
|
21
20
|
'id': 'explorer',
|
|
22
21
|
'order': 10,
|
|
23
|
-
'title': (
|
|
22
|
+
'title': ( localize(2177, "File Explorer")),
|
|
24
23
|
'type': 'object',
|
|
25
24
|
'properties': {
|
|
26
25
|
'explorer.openEditors.visible': {
|
|
27
26
|
'type': 'number',
|
|
28
|
-
'description': (
|
|
29
|
-
|
|
30
|
-
52,
|
|
27
|
+
'description': ( localize(
|
|
28
|
+
2178,
|
|
31
29
|
"The initial maximum number of editors shown in the Open Editors pane. Exceeding this limit will show a scroll bar and allow resizing the pane to display more items."
|
|
32
30
|
)),
|
|
33
31
|
'default': 9,
|
|
@@ -35,9 +33,8 @@ configurationRegistry.registerConfiguration({
|
|
|
35
33
|
},
|
|
36
34
|
'explorer.openEditors.minVisible': {
|
|
37
35
|
'type': 'number',
|
|
38
|
-
'description': (
|
|
39
|
-
|
|
40
|
-
53,
|
|
36
|
+
'description': ( localize(
|
|
37
|
+
2179,
|
|
41
38
|
"The minimum number of editor slots pre-allocated in the Open Editors pane. If set to 0 the Open Editors pane will dynamically resize based on the number of editors."
|
|
42
39
|
)),
|
|
43
40
|
'default': 0,
|
|
@@ -46,25 +43,15 @@ configurationRegistry.registerConfiguration({
|
|
|
46
43
|
'explorer.openEditors.sortOrder': {
|
|
47
44
|
'type': 'string',
|
|
48
45
|
'enum': ['editorOrder', 'alphabetical', 'fullPath'],
|
|
49
|
-
'description': (
|
|
50
|
-
_moduleId,
|
|
51
|
-
54,
|
|
52
|
-
"Controls the sorting order of editors in the Open Editors pane."
|
|
53
|
-
)),
|
|
46
|
+
'description': ( localize(2180, "Controls the sorting order of editors in the Open Editors pane.")),
|
|
54
47
|
'enumDescriptions': [
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
'Editors are ordered in the same order editor tabs are shown.'
|
|
59
|
-
)),
|
|
60
|
-
( localizeWithPath(
|
|
61
|
-
_moduleId,
|
|
62
|
-
56,
|
|
48
|
+
( localize(2181, 'Editors are ordered in the same order editor tabs are shown.')),
|
|
49
|
+
( localize(
|
|
50
|
+
2182,
|
|
63
51
|
'Editors are ordered alphabetically by tab name inside each editor group.'
|
|
64
52
|
)),
|
|
65
|
-
(
|
|
66
|
-
|
|
67
|
-
57,
|
|
53
|
+
( localize(
|
|
54
|
+
2183,
|
|
68
55
|
'Editors are ordered alphabetically by full path inside each editor group.'
|
|
69
56
|
))
|
|
70
57
|
],
|
|
@@ -75,25 +62,19 @@ configurationRegistry.registerConfiguration({
|
|
|
75
62
|
'enum': [true, false, 'focusNoScroll'],
|
|
76
63
|
'default': true,
|
|
77
64
|
'enumDescriptions': [
|
|
78
|
-
(
|
|
79
|
-
(
|
|
80
|
-
(
|
|
81
|
-
_moduleId,
|
|
82
|
-
60,
|
|
83
|
-
'Files will not be scrolled into view, but will still be focused.'
|
|
84
|
-
)),
|
|
65
|
+
( localize(2184, 'Files will be revealed and selected.')),
|
|
66
|
+
( localize(2185, 'Files will not be revealed and selected.')),
|
|
67
|
+
( localize(2186, 'Files will not be scrolled into view, but will still be focused.')),
|
|
85
68
|
],
|
|
86
|
-
'description': (
|
|
87
|
-
|
|
88
|
-
61,
|
|
69
|
+
'description': ( localize(
|
|
70
|
+
2187,
|
|
89
71
|
"Controls whether the Explorer should automatically reveal and select files when opening them."
|
|
90
72
|
))
|
|
91
73
|
},
|
|
92
74
|
'explorer.autoRevealExclude': {
|
|
93
75
|
'type': 'object',
|
|
94
|
-
'markdownDescription': (
|
|
95
|
-
|
|
96
|
-
62,
|
|
76
|
+
'markdownDescription': ( localize(
|
|
77
|
+
2188,
|
|
97
78
|
"Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders from being revealed and selected in the Explorer when they are opened. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths."
|
|
98
79
|
)),
|
|
99
80
|
'default': { '**/node_modules': true, '**/bower_components': true },
|
|
@@ -101,9 +82,8 @@ configurationRegistry.registerConfiguration({
|
|
|
101
82
|
'anyOf': [
|
|
102
83
|
{
|
|
103
84
|
'type': 'boolean',
|
|
104
|
-
'description': (
|
|
105
|
-
|
|
106
|
-
63,
|
|
85
|
+
'description': ( localize(
|
|
86
|
+
2189,
|
|
107
87
|
"The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."
|
|
108
88
|
)),
|
|
109
89
|
},
|
|
@@ -114,9 +94,8 @@ configurationRegistry.registerConfiguration({
|
|
|
114
94
|
type: 'string',
|
|
115
95
|
pattern: '\\w*\\$\\(basename\\)\\w*',
|
|
116
96
|
default: '$(basename).ext',
|
|
117
|
-
description: (
|
|
118
|
-
|
|
119
|
-
64,
|
|
97
|
+
description: ( localize(
|
|
98
|
+
2190,
|
|
120
99
|
'Additional check on the siblings of a matching file. Use $(basename) as variable for the matching file name.'
|
|
121
100
|
))
|
|
122
101
|
}
|
|
@@ -127,45 +106,40 @@ configurationRegistry.registerConfiguration({
|
|
|
127
106
|
},
|
|
128
107
|
'explorer.enableDragAndDrop': {
|
|
129
108
|
'type': 'boolean',
|
|
130
|
-
'description': (
|
|
131
|
-
|
|
132
|
-
65,
|
|
109
|
+
'description': ( localize(
|
|
110
|
+
2191,
|
|
133
111
|
"Controls whether the Explorer should allow to move files and folders via drag and drop. This setting only effects drag and drop from inside the Explorer."
|
|
134
112
|
)),
|
|
135
113
|
'default': true
|
|
136
114
|
},
|
|
137
115
|
'explorer.confirmDragAndDrop': {
|
|
138
116
|
'type': 'boolean',
|
|
139
|
-
'description': (
|
|
140
|
-
|
|
141
|
-
66,
|
|
117
|
+
'description': ( localize(
|
|
118
|
+
2192,
|
|
142
119
|
"Controls whether the Explorer should ask for confirmation to move files and folders via drag and drop."
|
|
143
120
|
)),
|
|
144
121
|
'default': true
|
|
145
122
|
},
|
|
146
123
|
'explorer.confirmPasteNative': {
|
|
147
124
|
'type': 'boolean',
|
|
148
|
-
'description': (
|
|
149
|
-
|
|
150
|
-
67,
|
|
125
|
+
'description': ( localize(
|
|
126
|
+
2193,
|
|
151
127
|
"Controls whether the Explorer should ask for confirmation when pasting native files and folders."
|
|
152
128
|
)),
|
|
153
129
|
'default': true
|
|
154
130
|
},
|
|
155
131
|
'explorer.confirmDelete': {
|
|
156
132
|
'type': 'boolean',
|
|
157
|
-
'description': (
|
|
158
|
-
|
|
159
|
-
68,
|
|
133
|
+
'description': ( localize(
|
|
134
|
+
2194,
|
|
160
135
|
"Controls whether the Explorer should ask for confirmation when deleting a file via the trash."
|
|
161
136
|
)),
|
|
162
137
|
'default': true
|
|
163
138
|
},
|
|
164
139
|
'explorer.enableUndo': {
|
|
165
140
|
'type': 'boolean',
|
|
166
|
-
'description': (
|
|
167
|
-
|
|
168
|
-
69,
|
|
141
|
+
'description': ( localize(
|
|
142
|
+
2195,
|
|
169
143
|
"Controls whether the Explorer should support undoing file and folder operations."
|
|
170
144
|
)),
|
|
171
145
|
'default': true
|
|
@@ -173,27 +147,21 @@ configurationRegistry.registerConfiguration({
|
|
|
173
147
|
'explorer.confirmUndo': {
|
|
174
148
|
'type': 'string',
|
|
175
149
|
'enum': [UndoConfirmLevel.Verbose, UndoConfirmLevel.Default, UndoConfirmLevel.Light],
|
|
176
|
-
'description': (
|
|
177
|
-
|
|
178
|
-
70,
|
|
150
|
+
'description': ( localize(
|
|
151
|
+
2196,
|
|
179
152
|
"Controls whether the Explorer should ask for confirmation when undoing."
|
|
180
153
|
)),
|
|
181
154
|
'default': UndoConfirmLevel.Default,
|
|
182
155
|
'enumDescriptions': [
|
|
183
|
-
(
|
|
184
|
-
(
|
|
185
|
-
(
|
|
186
|
-
_moduleId,
|
|
187
|
-
73,
|
|
188
|
-
'Explorer will not prompt before undo operations when focused.'
|
|
189
|
-
)),
|
|
156
|
+
( localize(2197, 'Explorer will prompt before all undo operations.')),
|
|
157
|
+
( localize(2198, 'Explorer will prompt before destructive undo operations.')),
|
|
158
|
+
( localize(2199, 'Explorer will not prompt before undo operations when focused.')),
|
|
190
159
|
],
|
|
191
160
|
},
|
|
192
161
|
'explorer.expandSingleFolderWorkspaces': {
|
|
193
162
|
'type': 'boolean',
|
|
194
|
-
'description': (
|
|
195
|
-
|
|
196
|
-
74,
|
|
163
|
+
'description': ( localize(
|
|
164
|
+
2200,
|
|
197
165
|
"Controls whether the Explorer should expand multi-root workspaces containing only one folder during initialization"
|
|
198
166
|
)),
|
|
199
167
|
'default': true
|
|
@@ -203,40 +171,33 @@ configurationRegistry.registerConfiguration({
|
|
|
203
171
|
'enum': [SortOrder.Default, SortOrder.Mixed, SortOrder.FilesFirst, SortOrder.Type, SortOrder.Modified, SortOrder.FoldersNestsFiles],
|
|
204
172
|
'default': SortOrder.Default,
|
|
205
173
|
'enumDescriptions': [
|
|
206
|
-
(
|
|
207
|
-
|
|
208
|
-
75,
|
|
174
|
+
( localize(
|
|
175
|
+
2201,
|
|
209
176
|
'Files and folders are sorted by their names. Folders are displayed before files.'
|
|
210
177
|
)),
|
|
211
|
-
(
|
|
212
|
-
|
|
213
|
-
76,
|
|
178
|
+
( localize(
|
|
179
|
+
2202,
|
|
214
180
|
'Files and folders are sorted by their names. Files are interwoven with folders.'
|
|
215
181
|
)),
|
|
216
|
-
(
|
|
217
|
-
|
|
218
|
-
77,
|
|
182
|
+
( localize(
|
|
183
|
+
2203,
|
|
219
184
|
'Files and folders are sorted by their names. Files are displayed before folders.'
|
|
220
185
|
)),
|
|
221
|
-
(
|
|
222
|
-
|
|
223
|
-
78,
|
|
186
|
+
( localize(
|
|
187
|
+
2204,
|
|
224
188
|
'Files and folders are grouped by extension type then sorted by their names. Folders are displayed before files.'
|
|
225
189
|
)),
|
|
226
|
-
(
|
|
227
|
-
|
|
228
|
-
79,
|
|
190
|
+
( localize(
|
|
191
|
+
2205,
|
|
229
192
|
'Files and folders are sorted by last modified date in descending order. Folders are displayed before files.'
|
|
230
193
|
)),
|
|
231
|
-
(
|
|
232
|
-
|
|
233
|
-
80,
|
|
194
|
+
( localize(
|
|
195
|
+
2206,
|
|
234
196
|
'Files and folders are sorted by their names. Folders are displayed before files. Files with nested children are displayed before other files.'
|
|
235
197
|
))
|
|
236
198
|
],
|
|
237
|
-
'markdownDescription': (
|
|
238
|
-
|
|
239
|
-
81,
|
|
199
|
+
'markdownDescription': ( localize(
|
|
200
|
+
2207,
|
|
240
201
|
"Controls the property-based sorting of files and folders in the Explorer. When `#explorer.fileNesting.enabled#` is enabled, also controls sorting of nested files."
|
|
241
202
|
))
|
|
242
203
|
},
|
|
@@ -245,67 +206,61 @@ configurationRegistry.registerConfiguration({
|
|
|
245
206
|
'enum': [LexicographicOptions.Default, LexicographicOptions.Upper, LexicographicOptions.Lower, LexicographicOptions.Unicode],
|
|
246
207
|
'default': LexicographicOptions.Default,
|
|
247
208
|
'enumDescriptions': [
|
|
248
|
-
(
|
|
249
|
-
(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
'Uppercase names are grouped together before lowercase names.'
|
|
253
|
-
)),
|
|
254
|
-
( localizeWithPath(
|
|
255
|
-
_moduleId,
|
|
256
|
-
84,
|
|
257
|
-
'Lowercase names are grouped together before uppercase names.'
|
|
258
|
-
)),
|
|
259
|
-
( localizeWithPath(_moduleId, 85, 'Names are sorted in Unicode order.'))
|
|
209
|
+
( localize(2208, 'Uppercase and lowercase names are mixed together.')),
|
|
210
|
+
( localize(2209, 'Uppercase names are grouped together before lowercase names.')),
|
|
211
|
+
( localize(2210, 'Lowercase names are grouped together before uppercase names.')),
|
|
212
|
+
( localize(2211, 'Names are sorted in Unicode order.'))
|
|
260
213
|
],
|
|
261
|
-
'description': (
|
|
262
|
-
|
|
263
|
-
86,
|
|
214
|
+
'description': ( localize(
|
|
215
|
+
2212,
|
|
264
216
|
"Controls the lexicographic sorting of file and folder names in the Explorer."
|
|
265
217
|
))
|
|
266
218
|
},
|
|
267
219
|
'explorer.decorations.colors': {
|
|
268
220
|
type: 'boolean',
|
|
269
|
-
description: (
|
|
221
|
+
description: ( localize(2213, "Controls whether file decorations should use colors.")),
|
|
270
222
|
default: true
|
|
271
223
|
},
|
|
272
224
|
'explorer.decorations.badges': {
|
|
273
225
|
type: 'boolean',
|
|
274
|
-
description: (
|
|
226
|
+
description: ( localize(2214, "Controls whether file decorations should use badges.")),
|
|
275
227
|
default: true
|
|
276
228
|
},
|
|
277
229
|
'explorer.incrementalNaming': {
|
|
278
230
|
'type': 'string',
|
|
279
231
|
enum: ['simple', 'smart', 'disabled'],
|
|
280
232
|
enumDescriptions: [
|
|
281
|
-
(
|
|
282
|
-
|
|
283
|
-
89,
|
|
233
|
+
( localize(
|
|
234
|
+
2215,
|
|
284
235
|
"Appends the word \"copy\" at the end of the duplicated name potentially followed by a number."
|
|
285
236
|
)),
|
|
286
|
-
(
|
|
287
|
-
|
|
288
|
-
90,
|
|
237
|
+
( localize(
|
|
238
|
+
2216,
|
|
289
239
|
"Adds a number at the end of the duplicated name. If some number is already part of the name, tries to increase that number."
|
|
290
240
|
)),
|
|
291
|
-
(
|
|
292
|
-
|
|
293
|
-
91,
|
|
241
|
+
( localize(
|
|
242
|
+
2217,
|
|
294
243
|
"Disables incremental naming. If two files with the same name exist you will be prompted to overwrite the existing file."
|
|
295
244
|
))
|
|
296
245
|
],
|
|
297
|
-
description: (
|
|
298
|
-
|
|
299
|
-
92,
|
|
246
|
+
description: ( localize(
|
|
247
|
+
2218,
|
|
300
248
|
"Controls which naming strategy to use when giving a new name to a duplicated Explorer item on paste."
|
|
301
249
|
)),
|
|
302
250
|
default: 'simple'
|
|
303
251
|
},
|
|
252
|
+
'explorer.autoOpenDroppedFile': {
|
|
253
|
+
'type': 'boolean',
|
|
254
|
+
'description': ( localize(
|
|
255
|
+
2219,
|
|
256
|
+
"Controls whether the Explorer should automatically open a file when it is dropped into the explorer"
|
|
257
|
+
)),
|
|
258
|
+
'default': true
|
|
259
|
+
},
|
|
304
260
|
'explorer.compactFolders': {
|
|
305
261
|
'type': 'boolean',
|
|
306
|
-
'description': (
|
|
307
|
-
|
|
308
|
-
93,
|
|
262
|
+
'description': ( localize(
|
|
263
|
+
2220,
|
|
309
264
|
"Controls whether the Explorer should render folders in a compact form. In such a form, single child folders will be compressed in a combined tree element. Useful for Java package structures, for example."
|
|
310
265
|
)),
|
|
311
266
|
'default': true
|
|
@@ -318,22 +273,20 @@ configurationRegistry.registerConfiguration({
|
|
|
318
273
|
'auto'
|
|
319
274
|
],
|
|
320
275
|
'enumDescriptions': [
|
|
321
|
-
(
|
|
322
|
-
(
|
|
323
|
-
(
|
|
276
|
+
( localize(2221, "Use slash as path separation character.")),
|
|
277
|
+
( localize(2222, "Use backslash as path separation character.")),
|
|
278
|
+
( localize(2223, "Uses operating system specific path separation character.")),
|
|
324
279
|
],
|
|
325
|
-
'description': (
|
|
326
|
-
|
|
327
|
-
97,
|
|
280
|
+
'description': ( localize(
|
|
281
|
+
2224,
|
|
328
282
|
"The path separation character used when copying relative file paths."
|
|
329
283
|
)),
|
|
330
284
|
'default': 'auto'
|
|
331
285
|
},
|
|
332
286
|
'explorer.excludeGitIgnore': {
|
|
333
287
|
type: 'boolean',
|
|
334
|
-
markdownDescription: (
|
|
335
|
-
|
|
336
|
-
98,
|
|
288
|
+
markdownDescription: ( localize(
|
|
289
|
+
2225,
|
|
337
290
|
"Controls whether entries in .gitignore should be parsed and excluded from the Explorer. Similar to {0}.",
|
|
338
291
|
'`#files.exclude#`'
|
|
339
292
|
)),
|
|
@@ -343,18 +296,16 @@ configurationRegistry.registerConfiguration({
|
|
|
343
296
|
'explorer.fileNesting.enabled': {
|
|
344
297
|
'type': 'boolean',
|
|
345
298
|
scope: ConfigurationScope.RESOURCE,
|
|
346
|
-
'markdownDescription': (
|
|
347
|
-
|
|
348
|
-
99,
|
|
299
|
+
'markdownDescription': ( localize(
|
|
300
|
+
2226,
|
|
349
301
|
"Controls whether file nesting is enabled in the Explorer. File nesting allows for related files in a directory to be visually grouped together under a single parent file."
|
|
350
302
|
)),
|
|
351
303
|
'default': false,
|
|
352
304
|
},
|
|
353
305
|
'explorer.fileNesting.expand': {
|
|
354
306
|
'type': 'boolean',
|
|
355
|
-
'markdownDescription': (
|
|
356
|
-
|
|
357
|
-
100,
|
|
307
|
+
'markdownDescription': ( localize(
|
|
308
|
+
2227,
|
|
358
309
|
"Controls whether file nests are automatically expanded. {0} must be set for this to take effect.",
|
|
359
310
|
'`#explorer.fileNesting.enabled#`'
|
|
360
311
|
)),
|
|
@@ -363,17 +314,15 @@ configurationRegistry.registerConfiguration({
|
|
|
363
314
|
'explorer.fileNesting.patterns': {
|
|
364
315
|
'type': 'object',
|
|
365
316
|
scope: ConfigurationScope.RESOURCE,
|
|
366
|
-
'markdownDescription': (
|
|
367
|
-
|
|
368
|
-
101,
|
|
317
|
+
'markdownDescription': ( localize(
|
|
318
|
+
2228,
|
|
369
319
|
"Controls nesting of files in the Explorer. {0} must be set for this to take effect. Each __Item__ represents a parent pattern and may contain a single `*` character that matches any string. Each __Value__ represents a comma separated list of the child patterns that should be shown nested under a given parent. Child patterns may contain several special tokens:\n- `${capture}`: Matches the resolved value of the `*` from the parent pattern\n- `${basename}`: Matches the parent file's basename, the `file` in `file.ts`\n- `${extname}`: Matches the parent file's extension, the `ts` in `file.ts`\n- `${dirname}`: Matches the parent file's directory name, the `src` in `src/file.ts`\n- `*`: Matches any string, may only be used once per child pattern",
|
|
370
320
|
'`#explorer.fileNesting.enabled#`'
|
|
371
321
|
)),
|
|
372
322
|
patternProperties: {
|
|
373
323
|
'^[^*]*\\*?[^*]*$': {
|
|
374
|
-
markdownDescription: (
|
|
375
|
-
|
|
376
|
-
102,
|
|
324
|
+
markdownDescription: ( localize(
|
|
325
|
+
2229,
|
|
377
326
|
"Each key pattern may contain a single `*` character which will match any string."
|
|
378
327
|
)),
|
|
379
328
|
type: 'string',
|