@codingame/monaco-vscode-bulk-edit-service-override 10.1.0 → 10.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-bulk-edit-service-override",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.2",
|
|
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.2"
|
|
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
|
));
|