@codingame/monaco-vscode-bulk-edit-service-override 5.2.0 → 6.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/bulkEdit/browser/bulkEditService.js +7 -4
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +4 -2
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.js +13 -11
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.js +13 -7
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.js +14 -7
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.js +14 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-bulk-edit-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
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@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@6.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -5,10 +5,12 @@ import { LinkedList } from 'vscode/vscode/vs/base/common/linkedList';
|
|
|
5
5
|
import { ResourceMap, ResourceSet } from 'vscode/vscode/vs/base/common/map';
|
|
6
6
|
import { isCodeEditor, isDiffEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
7
7
|
import { ResourceTextEdit, ResourceFileEdit } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
|
|
8
|
+
import { EditorOption } from 'vscode/vscode/vs/editor/common/config/editorOptions';
|
|
8
9
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
9
10
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
11
|
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
11
12
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
13
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
12
14
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
15
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
14
16
|
import { Progress } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
@@ -18,6 +20,7 @@ import { ResourceNotebookCellEdit, BulkCellEdits } from 'vscode/vscode/vs/workbe
|
|
|
18
20
|
import { BulkFileEdits } from './bulkFileEdits.js';
|
|
19
21
|
import { BulkTextEdits } from './bulkTextEdits.js';
|
|
20
22
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
23
|
+
import { ShutdownReason } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
21
24
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
22
25
|
import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
|
|
23
26
|
|
|
@@ -192,7 +195,7 @@ let BulkEditService = class BulkEditService {
|
|
|
192
195
|
codeEditor = candidate.getModifiedEditor();
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
|
-
if (codeEditor && codeEditor.getOption(
|
|
198
|
+
if (codeEditor && codeEditor.getOption(EditorOption.readOnly)) {
|
|
196
199
|
codeEditor = undefined;
|
|
197
200
|
}
|
|
198
201
|
let undoRedoGroup;
|
|
@@ -247,15 +250,15 @@ let BulkEditService = class BulkEditService {
|
|
|
247
250
|
let message;
|
|
248
251
|
let primaryButton;
|
|
249
252
|
switch (reason) {
|
|
250
|
-
case
|
|
253
|
+
case ShutdownReason.CLOSE:
|
|
251
254
|
message = ( localizeWithPath(_moduleId, 6, "Are you sure you want to close the window?"));
|
|
252
255
|
primaryButton = ( localizeWithPath(_moduleId, 7, "&&Close Window"));
|
|
253
256
|
break;
|
|
254
|
-
case
|
|
257
|
+
case ShutdownReason.LOAD:
|
|
255
258
|
message = ( localizeWithPath(_moduleId, 8, "Are you sure you want to change the workspace?"));
|
|
256
259
|
primaryButton = ( localizeWithPath(_moduleId, 9, "Change &&Workspace"));
|
|
257
260
|
break;
|
|
258
|
-
case
|
|
261
|
+
case ShutdownReason.RELOAD:
|
|
259
262
|
message = ( localizeWithPath(_moduleId, 10, "Are you sure you want to reload the window?"));
|
|
260
263
|
primaryButton = ( localizeWithPath(_moduleId, 11, "&&Reload Window"));
|
|
261
264
|
break;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { FileSystemProviderCapabilities } from 'vscode/vscode/vs/platform/files/common/files';
|
|
2
3
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
3
4
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
4
5
|
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
|
|
6
|
+
import { UndoRedoElementType } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo';
|
|
5
7
|
import { IUndoRedoService } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo.service';
|
|
6
8
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
9
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
@@ -219,7 +221,7 @@ let DeleteOperation = class DeleteOperation {
|
|
|
219
221
|
deletes.push({
|
|
220
222
|
resource: edit.oldUri,
|
|
221
223
|
recursive: edit.options.recursive,
|
|
222
|
-
useTrash: !edit.options.skipTrashBin && this._fileService.hasCapability(edit.oldUri,
|
|
224
|
+
useTrash: !edit.options.skipTrashBin && this._fileService.hasCapability(edit.oldUri, FileSystemProviderCapabilities.Trash) && this._configurationService.getValue('files.enableTrash')
|
|
223
225
|
});
|
|
224
226
|
let fileContent;
|
|
225
227
|
if (!edit.undoesCreate && !edit.options.folder && !(typeof edit.options.maxSize === 'number' && fileStat.size > edit.options.maxSize)) {
|
|
@@ -260,7 +262,7 @@ class FileUndoRedoElement {
|
|
|
260
262
|
this.code = code;
|
|
261
263
|
this.operations = operations;
|
|
262
264
|
this.confirmBeforeUndo = confirmBeforeUndo;
|
|
263
|
-
this.type =
|
|
265
|
+
this.type = UndoRedoElementType.Workspace;
|
|
264
266
|
this.resources = operations.flatMap(op => op.uris);
|
|
265
267
|
}
|
|
266
268
|
async undo() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
3
|
-
import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
3
|
+
import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
4
4
|
import { IBulkEditService } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
|
|
5
5
|
import { BulkEditPane } from './bulkEditPane.js';
|
|
6
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
|
|
6
|
+
import { ViewContainerLocation, Extensions } from 'vscode/vscode/vs/workbench/common/views';
|
|
7
7
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
8
8
|
import { FocusedViewContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
9
9
|
import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
@@ -11,6 +11,8 @@ import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/view
|
|
|
11
11
|
import { RawContextKey, ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
12
12
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
13
13
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
14
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
15
|
+
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
14
16
|
import { WorkbenchListFocusContextKey } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
15
17
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
16
18
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
@@ -35,15 +37,15 @@ let UXState = class UXState {
|
|
|
35
37
|
constructor(_paneCompositeService, _editorGroupsService) {
|
|
36
38
|
this._paneCompositeService = _paneCompositeService;
|
|
37
39
|
this._editorGroupsService = _editorGroupsService;
|
|
38
|
-
this._activePanel = _paneCompositeService.getActivePaneComposite(
|
|
40
|
+
this._activePanel = _paneCompositeService.getActivePaneComposite(ViewContainerLocation.Panel)?.getId();
|
|
39
41
|
}
|
|
40
42
|
async restore(panels, editors) {
|
|
41
43
|
if (panels) {
|
|
42
44
|
if (typeof this._activePanel === 'string') {
|
|
43
|
-
await this._paneCompositeService.openPaneComposite(this._activePanel,
|
|
45
|
+
await this._paneCompositeService.openPaneComposite(this._activePanel, ViewContainerLocation.Panel);
|
|
44
46
|
}
|
|
45
47
|
else {
|
|
46
|
-
this._paneCompositeService.hideActivePaneComposite(
|
|
48
|
+
this._paneCompositeService.hideActivePaneComposite(ViewContainerLocation.Panel);
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
if (editors) {
|
|
@@ -151,12 +153,12 @@ registerAction2(class ApplyAction extends Action2 {
|
|
|
151
153
|
order: 1
|
|
152
154
|
}],
|
|
153
155
|
keybinding: {
|
|
154
|
-
weight:
|
|
156
|
+
weight: KeybindingWeight.EditorContrib - 10,
|
|
155
157
|
when: ( (ContextKeyExpr.and(
|
|
156
158
|
BulkEditPreviewContribution.ctxEnabled,
|
|
157
159
|
(FocusedViewContext.isEqualTo(BulkEditPane.ID))
|
|
158
160
|
))),
|
|
159
|
-
primary:
|
|
161
|
+
primary: KeyMod.CtrlCmd + KeyCode.Enter,
|
|
160
162
|
}
|
|
161
163
|
});
|
|
162
164
|
}
|
|
@@ -194,9 +196,9 @@ registerAction2(class ToggleAction extends Action2 {
|
|
|
194
196
|
category: ( localize2WithPath(_moduleId, 4, "Refactor Preview")),
|
|
195
197
|
precondition: BulkEditPreviewContribution.ctxEnabled,
|
|
196
198
|
keybinding: {
|
|
197
|
-
weight:
|
|
199
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
198
200
|
when: WorkbenchListFocusContextKey,
|
|
199
|
-
primary:
|
|
201
|
+
primary: KeyCode.Space,
|
|
200
202
|
},
|
|
201
203
|
menu: {
|
|
202
204
|
id: MenuId.BulkEditContext,
|
|
@@ -286,7 +288,7 @@ registerAction2(class ToggleGrouping extends Action2 {
|
|
|
286
288
|
view?.toggleGrouping();
|
|
287
289
|
}
|
|
288
290
|
});
|
|
289
|
-
registerWorkbenchContribution2(BulkEditPreviewContribution.ID, BulkEditPreviewContribution,
|
|
291
|
+
registerWorkbenchContribution2(BulkEditPreviewContribution.ID, BulkEditPreviewContribution, WorkbenchPhase.BlockRestore);
|
|
290
292
|
const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localizeWithPath(_moduleId, 9, 'View icon of the refactor preview view.')));
|
|
291
293
|
const container = ( (Registry.as(Extensions.ViewContainersRegistry))).registerViewContainer({
|
|
292
294
|
id: BulkEditPane.ID,
|
|
@@ -298,7 +300,7 @@ const container = ( (Registry.as(Extensions.ViewContainersRegistry))).registerVi
|
|
|
298
300
|
))),
|
|
299
301
|
icon: refactorPreviewViewIcon,
|
|
300
302
|
storageId: BulkEditPane.ID
|
|
301
|
-
},
|
|
303
|
+
}, ViewContainerLocation.Panel);
|
|
302
304
|
( (Registry.as(Extensions.ViewsRegistry))).registerViews([{
|
|
303
305
|
id: BulkEditPane.ID,
|
|
304
306
|
name: ( localize2WithPath(_moduleId, 10, "Refactor Preview")),
|
|
@@ -8,7 +8,7 @@ import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
|
8
8
|
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
9
9
|
import { SIDE_GROUP, ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
10
10
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
11
|
-
import { BulkEditPreviewProvider, BulkFileOperations } from './bulkEditPreview.js';
|
|
11
|
+
import { BulkFileOperationType, BulkEditPreviewProvider, BulkFileOperations } from './bulkEditPreview.js';
|
|
12
12
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
13
13
|
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
14
14
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
@@ -21,6 +21,7 @@ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/
|
|
|
21
21
|
import { ResourceLabels } from 'vscode/vscode/vs/workbench/browser/labels';
|
|
22
22
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
23
23
|
import { MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
24
|
+
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
24
25
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
25
26
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
26
27
|
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
|
|
@@ -32,6 +33,11 @@ import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.ser
|
|
|
32
33
|
|
|
33
34
|
var BulkEditPane_1;
|
|
34
35
|
const _moduleId = "vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane";
|
|
36
|
+
var State;
|
|
37
|
+
( ((function(State) {
|
|
38
|
+
State["Data"] = "data";
|
|
39
|
+
State["Message"] = "message";
|
|
40
|
+
})(State || (State = {}))));
|
|
35
41
|
let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
36
42
|
static { BulkEditPane_1 = this; }
|
|
37
43
|
static { this.ID = 'refactorPreview'; }
|
|
@@ -56,7 +62,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
56
62
|
const computeDiffEditorInput = ( (new CachedFunction(async (fileOperation) => {
|
|
57
63
|
const fileOperationUri = fileOperation.uri;
|
|
58
64
|
const previewUri = this._currentProvider.asPreviewUri(fileOperationUri);
|
|
59
|
-
if (fileOperation.type &
|
|
65
|
+
if (fileOperation.type & BulkFileOperationType.Delete) {
|
|
60
66
|
return {
|
|
61
67
|
original: { resource: URI.revive(previewUri) },
|
|
62
68
|
modified: { resource: undefined }
|
|
@@ -112,7 +118,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
112
118
|
const treeContainer = document.createElement('div');
|
|
113
119
|
contentContainer.appendChild(treeContainer);
|
|
114
120
|
this._treeDataSource = this._instaService.createInstance(BulkEditDataSource);
|
|
115
|
-
this._treeDataSource.groupByFile = this._storageService.getBoolean(BulkEditPane_1._memGroupByFile,
|
|
121
|
+
this._treeDataSource.groupByFile = this._storageService.getBoolean(BulkEditPane_1._memGroupByFile, StorageScope.PROFILE, true);
|
|
116
122
|
this._ctxGroupByFile.set(this._treeDataSource.groupByFile);
|
|
117
123
|
this._tree = this._instaService.createInstance(WorkbenchAsyncDataTree, this.id, treeContainer, ( (new BulkEditDelegate())), [this._instaService.createInstance(TextEditElementRenderer), this._instaService.createInstance(FileElementRenderer, resourceLabels), this._instaService.createInstance(CategoryElementRenderer)], this._treeDataSource, {
|
|
118
124
|
accessibilityProvider: this._instaService.createInstance(BulkEditAccessibilityProvider),
|
|
@@ -144,7 +150,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
144
150
|
"Invoke a code action, like rename, to see a preview of its changes here."
|
|
145
151
|
));
|
|
146
152
|
parent.appendChild(this._message);
|
|
147
|
-
this._setState(
|
|
153
|
+
this._setState(State.Message);
|
|
148
154
|
}
|
|
149
155
|
layoutBody(height, width) {
|
|
150
156
|
super.layoutBody(height, width);
|
|
@@ -156,7 +162,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
156
162
|
this.element.dataset['state'] = state;
|
|
157
163
|
}
|
|
158
164
|
async setInput(edit, token) {
|
|
159
|
-
this._setState(
|
|
165
|
+
this._setState(State.Data);
|
|
160
166
|
this._sessionDisposables.clear();
|
|
161
167
|
this._treeViewStates.clear();
|
|
162
168
|
if (this._currentResolve) {
|
|
@@ -237,7 +243,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
237
243
|
_done(accept) {
|
|
238
244
|
this._currentResolve?.(accept ? this._currentInput?.getWorkspaceEdit() : undefined);
|
|
239
245
|
this._currentInput = undefined;
|
|
240
|
-
this._setState(
|
|
246
|
+
this._setState(State.Message);
|
|
241
247
|
this._sessionDisposables.clear();
|
|
242
248
|
}
|
|
243
249
|
toggleChecked() {
|
|
@@ -266,7 +272,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
266
272
|
this._treeViewStates.set(this._treeDataSource.groupByFile, oldViewState);
|
|
267
273
|
this._treeDataSource.groupByFile = !this._treeDataSource.groupByFile;
|
|
268
274
|
this._setTreeInput(input);
|
|
269
|
-
this._storageService.store(BulkEditPane_1._memGroupByFile, this._treeDataSource.groupByFile,
|
|
275
|
+
this._storageService.store(BulkEditPane_1._memGroupByFile, this._treeDataSource.groupByFile, StorageScope.PROFILE, StorageTarget.USER);
|
|
270
276
|
this._ctxGroupByFile.set(this._treeDataSource.groupByFile);
|
|
271
277
|
}
|
|
272
278
|
}
|
|
@@ -67,6 +67,13 @@ class BulkTextEdit {
|
|
|
67
67
|
this.textEdit = textEdit;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
+
var BulkFileOperationType;
|
|
71
|
+
( ((function(BulkFileOperationType) {
|
|
72
|
+
BulkFileOperationType[BulkFileOperationType["TextEdit"] = 1] = "TextEdit";
|
|
73
|
+
BulkFileOperationType[BulkFileOperationType["Create"] = 2] = "Create";
|
|
74
|
+
BulkFileOperationType[BulkFileOperationType["Delete"] = 4] = "Delete";
|
|
75
|
+
BulkFileOperationType[BulkFileOperationType["Rename"] = 8] = "Rename";
|
|
76
|
+
})(BulkFileOperationType || (BulkFileOperationType = {}))));
|
|
70
77
|
class BulkFileOperation {
|
|
71
78
|
constructor(uri, parent) {
|
|
72
79
|
this.uri = uri;
|
|
@@ -81,7 +88,7 @@ class BulkFileOperation {
|
|
|
81
88
|
if (edit instanceof ResourceTextEdit) {
|
|
82
89
|
this.textEdits.push(( (new BulkTextEdit(this, edit))));
|
|
83
90
|
}
|
|
84
|
-
else if (type ===
|
|
91
|
+
else if (type === BulkFileOperationType.Rename) {
|
|
85
92
|
this.newUri = edit.newResource;
|
|
86
93
|
}
|
|
87
94
|
}
|
|
@@ -140,12 +147,12 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
140
147
|
let type;
|
|
141
148
|
this.checked.updateChecked(edit, !edit.metadata?.needsConfirmation);
|
|
142
149
|
if (edit instanceof ResourceTextEdit) {
|
|
143
|
-
type =
|
|
150
|
+
type = BulkFileOperationType.TextEdit;
|
|
144
151
|
uri = edit.resource;
|
|
145
152
|
}
|
|
146
153
|
else if (edit instanceof ResourceFileEdit) {
|
|
147
154
|
if (edit.newResource && edit.oldResource) {
|
|
148
|
-
type =
|
|
155
|
+
type = BulkFileOperationType.Rename;
|
|
149
156
|
uri = edit.oldResource;
|
|
150
157
|
if (edit.options?.overwrite === undefined && edit.options?.ignoreIfExists && (await this._fileService.exists(uri))) {
|
|
151
158
|
continue;
|
|
@@ -153,14 +160,14 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
153
160
|
newToOldUri.set(edit.newResource, uri);
|
|
154
161
|
}
|
|
155
162
|
else if (edit.oldResource) {
|
|
156
|
-
type =
|
|
163
|
+
type = BulkFileOperationType.Delete;
|
|
157
164
|
uri = edit.oldResource;
|
|
158
165
|
if (edit.options?.ignoreIfNotExists && !(await this._fileService.exists(uri))) {
|
|
159
166
|
continue;
|
|
160
167
|
}
|
|
161
168
|
}
|
|
162
169
|
else if (edit.newResource) {
|
|
163
|
-
type =
|
|
170
|
+
type = BulkFileOperationType.Create;
|
|
164
171
|
uri = edit.newResource;
|
|
165
172
|
if (edit.options?.overwrite === undefined && edit.options?.ignoreIfExists && (await this._fileService.exists(uri))) {
|
|
166
173
|
continue;
|
|
@@ -199,7 +206,7 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
199
206
|
operationByResource.forEach(value => this.fileOperations.push(value));
|
|
200
207
|
operationByCategory.forEach(value => this.categories.push(value));
|
|
201
208
|
for (const file of this.fileOperations) {
|
|
202
|
-
if (file.type !==
|
|
209
|
+
if (file.type !== BulkFileOperationType.TextEdit) {
|
|
203
210
|
let checked = true;
|
|
204
211
|
for (const edit of ( (file.originalEdits.values()))) {
|
|
205
212
|
if (edit instanceof ResourceFileEdit) {
|
|
@@ -363,4 +370,4 @@ BulkEditPreviewProvider = BulkEditPreviewProvider_1 = ( (__decorate([
|
|
|
363
370
|
( (__param(3, ITextModelService)))
|
|
364
371
|
], BulkEditPreviewProvider)));
|
|
365
372
|
|
|
366
|
-
export { BulkCategory, BulkEditPreviewProvider, BulkFileOperation, BulkFileOperations, BulkTextEdit, CheckedStates };
|
|
373
|
+
export { BulkCategory, BulkEditPreviewProvider, BulkFileOperation, BulkFileOperationType, BulkFileOperations, BulkTextEdit, CheckedStates };
|
|
@@ -6,7 +6,7 @@ import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
|
6
6
|
import { asCSSUrl, addDisposableListener } from 'vscode/vscode/vs/base/browser/dom';
|
|
7
7
|
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
8
8
|
import { TextModel } from 'vscode/vscode/vs/editor/common/model/textModel';
|
|
9
|
-
import { BulkFileOperations } from './bulkEditPreview.js';
|
|
9
|
+
import { BulkFileOperationType, BulkFileOperations } from './bulkEditPreview.js';
|
|
10
10
|
import { FileKind } from 'vscode/vscode/vs/platform/files/common/files';
|
|
11
11
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
12
12
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
@@ -57,7 +57,7 @@ class FileElement {
|
|
|
57
57
|
isChecked() {
|
|
58
58
|
const model = this.parent instanceof CategoryElement ? this.parent.parent : this.parent;
|
|
59
59
|
let checked = true;
|
|
60
|
-
if (this.edit.type ===
|
|
60
|
+
if (this.edit.type === BulkFileOperationType.TextEdit) {
|
|
61
61
|
checked = !this.edit.textEdits.every(edit => !model.checked.isChecked(edit.textEdit));
|
|
62
62
|
}
|
|
63
63
|
for (const edit of ( (this.edit.originalEdits.values()))) {
|
|
@@ -65,7 +65,7 @@ class FileElement {
|
|
|
65
65
|
checked = checked && model.checked.isChecked(edit);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
if (this.parent instanceof CategoryElement && this.edit.type ===
|
|
68
|
+
if (this.parent instanceof CategoryElement && this.edit.type === BulkFileOperationType.TextEdit) {
|
|
69
69
|
for (const category of model.categories) {
|
|
70
70
|
for (const file of category.fileOperations) {
|
|
71
71
|
if (( (file.uri.toString())) === ( (this.edit.uri.toString()))) {
|
|
@@ -85,7 +85,7 @@ class FileElement {
|
|
|
85
85
|
for (const edit of ( (this.edit.originalEdits.values()))) {
|
|
86
86
|
model.checked.updateChecked(edit, value);
|
|
87
87
|
}
|
|
88
|
-
if (this.parent instanceof CategoryElement && this.edit.type !==
|
|
88
|
+
if (this.parent instanceof CategoryElement && this.edit.type !== BulkFileOperationType.TextEdit) {
|
|
89
89
|
for (const category of model.categories) {
|
|
90
90
|
for (const file of category.fileOperations) {
|
|
91
91
|
if (( (file.uri.toString())) === ( (this.edit.uri.toString()))) {
|
|
@@ -98,7 +98,7 @@ class FileElement {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
isDisabled() {
|
|
101
|
-
if (this.parent instanceof CategoryElement && this.edit.type ===
|
|
101
|
+
if (this.parent instanceof CategoryElement && this.edit.type === BulkFileOperationType.TextEdit) {
|
|
102
102
|
const model = this.parent.parent;
|
|
103
103
|
let checked = true;
|
|
104
104
|
for (const category of model.categories) {
|
|
@@ -263,7 +263,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
263
263
|
getAriaLabel(element) {
|
|
264
264
|
if (element instanceof FileElement) {
|
|
265
265
|
if (element.edit.textEdits.length > 0) {
|
|
266
|
-
if (element.edit.type &
|
|
266
|
+
if (element.edit.type & BulkFileOperationType.Rename && element.edit.newUri) {
|
|
267
267
|
return ( localizeWithPath(
|
|
268
268
|
_moduleId,
|
|
269
269
|
1,
|
|
@@ -272,7 +272,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
272
272
|
this._labelService.getUriLabel(element.edit.newUri, { relative: true })
|
|
273
273
|
));
|
|
274
274
|
}
|
|
275
|
-
else if (element.edit.type &
|
|
275
|
+
else if (element.edit.type & BulkFileOperationType.Create) {
|
|
276
276
|
return ( localizeWithPath(
|
|
277
277
|
_moduleId,
|
|
278
278
|
2,
|
|
@@ -280,7 +280,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
280
280
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
281
281
|
));
|
|
282
282
|
}
|
|
283
|
-
else if (element.edit.type &
|
|
283
|
+
else if (element.edit.type & BulkFileOperationType.Delete) {
|
|
284
284
|
return ( localizeWithPath(
|
|
285
285
|
_moduleId,
|
|
286
286
|
3,
|
|
@@ -298,7 +298,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
else {
|
|
301
|
-
if (element.edit.type &
|
|
301
|
+
if (element.edit.type & BulkFileOperationType.Rename && element.edit.newUri) {
|
|
302
302
|
return ( localizeWithPath(
|
|
303
303
|
_moduleId,
|
|
304
304
|
5,
|
|
@@ -307,7 +307,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
307
307
|
this._labelService.getUriLabel(element.edit.newUri, { relative: true })
|
|
308
308
|
));
|
|
309
309
|
}
|
|
310
|
-
else if (element.edit.type &
|
|
310
|
+
else if (element.edit.type & BulkFileOperationType.Create) {
|
|
311
311
|
return ( localizeWithPath(
|
|
312
312
|
_moduleId,
|
|
313
313
|
6,
|
|
@@ -315,7 +315,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
315
315
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
316
316
|
));
|
|
317
317
|
}
|
|
318
|
-
else if (element.edit.type &
|
|
318
|
+
else if (element.edit.type & BulkFileOperationType.Delete) {
|
|
319
319
|
return ( localizeWithPath(
|
|
320
320
|
_moduleId,
|
|
321
321
|
7,
|
|
@@ -452,7 +452,7 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
452
452
|
this._localDisposables.add(addDisposableListener(this._checkbox, 'change', () => {
|
|
453
453
|
element.setChecked(this._checkbox.checked);
|
|
454
454
|
}));
|
|
455
|
-
if (element.edit.type &
|
|
455
|
+
if (element.edit.type & BulkFileOperationType.Rename && element.edit.newUri) {
|
|
456
456
|
this._label.setResource({
|
|
457
457
|
resource: element.edit.uri,
|
|
458
458
|
name: ( localizeWithPath(
|
|
@@ -474,10 +474,10 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
474
474
|
fileDecorations: { colors: true, badges: false },
|
|
475
475
|
extraClasses: []
|
|
476
476
|
};
|
|
477
|
-
if (element.edit.type &
|
|
477
|
+
if (element.edit.type & BulkFileOperationType.Create) {
|
|
478
478
|
this._details.innerText = ( localizeWithPath(_moduleId, 13, "(creating)"));
|
|
479
479
|
}
|
|
480
|
-
else if (element.edit.type &
|
|
480
|
+
else if (element.edit.type & BulkFileOperationType.Delete) {
|
|
481
481
|
this._details.innerText = ( localizeWithPath(_moduleId, 14, "(deleting)"));
|
|
482
482
|
options.extraClasses.push('delete');
|
|
483
483
|
}
|