@codingame/monaco-vscode-bulk-edit-service-override 9.0.3 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +21 -24
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +2 -4
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.js +29 -31
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.js +12 -18
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.js +23 -20
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.js +30 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-bulk-edit-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.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@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -5,12 +5,10 @@ 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';
|
|
9
8
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
10
9
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
11
10
|
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
12
11
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
13
|
-
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
14
12
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
13
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
16
14
|
import { Progress } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
@@ -20,7 +18,6 @@ import { ResourceNotebookCellEdit, BulkCellEdits } from 'vscode/vscode/vs/workbe
|
|
|
20
18
|
import { BulkFileEdits } from './bulkFileEdits.js';
|
|
21
19
|
import { BulkTextEdits } from './bulkTextEdits.js';
|
|
22
20
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
23
|
-
import { ShutdownReason } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
24
21
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
25
22
|
import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
|
|
26
23
|
|
|
@@ -68,24 +65,24 @@ let BulkEdit = class BulkEdit {
|
|
|
68
65
|
}
|
|
69
66
|
}
|
|
70
67
|
if (this._edits.length === 0) {
|
|
71
|
-
return ( localize(
|
|
68
|
+
return ( localize(2113, "Made no edits"));
|
|
72
69
|
}
|
|
73
70
|
else if (otherResources.size === 0) {
|
|
74
71
|
if (textEditCount > 1 && textEditResources.size > 1) {
|
|
75
72
|
return ( localize(
|
|
76
|
-
|
|
73
|
+
2114,
|
|
77
74
|
"Made {0} text edits in {1} files",
|
|
78
75
|
textEditCount,
|
|
79
76
|
textEditResources.size
|
|
80
77
|
));
|
|
81
78
|
}
|
|
82
79
|
else {
|
|
83
|
-
return ( localize(
|
|
80
|
+
return ( localize(2115, "Made {0} text edits in one file", textEditCount));
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
83
|
else {
|
|
87
84
|
return ( localize(
|
|
88
|
-
|
|
85
|
+
2116,
|
|
89
86
|
"Made {0} text edits in {1} files, also created or deleted {2} files",
|
|
90
87
|
textEditCount,
|
|
91
88
|
textEditResources.size,
|
|
@@ -134,12 +131,12 @@ let BulkEdit = class BulkEdit {
|
|
|
134
131
|
}
|
|
135
132
|
async _performFileEdits(edits, undoRedoGroup, undoRedoSource, confirmBeforeUndo, progress) {
|
|
136
133
|
this._logService.debug('_performFileEdits', JSON.stringify(edits));
|
|
137
|
-
const model = this._instaService.createInstance(BulkFileEdits, this._label || ( localize(
|
|
134
|
+
const model = this._instaService.createInstance(BulkFileEdits, this._label || ( localize(2117, "Workspace Edit")), this._code || 'undoredo.workspaceEdit', undoRedoGroup, undoRedoSource, confirmBeforeUndo, progress, this._token, edits);
|
|
138
135
|
return await model.apply();
|
|
139
136
|
}
|
|
140
137
|
async _performTextEdits(edits, undoRedoGroup, undoRedoSource, progress) {
|
|
141
138
|
this._logService.debug('_performTextEdits', JSON.stringify(edits));
|
|
142
|
-
const model = this._instaService.createInstance(BulkTextEdits, this._label || ( localize(
|
|
139
|
+
const model = this._instaService.createInstance(BulkTextEdits, this._label || ( localize(2117, "Workspace Edit")), this._code || 'undoredo.workspaceEdit', this._editor, undoRedoGroup, undoRedoSource, progress, this._token, edits);
|
|
143
140
|
return await model.apply();
|
|
144
141
|
}
|
|
145
142
|
async _performCellEdits(edits, undoRedoGroup, undoRedoSource, progress) {
|
|
@@ -177,7 +174,7 @@ let BulkEditService = class BulkEditService {
|
|
|
177
174
|
async apply(editsIn, options) {
|
|
178
175
|
let edits = liftEdits(Array.isArray(editsIn) ? editsIn : editsIn.edits);
|
|
179
176
|
if (edits.length === 0) {
|
|
180
|
-
return { ariaSummary: ( localize(
|
|
177
|
+
return { ariaSummary: ( localize(2118, "Made no edits")), isApplied: false };
|
|
181
178
|
}
|
|
182
179
|
if (this._previewHandler && (options?.showPreview || ( (edits.some(value => value.metadata?.needsConfirmation))))) {
|
|
183
180
|
edits = await this._previewHandler(edits, options);
|
|
@@ -192,7 +189,7 @@ let BulkEditService = class BulkEditService {
|
|
|
192
189
|
codeEditor = candidate.getModifiedEditor();
|
|
193
190
|
}
|
|
194
191
|
}
|
|
195
|
-
if (codeEditor && codeEditor.getOption(
|
|
192
|
+
if (codeEditor && codeEditor.getOption(94 )) {
|
|
196
193
|
codeEditor = undefined;
|
|
197
194
|
}
|
|
198
195
|
let undoRedoGroup;
|
|
@@ -247,26 +244,26 @@ let BulkEditService = class BulkEditService {
|
|
|
247
244
|
let message;
|
|
248
245
|
let primaryButton;
|
|
249
246
|
switch (reason) {
|
|
250
|
-
case
|
|
251
|
-
message = ( localize(
|
|
252
|
-
primaryButton = ( localize(
|
|
247
|
+
case 1 :
|
|
248
|
+
message = ( localize(2119, "Are you sure you want to close the window?"));
|
|
249
|
+
primaryButton = ( localize(2120, "&&Close Window"));
|
|
253
250
|
break;
|
|
254
|
-
case
|
|
255
|
-
message = ( localize(
|
|
256
|
-
primaryButton = ( localize(
|
|
251
|
+
case 4 :
|
|
252
|
+
message = ( localize(2121, "Are you sure you want to change the workspace?"));
|
|
253
|
+
primaryButton = ( localize(2122, "Change &&Workspace"));
|
|
257
254
|
break;
|
|
258
|
-
case
|
|
259
|
-
message = ( localize(
|
|
260
|
-
primaryButton = ( localize(
|
|
255
|
+
case 3 :
|
|
256
|
+
message = ( localize(2123, "Are you sure you want to reload the window?"));
|
|
257
|
+
primaryButton = ( localize(2124, "&&Reload Window"));
|
|
261
258
|
break;
|
|
262
259
|
default:
|
|
263
|
-
message = ( localize(
|
|
264
|
-
primaryButton = ( localize(
|
|
260
|
+
message = ( localize(2125, "Are you sure you want to quit?"));
|
|
261
|
+
primaryButton = ( localize(2126, "&&Quit"));
|
|
265
262
|
break;
|
|
266
263
|
}
|
|
267
264
|
const result = await this._dialogService.confirm({
|
|
268
265
|
message,
|
|
269
|
-
detail: ( localize(
|
|
266
|
+
detail: ( localize(2127, "'{0}' is in progress.", label || ( localize(2128, "File operation")))),
|
|
270
267
|
primaryButton
|
|
271
268
|
});
|
|
272
269
|
return !result.confirmed;
|
|
@@ -287,7 +284,7 @@ const autoSaveSetting = 'files.refactoring.autoSave';
|
|
|
287
284
|
properties: {
|
|
288
285
|
[autoSaveSetting]: {
|
|
289
286
|
description: ( localize(
|
|
290
|
-
|
|
287
|
+
2129,
|
|
291
288
|
"Controls if files that were part of a refactoring are saved automatically"
|
|
292
289
|
)),
|
|
293
290
|
default: true,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { FileSystemProviderCapabilities } from 'vscode/vscode/vs/platform/files/common/files';
|
|
3
2
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
4
3
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
5
4
|
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
|
|
6
|
-
import { UndoRedoElementType } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo';
|
|
7
5
|
import { IUndoRedoService } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo.service';
|
|
8
6
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
7
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
@@ -221,7 +219,7 @@ let DeleteOperation = class DeleteOperation {
|
|
|
221
219
|
deletes.push({
|
|
222
220
|
resource: edit.oldUri,
|
|
223
221
|
recursive: edit.options.recursive,
|
|
224
|
-
useTrash: !edit.options.skipTrashBin && this._fileService.hasCapability(edit.oldUri,
|
|
222
|
+
useTrash: !edit.options.skipTrashBin && this._fileService.hasCapability(edit.oldUri, 4096 ) && this._configurationService.getValue('files.enableTrash')
|
|
225
223
|
});
|
|
226
224
|
let fileContent;
|
|
227
225
|
if (!edit.undoesCreate && !edit.options.folder && !(typeof edit.options.maxSize === 'number' && fileStat.size > edit.options.maxSize)) {
|
|
@@ -262,7 +260,7 @@ class FileUndoRedoElement {
|
|
|
262
260
|
this.code = code;
|
|
263
261
|
this.operations = operations;
|
|
264
262
|
this.confirmBeforeUndo = confirmBeforeUndo;
|
|
265
|
-
this.type =
|
|
263
|
+
this.type = 1 ;
|
|
266
264
|
this.resources = operations.flatMap(op => op.uris);
|
|
267
265
|
}
|
|
268
266
|
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
|
|
3
|
+
import { registerWorkbenchContribution2 } 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 {
|
|
6
|
+
import { 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 { localize, localize2 } from 'vscode/vscode/vs/nls';
|
|
@@ -11,8 +11,6 @@ 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';
|
|
16
14
|
import { WorkbenchListFocusContextKey } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
17
15
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
18
16
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
@@ -36,15 +34,15 @@ let UXState = class UXState {
|
|
|
36
34
|
constructor(_paneCompositeService, _editorGroupsService) {
|
|
37
35
|
this._paneCompositeService = _paneCompositeService;
|
|
38
36
|
this._editorGroupsService = _editorGroupsService;
|
|
39
|
-
this._activePanel = _paneCompositeService.getActivePaneComposite(
|
|
37
|
+
this._activePanel = _paneCompositeService.getActivePaneComposite(1 )?.getId();
|
|
40
38
|
}
|
|
41
39
|
async restore(panels, editors) {
|
|
42
40
|
if (panels) {
|
|
43
41
|
if (typeof this._activePanel === 'string') {
|
|
44
|
-
await this._paneCompositeService.openPaneComposite(this._activePanel,
|
|
42
|
+
await this._paneCompositeService.openPaneComposite(this._activePanel, 1 );
|
|
45
43
|
}
|
|
46
44
|
else {
|
|
47
|
-
this._paneCompositeService.hideActivePaneComposite(
|
|
45
|
+
this._paneCompositeService.hideActivePaneComposite(1 );
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
if (editors) {
|
|
@@ -96,12 +94,12 @@ let BulkEditPreviewContribution = class BulkEditPreviewContribution {
|
|
|
96
94
|
if (view.hasInput()) {
|
|
97
95
|
const { confirmed } = await this._dialogService.confirm({
|
|
98
96
|
type: Severity$1.Info,
|
|
99
|
-
message: ( localize(
|
|
97
|
+
message: ( localize(2130, "Another refactoring is being previewed.")),
|
|
100
98
|
detail: ( localize(
|
|
101
|
-
|
|
99
|
+
2131,
|
|
102
100
|
"Press 'Continue' to discard the previous refactoring and continue with the current refactoring."
|
|
103
101
|
)),
|
|
104
|
-
primaryButton: ( localize(
|
|
102
|
+
primaryButton: ( localize(2132, "&&Continue"))
|
|
105
103
|
});
|
|
106
104
|
if (!confirmed) {
|
|
107
105
|
return [];
|
|
@@ -142,8 +140,8 @@ registerAction2(class ApplyAction extends Action2 {
|
|
|
142
140
|
constructor() {
|
|
143
141
|
super({
|
|
144
142
|
id: 'refactorPreview.apply',
|
|
145
|
-
title: ( localize2(
|
|
146
|
-
category: ( localize2(
|
|
143
|
+
title: ( localize2(2133, "Apply Refactoring")),
|
|
144
|
+
category: ( localize2(2134, "Refactor Preview")),
|
|
147
145
|
icon: Codicon.check,
|
|
148
146
|
precondition: ( (ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, BulkEditPane.ctxHasCheckedChanges))),
|
|
149
147
|
menu: [{
|
|
@@ -151,12 +149,12 @@ registerAction2(class ApplyAction extends Action2 {
|
|
|
151
149
|
order: 1
|
|
152
150
|
}],
|
|
153
151
|
keybinding: {
|
|
154
|
-
weight:
|
|
152
|
+
weight: 100 - 10,
|
|
155
153
|
when: ( (ContextKeyExpr.and(
|
|
156
154
|
BulkEditPreviewContribution.ctxEnabled,
|
|
157
155
|
(FocusedViewContext.isEqualTo(BulkEditPane.ID))
|
|
158
156
|
))),
|
|
159
|
-
primary:
|
|
157
|
+
primary: 2048 + 3 ,
|
|
160
158
|
}
|
|
161
159
|
});
|
|
162
160
|
}
|
|
@@ -170,8 +168,8 @@ registerAction2(class DiscardAction extends Action2 {
|
|
|
170
168
|
constructor() {
|
|
171
169
|
super({
|
|
172
170
|
id: 'refactorPreview.discard',
|
|
173
|
-
title: ( localize2(
|
|
174
|
-
category: ( localize2(
|
|
171
|
+
title: ( localize2(2135, "Discard Refactoring")),
|
|
172
|
+
category: ( localize2(2134, "Refactor Preview")),
|
|
175
173
|
icon: Codicon.clearAll,
|
|
176
174
|
precondition: BulkEditPreviewContribution.ctxEnabled,
|
|
177
175
|
menu: [{
|
|
@@ -190,13 +188,13 @@ registerAction2(class ToggleAction extends Action2 {
|
|
|
190
188
|
constructor() {
|
|
191
189
|
super({
|
|
192
190
|
id: 'refactorPreview.toggleCheckedState',
|
|
193
|
-
title: ( localize2(
|
|
194
|
-
category: ( localize2(
|
|
191
|
+
title: ( localize2(2136, "Toggle Change")),
|
|
192
|
+
category: ( localize2(2134, "Refactor Preview")),
|
|
195
193
|
precondition: BulkEditPreviewContribution.ctxEnabled,
|
|
196
194
|
keybinding: {
|
|
197
|
-
weight:
|
|
195
|
+
weight: 200 ,
|
|
198
196
|
when: WorkbenchListFocusContextKey,
|
|
199
|
-
primary:
|
|
197
|
+
primary: 10 ,
|
|
200
198
|
},
|
|
201
199
|
menu: {
|
|
202
200
|
id: MenuId.BulkEditContext,
|
|
@@ -214,8 +212,8 @@ registerAction2(class GroupByFile extends Action2 {
|
|
|
214
212
|
constructor() {
|
|
215
213
|
super({
|
|
216
214
|
id: 'refactorPreview.groupByFile',
|
|
217
|
-
title: ( localize2(
|
|
218
|
-
category: ( localize2(
|
|
215
|
+
title: ( localize2(2137, "Group Changes By File")),
|
|
216
|
+
category: ( localize2(2134, "Refactor Preview")),
|
|
219
217
|
icon: Codicon.ungroupByRefType,
|
|
220
218
|
precondition: ( (ContextKeyExpr.and(
|
|
221
219
|
BulkEditPane.ctxHasCategories,
|
|
@@ -243,8 +241,8 @@ registerAction2(class GroupByType extends Action2 {
|
|
|
243
241
|
constructor() {
|
|
244
242
|
super({
|
|
245
243
|
id: 'refactorPreview.groupByType',
|
|
246
|
-
title: ( localize2(
|
|
247
|
-
category: ( localize2(
|
|
244
|
+
title: ( localize2(2138, "Group Changes By Type")),
|
|
245
|
+
category: ( localize2(2134, "Refactor Preview")),
|
|
248
246
|
icon: Codicon.groupByRefType,
|
|
249
247
|
precondition: ( (ContextKeyExpr.and(
|
|
250
248
|
BulkEditPane.ctxHasCategories,
|
|
@@ -269,8 +267,8 @@ registerAction2(class ToggleGrouping extends Action2 {
|
|
|
269
267
|
constructor() {
|
|
270
268
|
super({
|
|
271
269
|
id: 'refactorPreview.toggleGrouping',
|
|
272
|
-
title: ( localize2(
|
|
273
|
-
category: ( localize2(
|
|
270
|
+
title: ( localize2(2138, "Group Changes By Type")),
|
|
271
|
+
category: ( localize2(2134, "Refactor Preview")),
|
|
274
272
|
icon: Codicon.listTree,
|
|
275
273
|
toggled: ( (BulkEditPane.ctxGroupByFile.negate())),
|
|
276
274
|
precondition: ( (ContextKeyExpr.and(BulkEditPane.ctxHasCategories, BulkEditPreviewContribution.ctxEnabled))),
|
|
@@ -286,11 +284,11 @@ registerAction2(class ToggleGrouping extends Action2 {
|
|
|
286
284
|
view?.toggleGrouping();
|
|
287
285
|
}
|
|
288
286
|
});
|
|
289
|
-
registerWorkbenchContribution2(BulkEditPreviewContribution.ID, BulkEditPreviewContribution,
|
|
290
|
-
const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localize(
|
|
287
|
+
registerWorkbenchContribution2(BulkEditPreviewContribution.ID, BulkEditPreviewContribution, 2 );
|
|
288
|
+
const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localize(2139, 'View icon of the refactor preview view.')));
|
|
291
289
|
const container = ( (Registry.as(Extensions.ViewContainersRegistry))).registerViewContainer({
|
|
292
290
|
id: BulkEditPane.ID,
|
|
293
|
-
title: ( localize2(
|
|
291
|
+
title: ( localize2(2140, "Refactor Preview")),
|
|
294
292
|
hideIfEmpty: true,
|
|
295
293
|
ctorDescriptor: ( (new SyncDescriptor(
|
|
296
294
|
ViewPaneContainer,
|
|
@@ -298,10 +296,10 @@ const container = ( (Registry.as(Extensions.ViewContainersRegistry))).registerVi
|
|
|
298
296
|
))),
|
|
299
297
|
icon: refactorPreviewViewIcon,
|
|
300
298
|
storageId: BulkEditPane.ID
|
|
301
|
-
},
|
|
299
|
+
}, 1 );
|
|
302
300
|
( (Registry.as(Extensions.ViewsRegistry))).registerViews([{
|
|
303
301
|
id: BulkEditPane.ID,
|
|
304
|
-
name: ( localize2(
|
|
302
|
+
name: ( localize2(2140, "Refactor Preview")),
|
|
305
303
|
when: BulkEditPreviewContribution.ctxEnabled,
|
|
306
304
|
ctorDescriptor: ( (new SyncDescriptor(BulkEditPane))),
|
|
307
305
|
containerIcon: refactorPreviewViewIcon,
|
|
@@ -18,7 +18,6 @@ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/
|
|
|
18
18
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
19
19
|
import { WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
20
20
|
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
|
|
21
|
-
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
22
21
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
23
22
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
24
23
|
import { defaultButtonStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
@@ -26,17 +25,12 @@ import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeServi
|
|
|
26
25
|
import { ResourceLabels } from 'vscode/vscode/vs/workbench/browser/labels';
|
|
27
26
|
import { ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
28
27
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
|
|
29
|
-
import {
|
|
28
|
+
import { BulkEditPreviewProvider, BulkFileOperations } from './bulkEditPreview.js';
|
|
30
29
|
import { compareBulkFileOperations, BulkEditDataSource, BulkEditDelegate, TextEditElementRenderer, FileElementRenderer, CategoryElementRenderer, BulkEditAccessibilityProvider, BulkEditIdentityProvider, BulkEditNaviLabelProvider, BulkEditSorter, FileElement, CategoryElement, TextEditElement } from './bulkEditTree.js';
|
|
31
30
|
import { SIDE_GROUP, ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
32
31
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
33
32
|
|
|
34
33
|
var BulkEditPane_1;
|
|
35
|
-
var State;
|
|
36
|
-
( ((function(State) {
|
|
37
|
-
State["Data"] = "data";
|
|
38
|
-
State["Message"] = "message";
|
|
39
|
-
})(State || (State = {}))));
|
|
40
34
|
let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
41
35
|
static { BulkEditPane_1 = this; }
|
|
42
36
|
static { this.ID = 'refactorPreview'; }
|
|
@@ -61,7 +55,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
61
55
|
const computeDiffEditorInput = ( (new CachedFunction(async (fileOperation) => {
|
|
62
56
|
const fileOperationUri = fileOperation.uri;
|
|
63
57
|
const previewUri = this._currentProvider.asPreviewUri(fileOperationUri);
|
|
64
|
-
if (fileOperation.type &
|
|
58
|
+
if (fileOperation.type & 4 ) {
|
|
65
59
|
return {
|
|
66
60
|
original: { resource: URI.revive(previewUri) },
|
|
67
61
|
modified: { resource: undefined },
|
|
@@ -119,7 +113,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
119
113
|
const treeContainer = document.createElement('div');
|
|
120
114
|
contentContainer.appendChild(treeContainer);
|
|
121
115
|
this._treeDataSource = this._instaService.createInstance(BulkEditDataSource);
|
|
122
|
-
this._treeDataSource.groupByFile = this._storageService.getBoolean(BulkEditPane_1._memGroupByFile,
|
|
116
|
+
this._treeDataSource.groupByFile = this._storageService.getBoolean(BulkEditPane_1._memGroupByFile, 0 , true);
|
|
123
117
|
this._ctxGroupByFile.set(this._treeDataSource.groupByFile);
|
|
124
118
|
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, {
|
|
125
119
|
accessibilityProvider: this._instaService.createInstance(BulkEditAccessibilityProvider),
|
|
@@ -138,19 +132,19 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
138
132
|
const buttonBar = ( (new ButtonBar(buttonsContainer)));
|
|
139
133
|
this._disposables.add(buttonBar);
|
|
140
134
|
const btnConfirm = buttonBar.addButton({ supportIcons: true, ...defaultButtonStyles });
|
|
141
|
-
btnConfirm.label = ( localize(
|
|
135
|
+
btnConfirm.label = ( localize(5305, 'Apply'));
|
|
142
136
|
btnConfirm.onDidClick(() => this.accept(), this, this._disposables);
|
|
143
137
|
const btnCancel = buttonBar.addButton({ ...defaultButtonStyles, secondary: true });
|
|
144
|
-
btnCancel.label = ( localize(
|
|
138
|
+
btnCancel.label = ( localize(5306, 'Discard'));
|
|
145
139
|
btnCancel.onDidClick(() => this.discard(), this, this._disposables);
|
|
146
140
|
this._message = document.createElement('span');
|
|
147
141
|
this._message.className = 'message';
|
|
148
142
|
this._message.innerText = ( localize(
|
|
149
|
-
|
|
143
|
+
5307,
|
|
150
144
|
"Invoke a code action, like rename, to see a preview of its changes here."
|
|
151
145
|
));
|
|
152
146
|
parent.appendChild(this._message);
|
|
153
|
-
this._setState(
|
|
147
|
+
this._setState("message" );
|
|
154
148
|
}
|
|
155
149
|
layoutBody(height, width) {
|
|
156
150
|
super.layoutBody(height, width);
|
|
@@ -162,7 +156,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
162
156
|
this.element.dataset['state'] = state;
|
|
163
157
|
}
|
|
164
158
|
async setInput(edit, token) {
|
|
165
|
-
this._setState(
|
|
159
|
+
this._setState("data" );
|
|
166
160
|
this._sessionDisposables.clear();
|
|
167
161
|
this._treeViewStates.clear();
|
|
168
162
|
if (this._currentResolve) {
|
|
@@ -221,14 +215,14 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
221
215
|
let message;
|
|
222
216
|
if (conflicts.length === 1) {
|
|
223
217
|
message = ( localize(
|
|
224
|
-
|
|
218
|
+
5308,
|
|
225
219
|
"Cannot apply refactoring because '{0}' has changed in the meantime.",
|
|
226
220
|
this._labelService.getUriLabel(conflicts[0], { relative: true })
|
|
227
221
|
));
|
|
228
222
|
}
|
|
229
223
|
else {
|
|
230
224
|
message = ( localize(
|
|
231
|
-
|
|
225
|
+
5309,
|
|
232
226
|
"Cannot apply refactoring because {0} other files have changed in the meantime.",
|
|
233
227
|
conflicts.length
|
|
234
228
|
));
|
|
@@ -241,7 +235,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
241
235
|
_done(accept) {
|
|
242
236
|
this._currentResolve?.(accept ? this._currentInput?.getWorkspaceEdit() : undefined);
|
|
243
237
|
this._currentInput = undefined;
|
|
244
|
-
this._setState(
|
|
238
|
+
this._setState("message" );
|
|
245
239
|
this._sessionDisposables.clear();
|
|
246
240
|
}
|
|
247
241
|
toggleChecked() {
|
|
@@ -270,7 +264,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
270
264
|
this._treeViewStates.set(this._treeDataSource.groupByFile, oldViewState);
|
|
271
265
|
this._treeDataSource.groupByFile = !this._treeDataSource.groupByFile;
|
|
272
266
|
this._setTreeInput(input);
|
|
273
|
-
this._storageService.store(BulkEditPane_1._memGroupByFile, this._treeDataSource.groupByFile,
|
|
267
|
+
this._storageService.store(BulkEditPane_1._memGroupByFile, this._treeDataSource.groupByFile, 0 , 0 );
|
|
274
268
|
this._ctxGroupByFile.set(this._treeDataSource.groupByFile);
|
|
275
269
|
}
|
|
276
270
|
}
|
|
@@ -66,13 +66,6 @@ class BulkTextEdit {
|
|
|
66
66
|
this.textEdit = textEdit;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
var BulkFileOperationType;
|
|
70
|
-
( ((function(BulkFileOperationType) {
|
|
71
|
-
BulkFileOperationType[BulkFileOperationType["TextEdit"] = 1] = "TextEdit";
|
|
72
|
-
BulkFileOperationType[BulkFileOperationType["Create"] = 2] = "Create";
|
|
73
|
-
BulkFileOperationType[BulkFileOperationType["Delete"] = 4] = "Delete";
|
|
74
|
-
BulkFileOperationType[BulkFileOperationType["Rename"] = 8] = "Rename";
|
|
75
|
-
})(BulkFileOperationType || (BulkFileOperationType = {}))));
|
|
76
69
|
class BulkFileOperation {
|
|
77
70
|
constructor(uri, parent) {
|
|
78
71
|
this.uri = uri;
|
|
@@ -87,7 +80,7 @@ class BulkFileOperation {
|
|
|
87
80
|
if (edit instanceof ResourceTextEdit) {
|
|
88
81
|
this.textEdits.push(( (new BulkTextEdit(this, edit))));
|
|
89
82
|
}
|
|
90
|
-
else if (type ===
|
|
83
|
+
else if (type === 8 ) {
|
|
91
84
|
this.newUri = edit.newResource;
|
|
92
85
|
}
|
|
93
86
|
}
|
|
@@ -102,7 +95,7 @@ class BulkFileOperation {
|
|
|
102
95
|
}
|
|
103
96
|
class BulkCategory {
|
|
104
97
|
static { this._defaultMetadata = ( (Object.freeze({
|
|
105
|
-
label: ( localize(
|
|
98
|
+
label: ( localize(10093, "Other")),
|
|
106
99
|
icon: Codicon.symbolFile,
|
|
107
100
|
needsConfirmation: false
|
|
108
101
|
}))); }
|
|
@@ -146,12 +139,12 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
146
139
|
let type;
|
|
147
140
|
this.checked.updateChecked(edit, !edit.metadata?.needsConfirmation);
|
|
148
141
|
if (edit instanceof ResourceTextEdit) {
|
|
149
|
-
type =
|
|
142
|
+
type = 1 ;
|
|
150
143
|
uri = edit.resource;
|
|
151
144
|
}
|
|
152
145
|
else if (edit instanceof ResourceFileEdit) {
|
|
153
146
|
if (edit.newResource && edit.oldResource) {
|
|
154
|
-
type =
|
|
147
|
+
type = 8 ;
|
|
155
148
|
uri = edit.oldResource;
|
|
156
149
|
if (edit.options?.overwrite === undefined && edit.options?.ignoreIfExists && (await this._fileService.exists(uri))) {
|
|
157
150
|
continue;
|
|
@@ -159,14 +152,14 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
159
152
|
newToOldUri.set(edit.newResource, uri);
|
|
160
153
|
}
|
|
161
154
|
else if (edit.oldResource) {
|
|
162
|
-
type =
|
|
155
|
+
type = 4 ;
|
|
163
156
|
uri = edit.oldResource;
|
|
164
157
|
if (edit.options?.ignoreIfNotExists && !(await this._fileService.exists(uri))) {
|
|
165
158
|
continue;
|
|
166
159
|
}
|
|
167
160
|
}
|
|
168
161
|
else if (edit.newResource) {
|
|
169
|
-
type =
|
|
162
|
+
type = 2 ;
|
|
170
163
|
uri = edit.newResource;
|
|
171
164
|
if (edit.options?.overwrite === undefined && edit.options?.ignoreIfExists && (await this._fileService.exists(uri))) {
|
|
172
165
|
continue;
|
|
@@ -205,7 +198,7 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
205
198
|
operationByResource.forEach(value => this.fileOperations.push(value));
|
|
206
199
|
operationByCategory.forEach(value => this.categories.push(value));
|
|
207
200
|
for (const file of this.fileOperations) {
|
|
208
|
-
if (file.type !==
|
|
201
|
+
if (file.type !== 1 ) {
|
|
209
202
|
let checked = true;
|
|
210
203
|
for (const edit of ( (file.originalEdits.values()))) {
|
|
211
204
|
if (edit instanceof ResourceFileEdit) {
|
|
@@ -249,15 +242,25 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
249
242
|
coalesceInPlace(result);
|
|
250
243
|
return result;
|
|
251
244
|
}
|
|
252
|
-
|
|
245
|
+
async getFileEditOperation(edit) {
|
|
246
|
+
const content = await edit.options.contents;
|
|
247
|
+
if (!content) {
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
return EditOperation.replaceMove(Range.lift({ startLineNumber: 0, startColumn: 0, endLineNumber: Number.MAX_VALUE, endColumn: 0 }), ( (content.toString())));
|
|
251
|
+
}
|
|
252
|
+
async getFileEdits(uri) {
|
|
253
253
|
for (const file of this.fileOperations) {
|
|
254
254
|
if (( (file.uri.toString())) === ( (uri.toString()))) {
|
|
255
255
|
const result = [];
|
|
256
256
|
let ignoreAll = false;
|
|
257
257
|
for (const edit of ( (file.originalEdits.values()))) {
|
|
258
|
-
if (edit instanceof
|
|
258
|
+
if (edit instanceof ResourceFileEdit) {
|
|
259
|
+
result.push(this.getFileEditOperation(edit));
|
|
260
|
+
}
|
|
261
|
+
else if (edit instanceof ResourceTextEdit) {
|
|
259
262
|
if (this.checked.isChecked(edit)) {
|
|
260
|
-
result.push(EditOperation.replaceMove(Range.lift(edit.textEdit.range), !edit.textEdit.insertAsSnippet ? edit.textEdit.text : SnippetParser.asInsertText(edit.textEdit.text)));
|
|
263
|
+
result.push(Promise.resolve(EditOperation.replaceMove(Range.lift(edit.textEdit.range), !edit.textEdit.insertAsSnippet ? edit.textEdit.text : SnippetParser.asInsertText(edit.textEdit.text))));
|
|
261
264
|
}
|
|
262
265
|
}
|
|
263
266
|
else if (!this.checked.isChecked(edit)) {
|
|
@@ -267,7 +270,7 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
267
270
|
if (ignoreAll) {
|
|
268
271
|
return [];
|
|
269
272
|
}
|
|
270
|
-
return result.sort((a, b) => Range.compareRangesUsingStarts(a.range, b.range));
|
|
273
|
+
return (await Promise.all(result)).filter(r => r !== undefined).sort((a, b) => Range.compareRangesUsingStarts(a.range, b.range));
|
|
271
274
|
}
|
|
272
275
|
}
|
|
273
276
|
return [];
|
|
@@ -332,7 +335,7 @@ let BulkEditPreviewProvider = class BulkEditPreviewProvider {
|
|
|
332
335
|
if (undoEdits) {
|
|
333
336
|
model.applyEdits(undoEdits);
|
|
334
337
|
}
|
|
335
|
-
const newEdits = this._operations.getFileEdits(uri);
|
|
338
|
+
const newEdits = await this._operations.getFileEdits(uri);
|
|
336
339
|
const newUndoEdits = model.applyEdits(newEdits, true);
|
|
337
340
|
this._modelPreviewEdits.set(model.id, newUndoEdits);
|
|
338
341
|
}
|
|
@@ -369,4 +372,4 @@ BulkEditPreviewProvider = BulkEditPreviewProvider_1 = ( (__decorate([
|
|
|
369
372
|
( (__param(3, ITextModelService)))
|
|
370
373
|
], BulkEditPreviewProvider)));
|
|
371
374
|
|
|
372
|
-
export { BulkCategory, BulkEditPreviewProvider, BulkFileOperation,
|
|
375
|
+
export { BulkCategory, BulkEditPreviewProvider, BulkFileOperation, 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 {
|
|
9
|
+
import { BulkFileOperations } from './bulkEditPreview.js';
|
|
10
10
|
import { FileKind } from 'vscode/vscode/vs/platform/files/common/files';
|
|
11
11
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
12
12
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
@@ -54,7 +54,7 @@ class FileElement {
|
|
|
54
54
|
isChecked() {
|
|
55
55
|
const model = this.parent instanceof CategoryElement ? this.parent.parent : this.parent;
|
|
56
56
|
let checked = true;
|
|
57
|
-
if (this.edit.type ===
|
|
57
|
+
if (this.edit.type === 1 ) {
|
|
58
58
|
checked = !this.edit.textEdits.every(edit => !model.checked.isChecked(edit.textEdit));
|
|
59
59
|
}
|
|
60
60
|
for (const edit of ( (this.edit.originalEdits.values()))) {
|
|
@@ -62,7 +62,7 @@ class FileElement {
|
|
|
62
62
|
checked = checked && model.checked.isChecked(edit);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
if (this.parent instanceof CategoryElement && this.edit.type ===
|
|
65
|
+
if (this.parent instanceof CategoryElement && this.edit.type === 1 ) {
|
|
66
66
|
for (const category of model.categories) {
|
|
67
67
|
for (const file of category.fileOperations) {
|
|
68
68
|
if (( (file.uri.toString())) === ( (this.edit.uri.toString()))) {
|
|
@@ -82,7 +82,7 @@ class FileElement {
|
|
|
82
82
|
for (const edit of ( (this.edit.originalEdits.values()))) {
|
|
83
83
|
model.checked.updateChecked(edit, value);
|
|
84
84
|
}
|
|
85
|
-
if (this.parent instanceof CategoryElement && this.edit.type !==
|
|
85
|
+
if (this.parent instanceof CategoryElement && this.edit.type !== 1 ) {
|
|
86
86
|
for (const category of model.categories) {
|
|
87
87
|
for (const file of category.fileOperations) {
|
|
88
88
|
if (( (file.uri.toString())) === ( (this.edit.uri.toString()))) {
|
|
@@ -95,7 +95,7 @@ class FileElement {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
isDisabled() {
|
|
98
|
-
if (this.parent instanceof CategoryElement && this.edit.type ===
|
|
98
|
+
if (this.parent instanceof CategoryElement && this.edit.type === 1 ) {
|
|
99
99
|
const model = this.parent.parent;
|
|
100
100
|
let checked = true;
|
|
101
101
|
for (const category of model.categories) {
|
|
@@ -240,7 +240,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
240
240
|
this._labelService = _labelService;
|
|
241
241
|
}
|
|
242
242
|
getWidgetAriaLabel() {
|
|
243
|
-
return ( localize(
|
|
243
|
+
return ( localize(10094, "Bulk Edit"));
|
|
244
244
|
}
|
|
245
245
|
getRole(_element) {
|
|
246
246
|
return 'checkbox';
|
|
@@ -248,55 +248,55 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
248
248
|
getAriaLabel(element) {
|
|
249
249
|
if (element instanceof FileElement) {
|
|
250
250
|
if (element.edit.textEdits.length > 0) {
|
|
251
|
-
if (element.edit.type &
|
|
251
|
+
if (element.edit.type & 8 && element.edit.newUri) {
|
|
252
252
|
return ( localize(
|
|
253
|
-
|
|
253
|
+
10095,
|
|
254
254
|
"Renaming {0} to {1}, also making text edits",
|
|
255
255
|
this._labelService.getUriLabel(element.edit.uri, { relative: true }),
|
|
256
256
|
this._labelService.getUriLabel(element.edit.newUri, { relative: true })
|
|
257
257
|
));
|
|
258
258
|
}
|
|
259
|
-
else if (element.edit.type &
|
|
259
|
+
else if (element.edit.type & 2 ) {
|
|
260
260
|
return ( localize(
|
|
261
|
-
|
|
261
|
+
10096,
|
|
262
262
|
"Creating {0}, also making text edits",
|
|
263
263
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
264
264
|
));
|
|
265
265
|
}
|
|
266
|
-
else if (element.edit.type &
|
|
266
|
+
else if (element.edit.type & 4 ) {
|
|
267
267
|
return ( localize(
|
|
268
|
-
|
|
268
|
+
10097,
|
|
269
269
|
"Deleting {0}, also making text edits",
|
|
270
270
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
271
271
|
));
|
|
272
272
|
}
|
|
273
273
|
else {
|
|
274
274
|
return ( localize(
|
|
275
|
-
|
|
275
|
+
10098,
|
|
276
276
|
"{0}, making text edits",
|
|
277
277
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
278
278
|
));
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
else {
|
|
282
|
-
if (element.edit.type &
|
|
282
|
+
if (element.edit.type & 8 && element.edit.newUri) {
|
|
283
283
|
return ( localize(
|
|
284
|
-
|
|
284
|
+
10099,
|
|
285
285
|
"Renaming {0} to {1}",
|
|
286
286
|
this._labelService.getUriLabel(element.edit.uri, { relative: true }),
|
|
287
287
|
this._labelService.getUriLabel(element.edit.newUri, { relative: true })
|
|
288
288
|
));
|
|
289
289
|
}
|
|
290
|
-
else if (element.edit.type &
|
|
290
|
+
else if (element.edit.type & 2 ) {
|
|
291
291
|
return ( localize(
|
|
292
|
-
|
|
292
|
+
10100,
|
|
293
293
|
"Creating {0}",
|
|
294
294
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
295
295
|
));
|
|
296
296
|
}
|
|
297
|
-
else if (element.edit.type &
|
|
297
|
+
else if (element.edit.type & 4 ) {
|
|
298
298
|
return ( localize(
|
|
299
|
-
|
|
299
|
+
10101,
|
|
300
300
|
"Deleting {0}",
|
|
301
301
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
302
302
|
));
|
|
@@ -306,7 +306,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
306
306
|
if (element instanceof TextEditElement) {
|
|
307
307
|
if (element.selecting.length > 0 && element.inserting.length > 0) {
|
|
308
308
|
return ( localize(
|
|
309
|
-
|
|
309
|
+
10102,
|
|
310
310
|
"line {0}, replacing {1} with {2}",
|
|
311
311
|
element.edit.textEdit.textEdit.range.startLineNumber,
|
|
312
312
|
element.selecting,
|
|
@@ -315,7 +315,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
315
315
|
}
|
|
316
316
|
else if (element.selecting.length > 0 && element.inserting.length === 0) {
|
|
317
317
|
return ( localize(
|
|
318
|
-
|
|
318
|
+
10103,
|
|
319
319
|
"line {0}, removing {1}",
|
|
320
320
|
element.edit.textEdit.textEdit.range.startLineNumber,
|
|
321
321
|
element.selecting
|
|
@@ -323,7 +323,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
323
323
|
}
|
|
324
324
|
else if (element.selecting.length === 0 && element.inserting.length > 0) {
|
|
325
325
|
return ( localize(
|
|
326
|
-
|
|
326
|
+
10104,
|
|
327
327
|
"line {0}, inserting {1}",
|
|
328
328
|
element.edit.textEdit.textEdit.range.startLineNumber,
|
|
329
329
|
element.selecting
|
|
@@ -427,11 +427,11 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
427
427
|
this._localDisposables.add(addDisposableListener(this._checkbox, 'change', () => {
|
|
428
428
|
element.setChecked(this._checkbox.checked);
|
|
429
429
|
}));
|
|
430
|
-
if (element.edit.type &
|
|
430
|
+
if (element.edit.type & 8 && element.edit.newUri) {
|
|
431
431
|
this._label.setResource({
|
|
432
432
|
resource: element.edit.uri,
|
|
433
433
|
name: ( localize(
|
|
434
|
-
|
|
434
|
+
10105,
|
|
435
435
|
"{0} → {1}",
|
|
436
436
|
this._labelService.getUriLabel(element.edit.uri, { relative: true }),
|
|
437
437
|
this._labelService.getUriLabel(element.edit.newUri, { relative: true })
|
|
@@ -439,7 +439,7 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
439
439
|
}, {
|
|
440
440
|
fileDecorations: { colors: true, badges: false }
|
|
441
441
|
});
|
|
442
|
-
this._details.innerText = ( localize(
|
|
442
|
+
this._details.innerText = ( localize(10106, "(renaming)"));
|
|
443
443
|
}
|
|
444
444
|
else {
|
|
445
445
|
const options = {
|
|
@@ -448,11 +448,11 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
448
448
|
fileDecorations: { colors: true, badges: false },
|
|
449
449
|
extraClasses: []
|
|
450
450
|
};
|
|
451
|
-
if (element.edit.type &
|
|
452
|
-
this._details.innerText = ( localize(
|
|
451
|
+
if (element.edit.type & 2 ) {
|
|
452
|
+
this._details.innerText = ( localize(10107, "(creating)"));
|
|
453
453
|
}
|
|
454
|
-
else if (element.edit.type &
|
|
455
|
-
this._details.innerText = ( localize(
|
|
454
|
+
else if (element.edit.type & 4 ) {
|
|
455
|
+
this._details.innerText = ( localize(10108, "(deleting)"));
|
|
456
456
|
options.extraClasses.push('delete');
|
|
457
457
|
}
|
|
458
458
|
else {
|
|
@@ -531,7 +531,7 @@ let TextEditElementTemplate = class TextEditElementTemplate {
|
|
|
531
531
|
let title;
|
|
532
532
|
const { metadata } = element.edit.textEdit;
|
|
533
533
|
if (metadata && metadata.description) {
|
|
534
|
-
title = ( localize(
|
|
534
|
+
title = ( localize(10109, "{0} - {1}", metadata.label, metadata.description));
|
|
535
535
|
}
|
|
536
536
|
else if (metadata) {
|
|
537
537
|
title = metadata.label;
|