@codingame/monaco-vscode-bulk-edit-service-override 11.0.0 → 11.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 +17 -17
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.js +18 -18
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.js +5 -5
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.js +1 -1
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.js +16 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-bulk-edit-service-override",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.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@11.0.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@11.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -65,24 +65,24 @@ let BulkEdit = class BulkEdit {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
if (this._edits.length === 0) {
|
|
68
|
-
return ( localize(
|
|
68
|
+
return ( localize(2110, "Made no edits"));
|
|
69
69
|
}
|
|
70
70
|
else if (otherResources.size === 0) {
|
|
71
71
|
if (textEditCount > 1 && textEditResources.size > 1) {
|
|
72
72
|
return ( localize(
|
|
73
|
-
|
|
73
|
+
2111,
|
|
74
74
|
"Made {0} text edits in {1} files",
|
|
75
75
|
textEditCount,
|
|
76
76
|
textEditResources.size
|
|
77
77
|
));
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
|
-
return ( localize(
|
|
80
|
+
return ( localize(2112, "Made {0} text edits in one file", textEditCount));
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
return ( localize(
|
|
85
|
-
|
|
85
|
+
2113,
|
|
86
86
|
"Made {0} text edits in {1} files, also created or deleted {2} files",
|
|
87
87
|
textEditCount,
|
|
88
88
|
textEditResources.size,
|
|
@@ -131,12 +131,12 @@ let BulkEdit = class BulkEdit {
|
|
|
131
131
|
}
|
|
132
132
|
async _performFileEdits(edits, undoRedoGroup, undoRedoSource, confirmBeforeUndo, progress) {
|
|
133
133
|
this._logService.debug('_performFileEdits', JSON.stringify(edits));
|
|
134
|
-
const model = this._instaService.createInstance(BulkFileEdits, this._label || ( localize(
|
|
134
|
+
const model = this._instaService.createInstance(BulkFileEdits, this._label || ( localize(2114, "Workspace Edit")), this._code || 'undoredo.workspaceEdit', undoRedoGroup, undoRedoSource, confirmBeforeUndo, progress, this._token, edits);
|
|
135
135
|
return await model.apply();
|
|
136
136
|
}
|
|
137
137
|
async _performTextEdits(edits, undoRedoGroup, undoRedoSource, progress) {
|
|
138
138
|
this._logService.debug('_performTextEdits', JSON.stringify(edits));
|
|
139
|
-
const model = this._instaService.createInstance(BulkTextEdits, this._label || ( localize(
|
|
139
|
+
const model = this._instaService.createInstance(BulkTextEdits, this._label || ( localize(2114, "Workspace Edit")), this._code || 'undoredo.workspaceEdit', this._editor, undoRedoGroup, undoRedoSource, progress, this._token, edits);
|
|
140
140
|
return await model.apply();
|
|
141
141
|
}
|
|
142
142
|
async _performCellEdits(edits, undoRedoGroup, undoRedoSource, progress) {
|
|
@@ -174,7 +174,7 @@ let BulkEditService = class BulkEditService {
|
|
|
174
174
|
async apply(editsIn, options) {
|
|
175
175
|
let edits = liftEdits(Array.isArray(editsIn) ? editsIn : editsIn.edits);
|
|
176
176
|
if (edits.length === 0) {
|
|
177
|
-
return { ariaSummary: ( localize(
|
|
177
|
+
return { ariaSummary: ( localize(2115, "Made no edits")), isApplied: false };
|
|
178
178
|
}
|
|
179
179
|
if (this._previewHandler && (options?.showPreview || ( (edits.some(value => value.metadata?.needsConfirmation))))) {
|
|
180
180
|
edits = await this._previewHandler(edits, options);
|
|
@@ -245,25 +245,25 @@ let BulkEditService = class BulkEditService {
|
|
|
245
245
|
let primaryButton;
|
|
246
246
|
switch (reason) {
|
|
247
247
|
case 1 :
|
|
248
|
-
message = ( localize(
|
|
249
|
-
primaryButton = ( localize(
|
|
248
|
+
message = ( localize(2116, "Are you sure you want to close the window?"));
|
|
249
|
+
primaryButton = ( localize(2117, "&&Close Window"));
|
|
250
250
|
break;
|
|
251
251
|
case 4 :
|
|
252
|
-
message = ( localize(
|
|
253
|
-
primaryButton = ( localize(
|
|
252
|
+
message = ( localize(2118, "Are you sure you want to change the workspace?"));
|
|
253
|
+
primaryButton = ( localize(2119, "Change &&Workspace"));
|
|
254
254
|
break;
|
|
255
255
|
case 3 :
|
|
256
|
-
message = ( localize(
|
|
257
|
-
primaryButton = ( localize(
|
|
256
|
+
message = ( localize(2120, "Are you sure you want to reload the window?"));
|
|
257
|
+
primaryButton = ( localize(2121, "&&Reload Window"));
|
|
258
258
|
break;
|
|
259
259
|
default:
|
|
260
|
-
message = ( localize(
|
|
261
|
-
primaryButton = ( localize(
|
|
260
|
+
message = ( localize(2122, "Are you sure you want to quit?"));
|
|
261
|
+
primaryButton = ( localize(2123, "&&Quit"));
|
|
262
262
|
break;
|
|
263
263
|
}
|
|
264
264
|
const result = await this._dialogService.confirm({
|
|
265
265
|
message,
|
|
266
|
-
detail: ( localize(
|
|
266
|
+
detail: ( localize(2124, "'{0}' is in progress.", label || ( localize(2125, "File operation")))),
|
|
267
267
|
primaryButton
|
|
268
268
|
});
|
|
269
269
|
return !result.confirmed;
|
|
@@ -284,7 +284,7 @@ const autoSaveSetting = 'files.refactoring.autoSave';
|
|
|
284
284
|
properties: {
|
|
285
285
|
[autoSaveSetting]: {
|
|
286
286
|
description: ( localize(
|
|
287
|
-
|
|
287
|
+
2126,
|
|
288
288
|
"Controls if files that were part of a refactoring are saved automatically"
|
|
289
289
|
)),
|
|
290
290
|
default: true,
|
|
@@ -94,12 +94,12 @@ let BulkEditPreviewContribution = class BulkEditPreviewContribution {
|
|
|
94
94
|
if (view.hasInput()) {
|
|
95
95
|
const { confirmed } = await this._dialogService.confirm({
|
|
96
96
|
type: Severity$1.Info,
|
|
97
|
-
message: ( localize(
|
|
97
|
+
message: ( localize(2127, "Another refactoring is being previewed.")),
|
|
98
98
|
detail: ( localize(
|
|
99
|
-
|
|
99
|
+
2128,
|
|
100
100
|
"Press 'Continue' to discard the previous refactoring and continue with the current refactoring."
|
|
101
101
|
)),
|
|
102
|
-
primaryButton: ( localize(
|
|
102
|
+
primaryButton: ( localize(2129, "&&Continue"))
|
|
103
103
|
});
|
|
104
104
|
if (!confirmed) {
|
|
105
105
|
return [];
|
|
@@ -140,8 +140,8 @@ registerAction2(class ApplyAction extends Action2 {
|
|
|
140
140
|
constructor() {
|
|
141
141
|
super({
|
|
142
142
|
id: 'refactorPreview.apply',
|
|
143
|
-
title: ( localize2(
|
|
144
|
-
category: ( localize2(
|
|
143
|
+
title: ( localize2(2130, "Apply Refactoring")),
|
|
144
|
+
category: ( localize2(2131, "Refactor Preview")),
|
|
145
145
|
icon: Codicon.check,
|
|
146
146
|
precondition: ( (ContextKeyExpr.and(BulkEditPreviewContribution.ctxEnabled, BulkEditPane.ctxHasCheckedChanges))),
|
|
147
147
|
menu: [{
|
|
@@ -168,8 +168,8 @@ registerAction2(class DiscardAction extends Action2 {
|
|
|
168
168
|
constructor() {
|
|
169
169
|
super({
|
|
170
170
|
id: 'refactorPreview.discard',
|
|
171
|
-
title: ( localize2(
|
|
172
|
-
category: ( localize2(
|
|
171
|
+
title: ( localize2(2132, "Discard Refactoring")),
|
|
172
|
+
category: ( localize2(2131, "Refactor Preview")),
|
|
173
173
|
icon: Codicon.clearAll,
|
|
174
174
|
precondition: BulkEditPreviewContribution.ctxEnabled,
|
|
175
175
|
menu: [{
|
|
@@ -188,8 +188,8 @@ registerAction2(class ToggleAction extends Action2 {
|
|
|
188
188
|
constructor() {
|
|
189
189
|
super({
|
|
190
190
|
id: 'refactorPreview.toggleCheckedState',
|
|
191
|
-
title: ( localize2(
|
|
192
|
-
category: ( localize2(
|
|
191
|
+
title: ( localize2(2133, "Toggle Change")),
|
|
192
|
+
category: ( localize2(2131, "Refactor Preview")),
|
|
193
193
|
precondition: BulkEditPreviewContribution.ctxEnabled,
|
|
194
194
|
keybinding: {
|
|
195
195
|
weight: 200 ,
|
|
@@ -212,8 +212,8 @@ registerAction2(class GroupByFile extends Action2 {
|
|
|
212
212
|
constructor() {
|
|
213
213
|
super({
|
|
214
214
|
id: 'refactorPreview.groupByFile',
|
|
215
|
-
title: ( localize2(
|
|
216
|
-
category: ( localize2(
|
|
215
|
+
title: ( localize2(2134, "Group Changes By File")),
|
|
216
|
+
category: ( localize2(2131, "Refactor Preview")),
|
|
217
217
|
icon: Codicon.ungroupByRefType,
|
|
218
218
|
precondition: ( (ContextKeyExpr.and(
|
|
219
219
|
BulkEditPane.ctxHasCategories,
|
|
@@ -241,8 +241,8 @@ registerAction2(class GroupByType extends Action2 {
|
|
|
241
241
|
constructor() {
|
|
242
242
|
super({
|
|
243
243
|
id: 'refactorPreview.groupByType',
|
|
244
|
-
title: ( localize2(
|
|
245
|
-
category: ( localize2(
|
|
244
|
+
title: ( localize2(2135, "Group Changes By Type")),
|
|
245
|
+
category: ( localize2(2131, "Refactor Preview")),
|
|
246
246
|
icon: Codicon.groupByRefType,
|
|
247
247
|
precondition: ( (ContextKeyExpr.and(
|
|
248
248
|
BulkEditPane.ctxHasCategories,
|
|
@@ -267,8 +267,8 @@ registerAction2(class ToggleGrouping extends Action2 {
|
|
|
267
267
|
constructor() {
|
|
268
268
|
super({
|
|
269
269
|
id: 'refactorPreview.toggleGrouping',
|
|
270
|
-
title: ( localize2(
|
|
271
|
-
category: ( localize2(
|
|
270
|
+
title: ( localize2(2135, "Group Changes By Type")),
|
|
271
|
+
category: ( localize2(2131, "Refactor Preview")),
|
|
272
272
|
icon: Codicon.listTree,
|
|
273
273
|
toggled: ( (BulkEditPane.ctxGroupByFile.negate())),
|
|
274
274
|
precondition: ( (ContextKeyExpr.and(BulkEditPane.ctxHasCategories, BulkEditPreviewContribution.ctxEnabled))),
|
|
@@ -285,10 +285,10 @@ registerAction2(class ToggleGrouping extends Action2 {
|
|
|
285
285
|
}
|
|
286
286
|
});
|
|
287
287
|
registerWorkbenchContribution2(BulkEditPreviewContribution.ID, BulkEditPreviewContribution, 2 );
|
|
288
|
-
const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localize(
|
|
288
|
+
const refactorPreviewViewIcon = registerIcon('refactor-preview-view-icon', Codicon.lightbulb, ( localize(2136, 'View icon of the refactor preview view.')));
|
|
289
289
|
const container = ( (Registry.as(Extensions.ViewContainersRegistry))).registerViewContainer({
|
|
290
290
|
id: BulkEditPane.ID,
|
|
291
|
-
title: ( localize2(
|
|
291
|
+
title: ( localize2(2137, "Refactor Preview")),
|
|
292
292
|
hideIfEmpty: true,
|
|
293
293
|
ctorDescriptor: ( (new SyncDescriptor(
|
|
294
294
|
ViewPaneContainer,
|
|
@@ -299,7 +299,7 @@ const container = ( (Registry.as(Extensions.ViewContainersRegistry))).registerVi
|
|
|
299
299
|
}, 1 );
|
|
300
300
|
( (Registry.as(Extensions.ViewsRegistry))).registerViews([{
|
|
301
301
|
id: BulkEditPane.ID,
|
|
302
|
-
name: ( localize2(
|
|
302
|
+
name: ( localize2(2137, "Refactor Preview")),
|
|
303
303
|
when: BulkEditPreviewContribution.ctxEnabled,
|
|
304
304
|
ctorDescriptor: ( (new SyncDescriptor(BulkEditPane))),
|
|
305
305
|
containerIcon: refactorPreviewViewIcon,
|
|
@@ -132,15 +132,15 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
132
132
|
const buttonBar = ( (new ButtonBar(buttonsContainer)));
|
|
133
133
|
this._disposables.add(buttonBar);
|
|
134
134
|
const btnConfirm = buttonBar.addButton({ supportIcons: true, ...defaultButtonStyles });
|
|
135
|
-
btnConfirm.label = ( localize(
|
|
135
|
+
btnConfirm.label = ( localize(5309, 'Apply'));
|
|
136
136
|
btnConfirm.onDidClick(() => this.accept(), this, this._disposables);
|
|
137
137
|
const btnCancel = buttonBar.addButton({ ...defaultButtonStyles, secondary: true });
|
|
138
|
-
btnCancel.label = ( localize(
|
|
138
|
+
btnCancel.label = ( localize(5310, 'Discard'));
|
|
139
139
|
btnCancel.onDidClick(() => this.discard(), this, this._disposables);
|
|
140
140
|
this._message = document.createElement('span');
|
|
141
141
|
this._message.className = 'message';
|
|
142
142
|
this._message.innerText = ( localize(
|
|
143
|
-
|
|
143
|
+
5311,
|
|
144
144
|
"Invoke a code action, like rename, to see a preview of its changes here."
|
|
145
145
|
));
|
|
146
146
|
parent.appendChild(this._message);
|
|
@@ -215,14 +215,14 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
215
215
|
let message;
|
|
216
216
|
if (conflicts.length === 1) {
|
|
217
217
|
message = ( localize(
|
|
218
|
-
|
|
218
|
+
5312,
|
|
219
219
|
"Cannot apply refactoring because '{0}' has changed in the meantime.",
|
|
220
220
|
this._labelService.getUriLabel(conflicts[0], { relative: true })
|
|
221
221
|
));
|
|
222
222
|
}
|
|
223
223
|
else {
|
|
224
224
|
message = ( localize(
|
|
225
|
-
|
|
225
|
+
5313,
|
|
226
226
|
"Cannot apply refactoring because {0} other files have changed in the meantime.",
|
|
227
227
|
conflicts.length
|
|
228
228
|
));
|
|
@@ -241,7 +241,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
241
241
|
this._labelService = _labelService;
|
|
242
242
|
}
|
|
243
243
|
getWidgetAriaLabel() {
|
|
244
|
-
return ( localize(
|
|
244
|
+
return ( localize(10175, "Bulk Edit"));
|
|
245
245
|
}
|
|
246
246
|
getRole(_element) {
|
|
247
247
|
return 'checkbox';
|
|
@@ -251,7 +251,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
251
251
|
if (element.edit.textEdits.length > 0) {
|
|
252
252
|
if (element.edit.type & 8 && element.edit.newUri) {
|
|
253
253
|
return ( localize(
|
|
254
|
-
|
|
254
|
+
10176,
|
|
255
255
|
"Renaming {0} to {1}, also making text edits",
|
|
256
256
|
this._labelService.getUriLabel(element.edit.uri, { relative: true }),
|
|
257
257
|
this._labelService.getUriLabel(element.edit.newUri, { relative: true })
|
|
@@ -259,21 +259,21 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
259
259
|
}
|
|
260
260
|
else if (element.edit.type & 2 ) {
|
|
261
261
|
return ( localize(
|
|
262
|
-
|
|
262
|
+
10177,
|
|
263
263
|
"Creating {0}, also making text edits",
|
|
264
264
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
265
265
|
));
|
|
266
266
|
}
|
|
267
267
|
else if (element.edit.type & 4 ) {
|
|
268
268
|
return ( localize(
|
|
269
|
-
|
|
269
|
+
10178,
|
|
270
270
|
"Deleting {0}, also making text edits",
|
|
271
271
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
272
272
|
));
|
|
273
273
|
}
|
|
274
274
|
else {
|
|
275
275
|
return ( localize(
|
|
276
|
-
|
|
276
|
+
10179,
|
|
277
277
|
"{0}, making text edits",
|
|
278
278
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
279
279
|
));
|
|
@@ -282,7 +282,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
282
282
|
else {
|
|
283
283
|
if (element.edit.type & 8 && element.edit.newUri) {
|
|
284
284
|
return ( localize(
|
|
285
|
-
|
|
285
|
+
10180,
|
|
286
286
|
"Renaming {0} to {1}",
|
|
287
287
|
this._labelService.getUriLabel(element.edit.uri, { relative: true }),
|
|
288
288
|
this._labelService.getUriLabel(element.edit.newUri, { relative: true })
|
|
@@ -290,14 +290,14 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
290
290
|
}
|
|
291
291
|
else if (element.edit.type & 2 ) {
|
|
292
292
|
return ( localize(
|
|
293
|
-
|
|
293
|
+
10181,
|
|
294
294
|
"Creating {0}",
|
|
295
295
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
296
296
|
));
|
|
297
297
|
}
|
|
298
298
|
else if (element.edit.type & 4 ) {
|
|
299
299
|
return ( localize(
|
|
300
|
-
|
|
300
|
+
10182,
|
|
301
301
|
"Deleting {0}",
|
|
302
302
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
303
303
|
));
|
|
@@ -307,7 +307,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
307
307
|
if (element instanceof TextEditElement) {
|
|
308
308
|
if (element.selecting.length > 0 && element.inserting.length > 0) {
|
|
309
309
|
return ( localize(
|
|
310
|
-
|
|
310
|
+
10183,
|
|
311
311
|
"line {0}, replacing {1} with {2}",
|
|
312
312
|
element.edit.textEdit.textEdit.range.startLineNumber,
|
|
313
313
|
element.selecting,
|
|
@@ -316,7 +316,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
316
316
|
}
|
|
317
317
|
else if (element.selecting.length > 0 && element.inserting.length === 0) {
|
|
318
318
|
return ( localize(
|
|
319
|
-
|
|
319
|
+
10184,
|
|
320
320
|
"line {0}, removing {1}",
|
|
321
321
|
element.edit.textEdit.textEdit.range.startLineNumber,
|
|
322
322
|
element.selecting
|
|
@@ -324,7 +324,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
324
324
|
}
|
|
325
325
|
else if (element.selecting.length === 0 && element.inserting.length > 0) {
|
|
326
326
|
return ( localize(
|
|
327
|
-
|
|
327
|
+
10185,
|
|
328
328
|
"line {0}, inserting {1}",
|
|
329
329
|
element.edit.textEdit.textEdit.range.startLineNumber,
|
|
330
330
|
element.selecting
|
|
@@ -432,7 +432,7 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
432
432
|
this._label.setResource({
|
|
433
433
|
resource: element.edit.uri,
|
|
434
434
|
name: ( localize(
|
|
435
|
-
|
|
435
|
+
10186,
|
|
436
436
|
"{0} → {1}",
|
|
437
437
|
this._labelService.getUriLabel(element.edit.uri, { relative: true }),
|
|
438
438
|
this._labelService.getUriLabel(element.edit.newUri, { relative: true })
|
|
@@ -440,7 +440,7 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
440
440
|
}, {
|
|
441
441
|
fileDecorations: { colors: true, badges: false }
|
|
442
442
|
});
|
|
443
|
-
this._details.innerText = ( localize(
|
|
443
|
+
this._details.innerText = ( localize(10187, "(renaming)"));
|
|
444
444
|
}
|
|
445
445
|
else {
|
|
446
446
|
const options = {
|
|
@@ -450,10 +450,10 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
450
450
|
extraClasses: []
|
|
451
451
|
};
|
|
452
452
|
if (element.edit.type & 2 ) {
|
|
453
|
-
this._details.innerText = ( localize(
|
|
453
|
+
this._details.innerText = ( localize(10188, "(creating)"));
|
|
454
454
|
}
|
|
455
455
|
else if (element.edit.type & 4 ) {
|
|
456
|
-
this._details.innerText = ( localize(
|
|
456
|
+
this._details.innerText = ( localize(10189, "(deleting)"));
|
|
457
457
|
options.extraClasses.push('delete');
|
|
458
458
|
}
|
|
459
459
|
else {
|
|
@@ -532,7 +532,7 @@ let TextEditElementTemplate = class TextEditElementTemplate {
|
|
|
532
532
|
let title;
|
|
533
533
|
const { metadata } = element.edit.textEdit;
|
|
534
534
|
if (metadata && metadata.description) {
|
|
535
|
-
title = ( localize(
|
|
535
|
+
title = ( localize(10190, "{0} - {1}", metadata.label, metadata.description));
|
|
536
536
|
}
|
|
537
537
|
else if (metadata) {
|
|
538
538
|
title = metadata.label;
|