@codingame/monaco-vscode-bulk-edit-service-override 4.5.1 → 5.0.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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +58 -117
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +2 -2
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +2 -2
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.js +61 -118
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.js +57 -60
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.js +46 -43
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.js +100 -113
|
@@ -28,18 +28,20 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
|
|
|
28
28
|
import { ButtonBar } from 'vscode/vscode/vs/base/browser/ui/button/button';
|
|
29
29
|
import { defaultButtonStyles } from 'vscode/vscode/vs/platform/theme/browser/defaultStyles';
|
|
30
30
|
import { LRUCachedFunction, CachedFunction } from 'vscode/vscode/vs/base/common/cache';
|
|
31
|
+
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
31
32
|
|
|
32
33
|
var BulkEditPane_1;
|
|
34
|
+
const _moduleId = "vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane";
|
|
33
35
|
let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
34
36
|
static { BulkEditPane_1 = this; }
|
|
35
37
|
static { this.ID = 'refactorPreview'; }
|
|
36
38
|
static { this.Schema = 'vscode-bulkeditpreview-multieditor'; }
|
|
37
|
-
static { this.ctxHasCategories = ( new RawContextKey('refactorPreview.hasCategories', false)); }
|
|
38
|
-
static { this.ctxGroupByFile = ( new RawContextKey('refactorPreview.groupByFile', true)); }
|
|
39
|
-
static { this.ctxHasCheckedChanges = ( new RawContextKey('refactorPreview.hasCheckedChanges', true)); }
|
|
39
|
+
static { this.ctxHasCategories = ( (new RawContextKey('refactorPreview.hasCategories', false))); }
|
|
40
|
+
static { this.ctxGroupByFile = ( (new RawContextKey('refactorPreview.groupByFile', true))); }
|
|
41
|
+
static { this.ctxHasCheckedChanges = ( (new RawContextKey('refactorPreview.hasCheckedChanges', true))); }
|
|
40
42
|
static { this._memGroupByFile = `${BulkEditPane_1.ID}.groupByFile`; }
|
|
41
|
-
constructor(options, _instaService, _editorService, _labelService, _textModelService, _dialogService, _contextMenuService, _storageService, contextKeyService, viewDescriptorService, keybindingService, contextMenuService, configurationService, openerService, themeService, telemetryService) {
|
|
42
|
-
super({ ...options, titleMenuId: MenuId.BulkEditTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, _instaService, openerService, themeService, telemetryService);
|
|
43
|
+
constructor(options, _instaService, _editorService, _labelService, _textModelService, _dialogService, _contextMenuService, _storageService, contextKeyService, viewDescriptorService, keybindingService, contextMenuService, configurationService, openerService, themeService, telemetryService, hoverService) {
|
|
44
|
+
super({ ...options, titleMenuId: MenuId.BulkEditTitle }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, _instaService, openerService, themeService, telemetryService, hoverService);
|
|
43
45
|
this._instaService = _instaService;
|
|
44
46
|
this._editorService = _editorService;
|
|
45
47
|
this._labelService = _labelService;
|
|
@@ -47,11 +49,11 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
47
49
|
this._dialogService = _dialogService;
|
|
48
50
|
this._contextMenuService = _contextMenuService;
|
|
49
51
|
this._storageService = _storageService;
|
|
50
|
-
this._treeViewStates = ( new Map());
|
|
51
|
-
this._disposables = ( new DisposableStore());
|
|
52
|
-
this._sessionDisposables = ( new DisposableStore());
|
|
53
|
-
this._computeResourceDiffEditorInputs = ( new LRUCachedFunction(async (fileOperations) => {
|
|
54
|
-
const computeDiffEditorInput = ( new CachedFunction(async (fileOperation) => {
|
|
52
|
+
this._treeViewStates = ( (new Map()));
|
|
53
|
+
this._disposables = ( (new DisposableStore()));
|
|
54
|
+
this._sessionDisposables = ( (new DisposableStore()));
|
|
55
|
+
this._computeResourceDiffEditorInputs = ( (new LRUCachedFunction(async (fileOperations) => {
|
|
56
|
+
const computeDiffEditorInput = ( (new CachedFunction(async (fileOperation) => {
|
|
55
57
|
const fileOperationUri = fileOperation.uri;
|
|
56
58
|
const previewUri = this._currentProvider.asPreviewUri(fileOperationUri);
|
|
57
59
|
if (fileOperation.type & 4 ) {
|
|
@@ -74,7 +76,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
74
76
|
modified: { resource: URI.revive(previewUri) }
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
|
-
}));
|
|
79
|
+
})));
|
|
78
80
|
const sortedFileOperations = fileOperations.slice().sort(compareBulkFileOperations);
|
|
79
81
|
const resources = [];
|
|
80
82
|
for (const operation of sortedFileOperations) {
|
|
@@ -88,7 +90,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
88
90
|
resources,
|
|
89
91
|
getResourceDiffEditorInputIdOfOperation
|
|
90
92
|
};
|
|
91
|
-
}
|
|
93
|
+
})));
|
|
92
94
|
this.element.classList.add('bulk-edit-panel', 'show-file-icons');
|
|
93
95
|
this._ctxHasCategories = BulkEditPane_1.ctxHasCategories.bindTo(contextKeyService);
|
|
94
96
|
this._ctxGroupByFile = BulkEditPane_1.ctxGroupByFile.bindTo(contextKeyService);
|
|
@@ -112,13 +114,13 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
112
114
|
this._treeDataSource = this._instaService.createInstance(BulkEditDataSource);
|
|
113
115
|
this._treeDataSource.groupByFile = this._storageService.getBoolean(BulkEditPane_1._memGroupByFile, 0 , true);
|
|
114
116
|
this._ctxGroupByFile.set(this._treeDataSource.groupByFile);
|
|
115
|
-
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, {
|
|
117
|
+
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, {
|
|
116
118
|
accessibilityProvider: this._instaService.createInstance(BulkEditAccessibilityProvider),
|
|
117
|
-
identityProvider: ( new BulkEditIdentityProvider()),
|
|
119
|
+
identityProvider: ( (new BulkEditIdentityProvider())),
|
|
118
120
|
expandOnlyOnTwistieClick: true,
|
|
119
121
|
multipleSelectionSupport: false,
|
|
120
|
-
keyboardNavigationLabelProvider: ( new BulkEditNaviLabelProvider()),
|
|
121
|
-
sorter: ( new BulkEditSorter()),
|
|
122
|
+
keyboardNavigationLabelProvider: ( (new BulkEditNaviLabelProvider())),
|
|
123
|
+
sorter: ( (new BulkEditSorter())),
|
|
122
124
|
selectionNavigation: true
|
|
123
125
|
});
|
|
124
126
|
this._disposables.add(this._tree.onContextMenu(this._onContextMenu, this));
|
|
@@ -126,27 +128,19 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
126
128
|
const buttonsContainer = document.createElement('div');
|
|
127
129
|
buttonsContainer.className = 'buttons';
|
|
128
130
|
contentContainer.appendChild(buttonsContainer);
|
|
129
|
-
const buttonBar = ( new ButtonBar(buttonsContainer));
|
|
131
|
+
const buttonBar = ( (new ButtonBar(buttonsContainer)));
|
|
130
132
|
this._disposables.add(buttonBar);
|
|
131
133
|
const btnConfirm = buttonBar.addButton({ supportIcons: true, ...defaultButtonStyles });
|
|
132
|
-
btnConfirm.label = ( localizeWithPath(
|
|
133
|
-
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane',
|
|
134
|
-
'ok',
|
|
135
|
-
'Apply'
|
|
136
|
-
));
|
|
134
|
+
btnConfirm.label = ( localizeWithPath(_moduleId, 0, 'Apply'));
|
|
137
135
|
btnConfirm.onDidClick(() => this.accept(), this, this._disposables);
|
|
138
136
|
const btnCancel = buttonBar.addButton({ ...defaultButtonStyles, secondary: true });
|
|
139
|
-
btnCancel.label = ( localizeWithPath(
|
|
140
|
-
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane',
|
|
141
|
-
'cancel',
|
|
142
|
-
'Discard'
|
|
143
|
-
));
|
|
137
|
+
btnCancel.label = ( localizeWithPath(_moduleId, 1, 'Discard'));
|
|
144
138
|
btnCancel.onDidClick(() => this.discard(), this, this._disposables);
|
|
145
139
|
this._message = document.createElement('span');
|
|
146
140
|
this._message.className = 'message';
|
|
147
141
|
this._message.innerText = ( localizeWithPath(
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
_moduleId,
|
|
143
|
+
2,
|
|
150
144
|
"Invoke a code action, like rename, to see a preview of its changes here."
|
|
151
145
|
));
|
|
152
146
|
parent.appendChild(this._message);
|
|
@@ -178,15 +172,17 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
178
172
|
this._treeDataSource.groupByFile = !hasCategories || this._treeDataSource.groupByFile;
|
|
179
173
|
this._ctxHasCheckedChanges.set(input.checked.checkedCount > 0);
|
|
180
174
|
this._currentInput = input;
|
|
181
|
-
return (
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
this.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
175
|
+
return (
|
|
176
|
+
(new Promise(resolve => {
|
|
177
|
+
token.onCancellationRequested(() => resolve(undefined));
|
|
178
|
+
this._currentResolve = resolve;
|
|
179
|
+
this._setTreeInput(input);
|
|
180
|
+
this._sessionDisposables.add(input.checked.onDidChange(() => {
|
|
181
|
+
this._tree.updateChildren();
|
|
182
|
+
this._ctxHasCheckedChanges.set(input.checked.checkedCount > 0);
|
|
183
|
+
}));
|
|
184
|
+
}))
|
|
185
|
+
);
|
|
190
186
|
}
|
|
191
187
|
hasInput() {
|
|
192
188
|
return Boolean(this._currentInput);
|
|
@@ -219,16 +215,16 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
219
215
|
let message;
|
|
220
216
|
if (conflicts.length === 1) {
|
|
221
217
|
message = ( localizeWithPath(
|
|
222
|
-
|
|
223
|
-
|
|
218
|
+
_moduleId,
|
|
219
|
+
3,
|
|
224
220
|
"Cannot apply refactoring because '{0}' has changed in the meantime.",
|
|
225
221
|
this._labelService.getUriLabel(conflicts[0], { relative: true })
|
|
226
222
|
));
|
|
227
223
|
}
|
|
228
224
|
else {
|
|
229
225
|
message = ( localizeWithPath(
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
_moduleId,
|
|
227
|
+
4,
|
|
232
228
|
"Cannot apply refactoring because {0} other files have changed in the meantime.",
|
|
233
229
|
conflicts.length
|
|
234
230
|
));
|
|
@@ -303,7 +299,7 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
303
299
|
}
|
|
304
300
|
}
|
|
305
301
|
};
|
|
306
|
-
const multiDiffSource = ( URI.from({ scheme: BulkEditPane_1.Schema }));
|
|
302
|
+
const multiDiffSource = ( (URI.from({ scheme: BulkEditPane_1.Schema })));
|
|
307
303
|
const label = 'Refactor Preview';
|
|
308
304
|
this._editorService.openEditor({
|
|
309
305
|
multiDiffSource,
|
|
@@ -322,22 +318,23 @@ let BulkEditPane = class BulkEditPane extends ViewPane {
|
|
|
322
318
|
});
|
|
323
319
|
}
|
|
324
320
|
};
|
|
325
|
-
BulkEditPane = BulkEditPane_1 = ( __decorate([
|
|
326
|
-
( __param(1, IInstantiationService)),
|
|
327
|
-
( __param(2, IEditorService)),
|
|
328
|
-
( __param(3, ILabelService)),
|
|
329
|
-
( __param(4, ITextModelService)),
|
|
330
|
-
( __param(5, IDialogService)),
|
|
331
|
-
( __param(6, IContextMenuService)),
|
|
332
|
-
( __param(7, IStorageService)),
|
|
333
|
-
( __param(8, IContextKeyService)),
|
|
334
|
-
( __param(9, IViewDescriptorService)),
|
|
335
|
-
( __param(10, IKeybindingService)),
|
|
336
|
-
( __param(11, IContextMenuService)),
|
|
337
|
-
( __param(12, IConfigurationService)),
|
|
338
|
-
( __param(13, IOpenerService)),
|
|
339
|
-
( __param(14, IThemeService)),
|
|
340
|
-
( __param(15, ITelemetryService))
|
|
341
|
-
|
|
321
|
+
BulkEditPane = BulkEditPane_1 = ( (__decorate([
|
|
322
|
+
( (__param(1, IInstantiationService))),
|
|
323
|
+
( (__param(2, IEditorService))),
|
|
324
|
+
( (__param(3, ILabelService))),
|
|
325
|
+
( (__param(4, ITextModelService))),
|
|
326
|
+
( (__param(5, IDialogService))),
|
|
327
|
+
( (__param(6, IContextMenuService))),
|
|
328
|
+
( (__param(7, IStorageService))),
|
|
329
|
+
( (__param(8, IContextKeyService))),
|
|
330
|
+
( (__param(9, IViewDescriptorService))),
|
|
331
|
+
( (__param(10, IKeybindingService))),
|
|
332
|
+
( (__param(11, IContextMenuService))),
|
|
333
|
+
( (__param(12, IConfigurationService))),
|
|
334
|
+
( (__param(13, IOpenerService))),
|
|
335
|
+
( (__param(14, IThemeService))),
|
|
336
|
+
( (__param(15, ITelemetryService))),
|
|
337
|
+
( (__param(16, IHoverService)))
|
|
338
|
+
], BulkEditPane)));
|
|
342
339
|
|
|
343
340
|
export { BulkEditPane };
|
|
@@ -22,11 +22,12 @@ import { SnippetParser } from 'vscode/vscode/vs/editor/contrib/snippet/browser/s
|
|
|
22
22
|
import { MicrotaskDelay } from 'vscode/vscode/vs/base/common/symbols';
|
|
23
23
|
|
|
24
24
|
var BulkFileOperations_1, BulkEditPreviewProvider_1;
|
|
25
|
+
const _moduleId = "vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview";
|
|
25
26
|
class CheckedStates {
|
|
26
27
|
constructor() {
|
|
27
|
-
this._states = ( new WeakMap());
|
|
28
|
+
this._states = ( (new WeakMap()));
|
|
28
29
|
this._checkedCount = 0;
|
|
29
|
-
this._onDidChange = ( new Emitter());
|
|
30
|
+
this._onDidChange = ( (new Emitter()));
|
|
30
31
|
this.onDidChange = this._onDidChange.event;
|
|
31
32
|
}
|
|
32
33
|
dispose() {
|
|
@@ -72,13 +73,13 @@ class BulkFileOperation {
|
|
|
72
73
|
this.parent = parent;
|
|
73
74
|
this.type = 0;
|
|
74
75
|
this.textEdits = [];
|
|
75
|
-
this.originalEdits = ( new Map());
|
|
76
|
+
this.originalEdits = ( (new Map()));
|
|
76
77
|
}
|
|
77
78
|
addEdit(index, type, edit) {
|
|
78
79
|
this.type |= type;
|
|
79
80
|
this.originalEdits.set(index, edit);
|
|
80
81
|
if (edit instanceof ResourceTextEdit) {
|
|
81
|
-
this.textEdits.push(( new BulkTextEdit(this, edit)));
|
|
82
|
+
this.textEdits.push(( (new BulkTextEdit(this, edit))));
|
|
82
83
|
}
|
|
83
84
|
else if (type === 8 ) {
|
|
84
85
|
this.newUri = edit.newResource;
|
|
@@ -94,24 +95,22 @@ class BulkFileOperation {
|
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
class BulkCategory {
|
|
97
|
-
static { this._defaultMetadata = ( Object.freeze({
|
|
98
|
-
label: ( localizeWithPath(
|
|
99
|
-
'vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview',
|
|
100
|
-
'default',
|
|
101
|
-
"Other"
|
|
102
|
-
)),
|
|
98
|
+
static { this._defaultMetadata = ( (Object.freeze({
|
|
99
|
+
label: ( localizeWithPath(_moduleId, 0, "Other")),
|
|
103
100
|
icon: Codicon.symbolFile,
|
|
104
101
|
needsConfirmation: false
|
|
105
|
-
})); }
|
|
102
|
+
}))); }
|
|
106
103
|
static keyOf(metadata) {
|
|
107
104
|
return metadata?.label || '<default>';
|
|
108
105
|
}
|
|
109
106
|
constructor(metadata = BulkCategory._defaultMetadata) {
|
|
110
107
|
this.metadata = metadata;
|
|
111
|
-
this.operationByResource = ( new Map());
|
|
108
|
+
this.operationByResource = ( (new Map()));
|
|
112
109
|
}
|
|
113
110
|
get fileOperations() {
|
|
114
|
-
return (
|
|
111
|
+
return (
|
|
112
|
+
(this.operationByResource.values())
|
|
113
|
+
);
|
|
115
114
|
}
|
|
116
115
|
}
|
|
117
116
|
let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
@@ -122,7 +121,7 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
122
121
|
constructor(_bulkEdit, _fileService, instaService) {
|
|
123
122
|
this._bulkEdit = _bulkEdit;
|
|
124
123
|
this._fileService = _fileService;
|
|
125
|
-
this.checked = ( new CheckedStates());
|
|
124
|
+
this.checked = ( (new CheckedStates()));
|
|
126
125
|
this.fileOperations = [];
|
|
127
126
|
this.categories = [];
|
|
128
127
|
this.conflicts = instaService.createInstance(ConflictDetector, _bulkEdit);
|
|
@@ -132,9 +131,9 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
132
131
|
this.conflicts.dispose();
|
|
133
132
|
}
|
|
134
133
|
async _init() {
|
|
135
|
-
const operationByResource = ( new Map());
|
|
136
|
-
const operationByCategory = ( new Map());
|
|
137
|
-
const newToOldUri = ( new ResourceMap());
|
|
134
|
+
const operationByResource = ( (new Map()));
|
|
135
|
+
const operationByCategory = ( (new Map()));
|
|
136
|
+
const newToOldUri = ( (new ResourceMap()));
|
|
138
137
|
for (let idx = 0; idx < this._bulkEdit.length; idx++) {
|
|
139
138
|
const edit = this._bulkEdit[idx];
|
|
140
139
|
let uri;
|
|
@@ -177,13 +176,13 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
177
176
|
const insert = (uri, map) => {
|
|
178
177
|
let key = extUri.getComparisonKey(uri, true);
|
|
179
178
|
let operation = map.get(key);
|
|
180
|
-
if (!operation && ( newToOldUri.has(uri))) {
|
|
179
|
+
if (!operation && ( (newToOldUri.has(uri)))) {
|
|
181
180
|
uri = newToOldUri.get(uri);
|
|
182
181
|
key = extUri.getComparisonKey(uri, true);
|
|
183
182
|
operation = map.get(key);
|
|
184
183
|
}
|
|
185
184
|
if (!operation) {
|
|
186
|
-
operation = ( new BulkFileOperation(uri, this));
|
|
185
|
+
operation = ( (new BulkFileOperation(uri, this)));
|
|
187
186
|
map.set(key, operation);
|
|
188
187
|
}
|
|
189
188
|
operation.addEdit(idx, type, edit);
|
|
@@ -192,7 +191,7 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
192
191
|
const key = BulkCategory.keyOf(edit.metadata);
|
|
193
192
|
let category = operationByCategory.get(key);
|
|
194
193
|
if (!category) {
|
|
195
|
-
category = ( new BulkCategory(edit.metadata));
|
|
194
|
+
category = ( (new BulkCategory(edit.metadata)));
|
|
196
195
|
operationByCategory.set(key, category);
|
|
197
196
|
}
|
|
198
197
|
insert(uri, category.operationByResource);
|
|
@@ -202,13 +201,13 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
202
201
|
for (const file of this.fileOperations) {
|
|
203
202
|
if (file.type !== 1 ) {
|
|
204
203
|
let checked = true;
|
|
205
|
-
for (const edit of ( file.originalEdits.values())) {
|
|
204
|
+
for (const edit of ( (file.originalEdits.values()))) {
|
|
206
205
|
if (edit instanceof ResourceFileEdit) {
|
|
207
206
|
checked = checked && this.checked.isChecked(edit);
|
|
208
207
|
}
|
|
209
208
|
}
|
|
210
209
|
if (!checked) {
|
|
211
|
-
for (const edit of ( file.originalEdits.values())) {
|
|
210
|
+
for (const edit of ( (file.originalEdits.values()))) {
|
|
212
211
|
this.checked.updateChecked(edit, checked);
|
|
213
212
|
}
|
|
214
213
|
}
|
|
@@ -246,10 +245,10 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
246
245
|
}
|
|
247
246
|
getFileEdits(uri) {
|
|
248
247
|
for (const file of this.fileOperations) {
|
|
249
|
-
if (( file.uri.toString()) === ( uri.toString())) {
|
|
248
|
+
if (( (file.uri.toString())) === ( (uri.toString()))) {
|
|
250
249
|
const result = [];
|
|
251
250
|
let ignoreAll = false;
|
|
252
|
-
for (const edit of ( file.originalEdits.values())) {
|
|
251
|
+
for (const edit of ( (file.originalEdits.values()))) {
|
|
253
252
|
if (edit instanceof ResourceTextEdit) {
|
|
254
253
|
if (this.checked.isChecked(edit)) {
|
|
255
254
|
result.push(EditOperation.replaceMove(Range.lift(edit.textEdit.range), !edit.textEdit.insertAsSnippet ? edit.textEdit.text : SnippetParser.asInsertText(edit.textEdit.text)));
|
|
@@ -269,33 +268,35 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
269
268
|
}
|
|
270
269
|
getUriOfEdit(edit) {
|
|
271
270
|
for (const file of this.fileOperations) {
|
|
272
|
-
for (const value of ( file.originalEdits.values())) {
|
|
271
|
+
for (const value of ( (file.originalEdits.values()))) {
|
|
273
272
|
if (value === edit) {
|
|
274
273
|
return file.uri;
|
|
275
274
|
}
|
|
276
275
|
}
|
|
277
276
|
}
|
|
278
|
-
throw new Error('invalid edit');
|
|
277
|
+
throw ( (new Error('invalid edit')));
|
|
279
278
|
}
|
|
280
279
|
};
|
|
281
|
-
BulkFileOperations = BulkFileOperations_1 = ( __decorate([
|
|
282
|
-
( __param(1, IFileService)),
|
|
283
|
-
( __param(2, IInstantiationService))
|
|
284
|
-
], BulkFileOperations));
|
|
280
|
+
BulkFileOperations = BulkFileOperations_1 = ( (__decorate([
|
|
281
|
+
( (__param(1, IFileService))),
|
|
282
|
+
( (__param(2, IInstantiationService)))
|
|
283
|
+
], BulkFileOperations)));
|
|
285
284
|
let BulkEditPreviewProvider = class BulkEditPreviewProvider {
|
|
286
285
|
static { BulkEditPreviewProvider_1 = this; }
|
|
287
286
|
static { this.Schema = 'vscode-bulkeditpreview-editor'; }
|
|
288
|
-
static { this.emptyPreview = ( URI.from({ scheme: BulkEditPreviewProvider_1.Schema, fragment: 'empty' })); }
|
|
287
|
+
static { this.emptyPreview = ( (URI.from({ scheme: BulkEditPreviewProvider_1.Schema, fragment: 'empty' }))); }
|
|
289
288
|
static fromPreviewUri(uri) {
|
|
290
|
-
return (
|
|
289
|
+
return (
|
|
290
|
+
(URI.parse(uri.query))
|
|
291
|
+
);
|
|
291
292
|
}
|
|
292
293
|
constructor(_operations, _languageService, _modelService, _textModelResolverService) {
|
|
293
294
|
this._operations = _operations;
|
|
294
295
|
this._languageService = _languageService;
|
|
295
296
|
this._modelService = _modelService;
|
|
296
297
|
this._textModelResolverService = _textModelResolverService;
|
|
297
|
-
this._disposables = ( new DisposableStore());
|
|
298
|
-
this._modelPreviewEdits = ( new Map());
|
|
298
|
+
this._disposables = ( (new DisposableStore()));
|
|
299
|
+
this._modelPreviewEdits = ( (new Map()));
|
|
299
300
|
this._instanceId = generateUuid();
|
|
300
301
|
this._disposables.add(this._textModelResolverService.registerTextModelContentProvider(BulkEditPreviewProvider_1.Schema, this));
|
|
301
302
|
this._ready = this._init();
|
|
@@ -304,9 +305,11 @@ let BulkEditPreviewProvider = class BulkEditPreviewProvider {
|
|
|
304
305
|
this._disposables.dispose();
|
|
305
306
|
}
|
|
306
307
|
asPreviewUri(uri) {
|
|
307
|
-
return (
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
return (
|
|
309
|
+
(URI.from(
|
|
310
|
+
{ scheme: BulkEditPreviewProvider_1.Schema, authority: this._instanceId, path: uri.path, query: ( (uri.toString())) }
|
|
311
|
+
))
|
|
312
|
+
);
|
|
310
313
|
}
|
|
311
314
|
async _init() {
|
|
312
315
|
for (const operation of this._operations.fileOperations) {
|
|
@@ -347,17 +350,17 @@ let BulkEditPreviewProvider = class BulkEditPreviewProvider {
|
|
|
347
350
|
return model;
|
|
348
351
|
}
|
|
349
352
|
async provideTextContent(previewUri) {
|
|
350
|
-
if (( previewUri.toString()) === ( BulkEditPreviewProvider_1.emptyPreview.toString())) {
|
|
353
|
+
if (( (previewUri.toString())) === ( (BulkEditPreviewProvider_1.emptyPreview.toString()))) {
|
|
351
354
|
return this._modelService.createModel('', null, previewUri);
|
|
352
355
|
}
|
|
353
356
|
await this._ready;
|
|
354
357
|
return this._modelService.getModel(previewUri);
|
|
355
358
|
}
|
|
356
359
|
};
|
|
357
|
-
BulkEditPreviewProvider = BulkEditPreviewProvider_1 = ( __decorate([
|
|
358
|
-
( __param(1, ILanguageService)),
|
|
359
|
-
( __param(2, IModelService)),
|
|
360
|
-
( __param(3, ITextModelService))
|
|
361
|
-
], BulkEditPreviewProvider));
|
|
360
|
+
BulkEditPreviewProvider = BulkEditPreviewProvider_1 = ( (__decorate([
|
|
361
|
+
( (__param(1, ILanguageService))),
|
|
362
|
+
( (__param(2, IModelService))),
|
|
363
|
+
( (__param(3, ITextModelService)))
|
|
364
|
+
], BulkEditPreviewProvider)));
|
|
362
365
|
|
|
363
366
|
export { BulkCategory, BulkEditPreviewProvider, BulkFileOperation, BulkFileOperations, BulkTextEdit, CheckedStates };
|