@codingame/monaco-vscode-bulk-edit-service-override 10.1.0 → 10.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 +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/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": "10.1.
|
|
3
|
+
"version": "10.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@10.1.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.1.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(2113, "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
|
+
2114,
|
|
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(2115, "Made {0} text edits in one file", textEditCount));
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
return ( localize(
|
|
85
|
-
|
|
85
|
+
2116,
|
|
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(2117, "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(2117, "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(2118, "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(2119, "Are you sure you want to close the window?"));
|
|
249
|
+
primaryButton = ( localize(2120, "&&Close Window"));
|
|
250
250
|
break;
|
|
251
251
|
case 4 :
|
|
252
|
-
message = ( localize(
|
|
253
|
-
primaryButton = ( localize(
|
|
252
|
+
message = ( localize(2121, "Are you sure you want to change the workspace?"));
|
|
253
|
+
primaryButton = ( localize(2122, "Change &&Workspace"));
|
|
254
254
|
break;
|
|
255
255
|
case 3 :
|
|
256
|
-
message = ( localize(
|
|
257
|
-
primaryButton = ( localize(
|
|
256
|
+
message = ( localize(2123, "Are you sure you want to reload the window?"));
|
|
257
|
+
primaryButton = ( localize(2124, "&&Reload Window"));
|
|
258
258
|
break;
|
|
259
259
|
default:
|
|
260
|
-
message = ( localize(
|
|
261
|
-
primaryButton = ( localize(
|
|
260
|
+
message = ( localize(2125, "Are you sure you want to quit?"));
|
|
261
|
+
primaryButton = ( localize(2126, "&&Quit"));
|
|
262
262
|
break;
|
|
263
263
|
}
|
|
264
264
|
const result = await this._dialogService.confirm({
|
|
265
265
|
message,
|
|
266
|
-
detail: ( localize(
|
|
266
|
+
detail: ( localize(2127, "'{0}' is in progress.", label || ( localize(2128, "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
|
+
2129,
|
|
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(2130, "Another refactoring is being previewed.")),
|
|
98
98
|
detail: ( localize(
|
|
99
|
-
|
|
99
|
+
2131,
|
|
100
100
|
"Press 'Continue' to discard the previous refactoring and continue with the current refactoring."
|
|
101
101
|
)),
|
|
102
|
-
primaryButton: ( localize(
|
|
102
|
+
primaryButton: ( localize(2132, "&&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(2133, "Apply Refactoring")),
|
|
144
|
+
category: ( localize2(2134, "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(2135, "Discard Refactoring")),
|
|
172
|
+
category: ( localize2(2134, "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(2136, "Toggle Change")),
|
|
192
|
+
category: ( localize2(2134, "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(2137, "Group Changes By File")),
|
|
216
|
+
category: ( localize2(2134, "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(2138, "Group Changes By Type")),
|
|
245
|
+
category: ( localize2(2134, "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(2138, "Group Changes By Type")),
|
|
271
|
+
category: ( localize2(2134, "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(2139, '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(2140, "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(2140, "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(5277, '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(5278, '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
|
+
5279,
|
|
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
|
+
5280,
|
|
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
|
+
5281,
|
|
226
226
|
"Cannot apply refactoring because {0} other files have changed in the meantime.",
|
|
227
227
|
conflicts.length
|
|
228
228
|
));
|
|
@@ -240,7 +240,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
240
240
|
this._labelService = _labelService;
|
|
241
241
|
}
|
|
242
242
|
getWidgetAriaLabel() {
|
|
243
|
-
return ( localize(
|
|
243
|
+
return ( localize(10095, "Bulk Edit"));
|
|
244
244
|
}
|
|
245
245
|
getRole(_element) {
|
|
246
246
|
return 'checkbox';
|
|
@@ -250,7 +250,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
250
250
|
if (element.edit.textEdits.length > 0) {
|
|
251
251
|
if (element.edit.type & 8 && element.edit.newUri) {
|
|
252
252
|
return ( localize(
|
|
253
|
-
|
|
253
|
+
10096,
|
|
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 })
|
|
@@ -258,21 +258,21 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
258
258
|
}
|
|
259
259
|
else if (element.edit.type & 2 ) {
|
|
260
260
|
return ( localize(
|
|
261
|
-
|
|
261
|
+
10097,
|
|
262
262
|
"Creating {0}, also making text edits",
|
|
263
263
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
264
264
|
));
|
|
265
265
|
}
|
|
266
266
|
else if (element.edit.type & 4 ) {
|
|
267
267
|
return ( localize(
|
|
268
|
-
|
|
268
|
+
10098,
|
|
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
|
+
10099,
|
|
276
276
|
"{0}, making text edits",
|
|
277
277
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
278
278
|
));
|
|
@@ -281,7 +281,7 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
281
281
|
else {
|
|
282
282
|
if (element.edit.type & 8 && element.edit.newUri) {
|
|
283
283
|
return ( localize(
|
|
284
|
-
|
|
284
|
+
10100,
|
|
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 })
|
|
@@ -289,14 +289,14 @@ let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
|
|
|
289
289
|
}
|
|
290
290
|
else if (element.edit.type & 2 ) {
|
|
291
291
|
return ( localize(
|
|
292
|
-
|
|
292
|
+
10101,
|
|
293
293
|
"Creating {0}",
|
|
294
294
|
this._labelService.getUriLabel(element.edit.uri, { relative: true })
|
|
295
295
|
));
|
|
296
296
|
}
|
|
297
297
|
else if (element.edit.type & 4 ) {
|
|
298
298
|
return ( localize(
|
|
299
|
-
|
|
299
|
+
10102,
|
|
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
|
+
10103,
|
|
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
|
+
10104,
|
|
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
|
+
10105,
|
|
327
327
|
"line {0}, inserting {1}",
|
|
328
328
|
element.edit.textEdit.textEdit.range.startLineNumber,
|
|
329
329
|
element.selecting
|
|
@@ -431,7 +431,7 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
431
431
|
this._label.setResource({
|
|
432
432
|
resource: element.edit.uri,
|
|
433
433
|
name: ( localize(
|
|
434
|
-
|
|
434
|
+
10106,
|
|
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(10107, "(renaming)"));
|
|
443
443
|
}
|
|
444
444
|
else {
|
|
445
445
|
const options = {
|
|
@@ -449,10 +449,10 @@ let FileElementTemplate = class FileElementTemplate {
|
|
|
449
449
|
extraClasses: []
|
|
450
450
|
};
|
|
451
451
|
if (element.edit.type & 2 ) {
|
|
452
|
-
this._details.innerText = ( localize(
|
|
452
|
+
this._details.innerText = ( localize(10108, "(creating)"));
|
|
453
453
|
}
|
|
454
454
|
else if (element.edit.type & 4 ) {
|
|
455
|
-
this._details.innerText = ( localize(
|
|
455
|
+
this._details.innerText = ( localize(10109, "(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(10110, "{0} - {1}", metadata.label, metadata.description));
|
|
535
535
|
}
|
|
536
536
|
else if (metadata) {
|
|
537
537
|
title = metadata.label;
|