@codingame/monaco-vscode-bulk-edit-service-override 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bulkEdit.js +2 -2
- package/package.json +2 -2
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/external/tslib/tslib.es6.js +0 -11
- package/override/vs/platform/dialogs/common/dialogs.js +0 -10
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +0 -360
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +0 -364
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +0 -267
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/conflicts.js +0 -80
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.js +0 -365
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.js +0 -342
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.js +0 -363
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.js +0 -657
package/bulkEdit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
2
2
|
import { IBulkEditService } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
|
|
3
|
-
import { BulkEditService } from '
|
|
4
|
-
import '
|
|
3
|
+
import { BulkEditService } from 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/bulkEditService';
|
|
4
|
+
import 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution';
|
|
5
5
|
|
|
6
6
|
function getServiceOverride() {
|
|
7
7
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-bulk-edit-service-override",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.1.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=( Object.keys(r.attributes)),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
2
|
-
|
|
3
|
-
export { n as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
function __decorate(decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
}
|
|
7
|
-
function __param(paramIndex, decorator) {
|
|
8
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { __decorate, __param };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { AbstractDialogHandler, IDialogService, IFileDialogService, getFileNamesMessage } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
2
|
-
|
|
3
|
-
var ConfirmResult;
|
|
4
|
-
( (function(ConfirmResult) {
|
|
5
|
-
ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
|
|
6
|
-
ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
|
|
7
|
-
ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
|
|
8
|
-
})(ConfirmResult || (ConfirmResult = {})));
|
|
9
|
-
|
|
10
|
-
export { ConfirmResult };
|
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
3
|
-
import { toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { LinkedList } from 'vscode/vscode/vs/base/common/linkedList';
|
|
5
|
-
import { ResourceMap, ResourceSet } from 'vscode/vscode/vs/base/common/map';
|
|
6
|
-
import { isCodeEditor, isDiffEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
7
|
-
import { ResourceTextEdit, ResourceFileEdit } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
|
|
8
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
9
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
10
|
-
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
11
|
-
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
12
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
13
|
-
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
14
|
-
import { Progress } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
15
|
-
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
16
|
-
import { UndoRedoGroup } from 'vscode/vscode/vs/platform/undoRedo/common/undoRedo';
|
|
17
|
-
import { ResourceNotebookCellEdit, BulkCellEdits } from 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
|
|
18
|
-
import { BulkFileEdits } from './bulkFileEdits.js';
|
|
19
|
-
import { BulkTextEdits } from './bulkTextEdits.js';
|
|
20
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
21
|
-
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
22
|
-
import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService';
|
|
23
|
-
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
24
|
-
|
|
25
|
-
function liftEdits(edits) {
|
|
26
|
-
return ( edits.map(edit => {
|
|
27
|
-
if (ResourceTextEdit.is(edit)) {
|
|
28
|
-
return ResourceTextEdit.lift(edit);
|
|
29
|
-
}
|
|
30
|
-
if (ResourceFileEdit.is(edit)) {
|
|
31
|
-
return ResourceFileEdit.lift(edit);
|
|
32
|
-
}
|
|
33
|
-
if (ResourceNotebookCellEdit.is(edit)) {
|
|
34
|
-
return ResourceNotebookCellEdit.lift(edit);
|
|
35
|
-
}
|
|
36
|
-
throw new Error('Unsupported edit');
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
let BulkEdit = class BulkEdit {
|
|
40
|
-
constructor(_label, _code, _editor, _progress, _token, _edits, _undoRedoGroup, _undoRedoSource, _confirmBeforeUndo, _instaService, _logService) {
|
|
41
|
-
this._label = _label;
|
|
42
|
-
this._code = _code;
|
|
43
|
-
this._editor = _editor;
|
|
44
|
-
this._progress = _progress;
|
|
45
|
-
this._token = _token;
|
|
46
|
-
this._edits = _edits;
|
|
47
|
-
this._undoRedoGroup = _undoRedoGroup;
|
|
48
|
-
this._undoRedoSource = _undoRedoSource;
|
|
49
|
-
this._confirmBeforeUndo = _confirmBeforeUndo;
|
|
50
|
-
this._instaService = _instaService;
|
|
51
|
-
this._logService = _logService;
|
|
52
|
-
}
|
|
53
|
-
ariaMessage() {
|
|
54
|
-
const otherResources = ( new ResourceMap());
|
|
55
|
-
const textEditResources = ( new ResourceMap());
|
|
56
|
-
let textEditCount = 0;
|
|
57
|
-
for (const edit of this._edits) {
|
|
58
|
-
if (edit instanceof ResourceTextEdit) {
|
|
59
|
-
textEditCount += 1;
|
|
60
|
-
textEditResources.set(edit.resource, true);
|
|
61
|
-
}
|
|
62
|
-
else if (edit instanceof ResourceFileEdit) {
|
|
63
|
-
otherResources.set(edit.oldResource ?? edit.newResource, true);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (this._edits.length === 0) {
|
|
67
|
-
return ( localizeWithPath(
|
|
68
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
69
|
-
'summary.0',
|
|
70
|
-
"Made no edits"
|
|
71
|
-
));
|
|
72
|
-
}
|
|
73
|
-
else if (otherResources.size === 0) {
|
|
74
|
-
if (textEditCount > 1 && textEditResources.size > 1) {
|
|
75
|
-
return ( localizeWithPath(
|
|
76
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
77
|
-
'summary.nm',
|
|
78
|
-
"Made {0} text edits in {1} files",
|
|
79
|
-
textEditCount,
|
|
80
|
-
textEditResources.size
|
|
81
|
-
));
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
return ( localizeWithPath(
|
|
85
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
86
|
-
'summary.n0',
|
|
87
|
-
"Made {0} text edits in one file",
|
|
88
|
-
textEditCount
|
|
89
|
-
));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
return ( localizeWithPath(
|
|
94
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
95
|
-
'summary.textFiles',
|
|
96
|
-
"Made {0} text edits in {1} files, also created or deleted {2} files",
|
|
97
|
-
textEditCount,
|
|
98
|
-
textEditResources.size,
|
|
99
|
-
otherResources.size
|
|
100
|
-
));
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
async perform() {
|
|
104
|
-
if (this._edits.length === 0) {
|
|
105
|
-
return [];
|
|
106
|
-
}
|
|
107
|
-
const ranges = [1];
|
|
108
|
-
for (let i = 1; i < this._edits.length; i++) {
|
|
109
|
-
if (Object.getPrototypeOf(this._edits[i - 1]) === Object.getPrototypeOf(this._edits[i])) {
|
|
110
|
-
ranges[ranges.length - 1]++;
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
ranges.push(1);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
const increment = this._edits.length > 1 ? 0 : undefined;
|
|
117
|
-
this._progress.report({ increment, total: 100 });
|
|
118
|
-
const progress = { report: _ => this._progress.report({ increment: 100 / this._edits.length }) };
|
|
119
|
-
const resources = [];
|
|
120
|
-
let index = 0;
|
|
121
|
-
for (const range of ranges) {
|
|
122
|
-
if (this._token.isCancellationRequested) {
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
const group = this._edits.slice(index, index + range);
|
|
126
|
-
if (group[0] instanceof ResourceFileEdit) {
|
|
127
|
-
resources.push(await this._performFileEdits(group, this._undoRedoGroup, this._undoRedoSource, this._confirmBeforeUndo, progress));
|
|
128
|
-
}
|
|
129
|
-
else if (group[0] instanceof ResourceTextEdit) {
|
|
130
|
-
resources.push(await this._performTextEdits(group, this._undoRedoGroup, this._undoRedoSource, progress));
|
|
131
|
-
}
|
|
132
|
-
else if (group[0] instanceof ResourceNotebookCellEdit) {
|
|
133
|
-
resources.push(await this._performCellEdits(group, this._undoRedoGroup, this._undoRedoSource, progress));
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
console.log('UNKNOWN EDIT');
|
|
137
|
-
}
|
|
138
|
-
index = index + range;
|
|
139
|
-
}
|
|
140
|
-
return resources.flat();
|
|
141
|
-
}
|
|
142
|
-
async _performFileEdits(edits, undoRedoGroup, undoRedoSource, confirmBeforeUndo, progress) {
|
|
143
|
-
this._logService.debug('_performFileEdits', JSON.stringify(edits));
|
|
144
|
-
const model = this._instaService.createInstance(BulkFileEdits, this._label || ( localizeWithPath(
|
|
145
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
146
|
-
'workspaceEdit',
|
|
147
|
-
"Workspace Edit"
|
|
148
|
-
)), this._code || 'undoredo.workspaceEdit', undoRedoGroup, undoRedoSource, confirmBeforeUndo, progress, this._token, edits);
|
|
149
|
-
return await model.apply();
|
|
150
|
-
}
|
|
151
|
-
async _performTextEdits(edits, undoRedoGroup, undoRedoSource, progress) {
|
|
152
|
-
this._logService.debug('_performTextEdits', JSON.stringify(edits));
|
|
153
|
-
const model = this._instaService.createInstance(BulkTextEdits, this._label || ( localizeWithPath(
|
|
154
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
155
|
-
'workspaceEdit',
|
|
156
|
-
"Workspace Edit"
|
|
157
|
-
)), this._code || 'undoredo.workspaceEdit', this._editor, undoRedoGroup, undoRedoSource, progress, this._token, edits);
|
|
158
|
-
return await model.apply();
|
|
159
|
-
}
|
|
160
|
-
async _performCellEdits(edits, undoRedoGroup, undoRedoSource, progress) {
|
|
161
|
-
this._logService.debug('_performCellEdits', JSON.stringify(edits));
|
|
162
|
-
const model = this._instaService.createInstance(BulkCellEdits, undoRedoGroup, undoRedoSource, progress, this._token, edits);
|
|
163
|
-
return await model.apply();
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
BulkEdit = ( __decorate([
|
|
167
|
-
( __param(9, IInstantiationService)),
|
|
168
|
-
( __param(10, ILogService))
|
|
169
|
-
], BulkEdit));
|
|
170
|
-
let BulkEditService = class BulkEditService {
|
|
171
|
-
constructor(_instaService, _logService, _editorService, _lifecycleService, _dialogService, _workingCopyService, _configService) {
|
|
172
|
-
this._instaService = _instaService;
|
|
173
|
-
this._logService = _logService;
|
|
174
|
-
this._editorService = _editorService;
|
|
175
|
-
this._lifecycleService = _lifecycleService;
|
|
176
|
-
this._dialogService = _dialogService;
|
|
177
|
-
this._workingCopyService = _workingCopyService;
|
|
178
|
-
this._configService = _configService;
|
|
179
|
-
this._activeUndoRedoGroups = ( new LinkedList());
|
|
180
|
-
}
|
|
181
|
-
setPreviewHandler(handler) {
|
|
182
|
-
this._previewHandler = handler;
|
|
183
|
-
return toDisposable(() => {
|
|
184
|
-
if (this._previewHandler === handler) {
|
|
185
|
-
this._previewHandler = undefined;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
hasPreviewHandler() {
|
|
190
|
-
return Boolean(this._previewHandler);
|
|
191
|
-
}
|
|
192
|
-
async apply(editsIn, options) {
|
|
193
|
-
let edits = liftEdits(Array.isArray(editsIn) ? editsIn : editsIn.edits);
|
|
194
|
-
if (edits.length === 0) {
|
|
195
|
-
return { ariaSummary: ( localizeWithPath(
|
|
196
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
197
|
-
'nothing',
|
|
198
|
-
"Made no edits"
|
|
199
|
-
)), isApplied: false };
|
|
200
|
-
}
|
|
201
|
-
if (this._previewHandler && (options?.showPreview || ( edits.some(value => value.metadata?.needsConfirmation)))) {
|
|
202
|
-
edits = await this._previewHandler(edits, options);
|
|
203
|
-
}
|
|
204
|
-
let codeEditor = options?.editor;
|
|
205
|
-
if (!codeEditor) {
|
|
206
|
-
const candidate = this._editorService.activeTextEditorControl;
|
|
207
|
-
if (isCodeEditor(candidate)) {
|
|
208
|
-
codeEditor = candidate;
|
|
209
|
-
}
|
|
210
|
-
else if (isDiffEditor(candidate)) {
|
|
211
|
-
codeEditor = candidate.getModifiedEditor();
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
if (codeEditor && codeEditor.getOption(91 )) {
|
|
215
|
-
codeEditor = undefined;
|
|
216
|
-
}
|
|
217
|
-
let undoRedoGroup;
|
|
218
|
-
let undoRedoGroupRemove = () => { };
|
|
219
|
-
if (typeof options?.undoRedoGroupId === 'number') {
|
|
220
|
-
for (const candidate of this._activeUndoRedoGroups) {
|
|
221
|
-
if (candidate.id === options.undoRedoGroupId) {
|
|
222
|
-
undoRedoGroup = candidate;
|
|
223
|
-
break;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
if (!undoRedoGroup) {
|
|
228
|
-
undoRedoGroup = ( new UndoRedoGroup());
|
|
229
|
-
undoRedoGroupRemove = this._activeUndoRedoGroups.push(undoRedoGroup);
|
|
230
|
-
}
|
|
231
|
-
const label = options?.quotableLabel || options?.label;
|
|
232
|
-
const bulkEdit = this._instaService.createInstance(BulkEdit, label, options?.code, codeEditor, options?.progress ?? Progress.None, options?.token ?? CancellationToken.None, edits, undoRedoGroup, options?.undoRedoSource, !!options?.confirmBeforeUndo);
|
|
233
|
-
let listener;
|
|
234
|
-
try {
|
|
235
|
-
listener = this._lifecycleService.onBeforeShutdown(e => e.veto(this._shouldVeto(label, e.reason), 'veto.blukEditService'));
|
|
236
|
-
const resources = await bulkEdit.perform();
|
|
237
|
-
if (options?.respectAutoSaveConfig && this._configService.getValue(autoSaveSetting) === true && resources.length > 1) {
|
|
238
|
-
await this._saveAll(resources);
|
|
239
|
-
}
|
|
240
|
-
return { ariaSummary: bulkEdit.ariaMessage(), isApplied: edits.length > 0 };
|
|
241
|
-
}
|
|
242
|
-
catch (err) {
|
|
243
|
-
this._logService.error(err);
|
|
244
|
-
throw err;
|
|
245
|
-
}
|
|
246
|
-
finally {
|
|
247
|
-
listener?.dispose();
|
|
248
|
-
undoRedoGroupRemove();
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
async _saveAll(resources) {
|
|
252
|
-
const set = ( new ResourceSet(resources));
|
|
253
|
-
const saves = ( this._workingCopyService.dirtyWorkingCopies.map(async (copy) => {
|
|
254
|
-
if (( set.has(copy.resource))) {
|
|
255
|
-
await copy.save();
|
|
256
|
-
}
|
|
257
|
-
}));
|
|
258
|
-
const result = await Promise.allSettled(saves);
|
|
259
|
-
for (const item of result) {
|
|
260
|
-
if (item.status === 'rejected') {
|
|
261
|
-
this._logService.warn(item.reason);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
async _shouldVeto(label, reason) {
|
|
266
|
-
let message;
|
|
267
|
-
let primaryButton;
|
|
268
|
-
switch (reason) {
|
|
269
|
-
case 1 :
|
|
270
|
-
message = ( localizeWithPath(
|
|
271
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
272
|
-
'closeTheWindow.message',
|
|
273
|
-
"Are you sure you want to close the window?"
|
|
274
|
-
));
|
|
275
|
-
primaryButton = ( localizeWithPath(
|
|
276
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
277
|
-
{ key: 'closeTheWindow', comment: ['&& denotes a mnemonic'] },
|
|
278
|
-
"&&Close Window"
|
|
279
|
-
));
|
|
280
|
-
break;
|
|
281
|
-
case 4 :
|
|
282
|
-
message = ( localizeWithPath(
|
|
283
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
284
|
-
'changeWorkspace.message',
|
|
285
|
-
"Are you sure you want to change the workspace?"
|
|
286
|
-
));
|
|
287
|
-
primaryButton = ( localizeWithPath(
|
|
288
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
289
|
-
{ key: 'changeWorkspace', comment: ['&& denotes a mnemonic'] },
|
|
290
|
-
"Change &&Workspace"
|
|
291
|
-
));
|
|
292
|
-
break;
|
|
293
|
-
case 3 :
|
|
294
|
-
message = ( localizeWithPath(
|
|
295
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
296
|
-
'reloadTheWindow.message',
|
|
297
|
-
"Are you sure you want to reload the window?"
|
|
298
|
-
));
|
|
299
|
-
primaryButton = ( localizeWithPath(
|
|
300
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
301
|
-
{ key: 'reloadTheWindow', comment: ['&& denotes a mnemonic'] },
|
|
302
|
-
"&&Reload Window"
|
|
303
|
-
));
|
|
304
|
-
break;
|
|
305
|
-
default:
|
|
306
|
-
message = ( localizeWithPath(
|
|
307
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
308
|
-
'quit.message',
|
|
309
|
-
"Are you sure you want to quit?"
|
|
310
|
-
));
|
|
311
|
-
primaryButton = ( localizeWithPath(
|
|
312
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
313
|
-
{ key: 'quit', comment: ['&& denotes a mnemonic'] },
|
|
314
|
-
"&&Quit"
|
|
315
|
-
));
|
|
316
|
-
break;
|
|
317
|
-
}
|
|
318
|
-
const result = await this._dialogService.confirm({
|
|
319
|
-
message,
|
|
320
|
-
detail: ( localizeWithPath(
|
|
321
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
322
|
-
'areYouSureQuiteBulkEdit.detail',
|
|
323
|
-
"'{0}' is in progress.",
|
|
324
|
-
label || ( localizeWithPath(
|
|
325
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
326
|
-
'fileOperation',
|
|
327
|
-
"File operation"
|
|
328
|
-
))
|
|
329
|
-
)),
|
|
330
|
-
primaryButton
|
|
331
|
-
});
|
|
332
|
-
return !result.confirmed;
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
BulkEditService = ( __decorate([
|
|
336
|
-
( __param(0, IInstantiationService)),
|
|
337
|
-
( __param(1, ILogService)),
|
|
338
|
-
( __param(2, IEditorService)),
|
|
339
|
-
( __param(3, ILifecycleService)),
|
|
340
|
-
( __param(4, IDialogService)),
|
|
341
|
-
( __param(5, IWorkingCopyService)),
|
|
342
|
-
( __param(6, IConfigurationService))
|
|
343
|
-
], BulkEditService));
|
|
344
|
-
const autoSaveSetting = 'files.refactoring.autoSave';
|
|
345
|
-
( Registry.as(Extensions.Configuration)).registerConfiguration({
|
|
346
|
-
id: 'files',
|
|
347
|
-
properties: {
|
|
348
|
-
[autoSaveSetting]: {
|
|
349
|
-
description: ( localizeWithPath(
|
|
350
|
-
'vs/workbench/contrib/bulkEdit/browser/bulkEditService',
|
|
351
|
-
'refactoring.autoSave',
|
|
352
|
-
"Controls if files that were part of a refactoring are saved automatically"
|
|
353
|
-
)),
|
|
354
|
-
default: true,
|
|
355
|
-
type: 'boolean'
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
export { BulkEditService };
|