@codingame/monaco-vscode-bulk-edit-service-override 37.2.0 → 37.3.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.
@@ -1,630 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
4
- import { createMatches } from '@codingame/monaco-vscode-api/vscode/vs/base/common/filters';
5
- import { HighlightedLabel } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/highlightedlabel/highlightedLabel';
6
- import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
7
- import { Checkbox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toggle/toggle';
8
- import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
9
- import { TextModel } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
10
- import { BulkFileOperationType, BulkFileOperations } from './bulkEditPreview.js';
11
- import { FileKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
12
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
13
- import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
14
- import { IconLabel } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabel';
15
- import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
16
- import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
17
- import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
18
- import { compare } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
19
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
20
- import { ResourceFileEdit } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/bulkEditService';
21
- import { PLAINTEXT_LANGUAGE_ID } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/modesRegistry';
22
- import { SnippetParser } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/snippet/browser/snippetParser';
23
- import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
24
- import { asCSSUrl } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/cssValue';
25
- import { defaultCheckboxStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
26
- import { createElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
27
-
28
- var CategoryElementRenderer_1, FileElementRenderer_1, TextEditElementRenderer_1;
29
- class CategoryElement {
30
- constructor(parent, category) {
31
- this.parent = parent;
32
- this.category = category;
33
- }
34
- isChecked() {
35
- const model = this.parent;
36
- let checked = true;
37
- for (const file of this.category.fileOperations) {
38
- for (const edit of ( file.originalEdits.values())) {
39
- checked = checked && model.checked.isChecked(edit);
40
- }
41
- }
42
- return checked;
43
- }
44
- setChecked(value) {
45
- const model = this.parent;
46
- for (const file of this.category.fileOperations) {
47
- for (const edit of ( file.originalEdits.values())) {
48
- model.checked.updateChecked(edit, value);
49
- }
50
- }
51
- }
52
- }
53
- class FileElement {
54
- constructor(parent, edit) {
55
- this.parent = parent;
56
- this.edit = edit;
57
- }
58
- isChecked() {
59
- const model = this.parent instanceof CategoryElement ? this.parent.parent : this.parent;
60
- let checked = true;
61
- if (this.edit.type === BulkFileOperationType.TextEdit) {
62
- checked = !this.edit.textEdits.every(edit => !model.checked.isChecked(edit.textEdit));
63
- }
64
- for (const edit of ( this.edit.originalEdits.values())) {
65
- if (edit instanceof ResourceFileEdit) {
66
- checked = checked && model.checked.isChecked(edit);
67
- }
68
- }
69
- if (this.parent instanceof CategoryElement && this.edit.type === BulkFileOperationType.TextEdit) {
70
- for (const category of model.categories) {
71
- for (const file of category.fileOperations) {
72
- if (( file.uri.toString()) === ( this.edit.uri.toString())) {
73
- for (const edit of ( file.originalEdits.values())) {
74
- if (edit instanceof ResourceFileEdit) {
75
- checked = checked && model.checked.isChecked(edit);
76
- }
77
- }
78
- }
79
- }
80
- }
81
- }
82
- return checked;
83
- }
84
- setChecked(value) {
85
- const model = this.parent instanceof CategoryElement ? this.parent.parent : this.parent;
86
- for (const edit of ( this.edit.originalEdits.values())) {
87
- model.checked.updateChecked(edit, value);
88
- }
89
- if (this.parent instanceof CategoryElement && this.edit.type !== BulkFileOperationType.TextEdit) {
90
- for (const category of model.categories) {
91
- for (const file of category.fileOperations) {
92
- if (( file.uri.toString()) === ( this.edit.uri.toString())) {
93
- for (const edit of ( file.originalEdits.values())) {
94
- model.checked.updateChecked(edit, value);
95
- }
96
- }
97
- }
98
- }
99
- }
100
- }
101
- isDisabled() {
102
- if (this.parent instanceof CategoryElement && this.edit.type === BulkFileOperationType.TextEdit) {
103
- const model = this.parent.parent;
104
- let checked = true;
105
- for (const category of model.categories) {
106
- for (const file of category.fileOperations) {
107
- if (( file.uri.toString()) === ( this.edit.uri.toString())) {
108
- for (const edit of ( file.originalEdits.values())) {
109
- if (edit instanceof ResourceFileEdit) {
110
- checked = checked && model.checked.isChecked(edit);
111
- }
112
- }
113
- }
114
- }
115
- }
116
- return !checked;
117
- }
118
- return false;
119
- }
120
- }
121
- class TextEditElement {
122
- constructor(parent, idx, edit, prefix, selecting, inserting, suffix) {
123
- this.parent = parent;
124
- this.idx = idx;
125
- this.edit = edit;
126
- this.prefix = prefix;
127
- this.selecting = selecting;
128
- this.inserting = inserting;
129
- this.suffix = suffix;
130
- }
131
- isChecked() {
132
- let model = this.parent.parent;
133
- if (model instanceof CategoryElement) {
134
- model = model.parent;
135
- }
136
- return model.checked.isChecked(this.edit.textEdit);
137
- }
138
- setChecked(value) {
139
- let model = this.parent.parent;
140
- if (model instanceof CategoryElement) {
141
- model = model.parent;
142
- }
143
- model.checked.updateChecked(this.edit.textEdit, value);
144
- if (value) {
145
- for (const edit of ( this.parent.edit.originalEdits.values())) {
146
- if (edit instanceof ResourceFileEdit) {
147
- model.checked.updateChecked(edit, value);
148
- }
149
- }
150
- }
151
- }
152
- isDisabled() {
153
- return this.parent.isDisabled();
154
- }
155
- }
156
- let BulkEditDataSource = class BulkEditDataSource {
157
- constructor(_textModelService, _instantiationService) {
158
- this._textModelService = _textModelService;
159
- this._instantiationService = _instantiationService;
160
- this.groupByFile = true;
161
- }
162
- hasChildren(element) {
163
- if (element instanceof FileElement) {
164
- return element.edit.textEdits.length > 0;
165
- }
166
- if (element instanceof TextEditElement) {
167
- return false;
168
- }
169
- return true;
170
- }
171
- async getChildren(element) {
172
- if (element instanceof BulkFileOperations) {
173
- return this.groupByFile ? ( element.fileOperations.map(op => ( new FileElement(element, op)))) : ( element.categories.map(cat => ( new CategoryElement(element, cat))));
174
- }
175
- if (element instanceof CategoryElement) {
176
- return Array.from(element.category.fileOperations, op => ( new FileElement(element, op)));
177
- }
178
- if (element instanceof FileElement && element.edit.textEdits.length > 0) {
179
- let textModel;
180
- let textModelDisposable;
181
- try {
182
- const ref = await this._textModelService.createModelReference(element.edit.uri);
183
- textModel = ref.object.textEditorModel;
184
- textModelDisposable = ref;
185
- } catch {
186
- textModel = this._instantiationService.createInstance(
187
- TextModel,
188
- "",
189
- PLAINTEXT_LANGUAGE_ID,
190
- TextModel.DEFAULT_CREATION_OPTIONS,
191
- null
192
- );
193
- textModelDisposable = textModel;
194
- }
195
- const result = ( element.edit.textEdits.map((edit, idx) => {
196
- const range = textModel.validateRange(edit.textEdit.textEdit.range);
197
- const startTokens = textModel.tokenization.getLineTokens(range.startLineNumber);
198
- let prefixLen = 23;
199
- for (let idx = startTokens.findTokenIndexAtOffset(range.startColumn - 1) - 1; prefixLen < 50 && idx >= 0; idx--) {
200
- prefixLen = range.startColumn - startTokens.getStartOffset(idx);
201
- }
202
- const endTokens = textModel.tokenization.getLineTokens(range.endLineNumber);
203
- let suffixLen = 0;
204
- for (let idx = endTokens.findTokenIndexAtOffset(range.endColumn - 1); suffixLen < 50 && idx < endTokens.getCount(); idx++) {
205
- suffixLen += endTokens.getEndOffset(idx) - endTokens.getStartOffset(idx);
206
- }
207
- return ( new TextEditElement(element, idx, edit, textModel.getValueInRange(( new Range(
208
- range.startLineNumber,
209
- range.startColumn - prefixLen,
210
- range.startLineNumber,
211
- range.startColumn
212
- ))), textModel.getValueInRange(range), !edit.textEdit.textEdit.insertAsSnippet ? edit.textEdit.textEdit.text : SnippetParser.asInsertText(edit.textEdit.textEdit.text), textModel.getValueInRange(( new Range(
213
- range.endLineNumber,
214
- range.endColumn,
215
- range.endLineNumber,
216
- range.endColumn + suffixLen
217
- )))));
218
- }));
219
- textModelDisposable.dispose();
220
- return result;
221
- }
222
- return [];
223
- }
224
- };
225
- BulkEditDataSource = ( __decorate([( __param(0, ITextModelService)), ( __param(1, IInstantiationService))], BulkEditDataSource));
226
- class BulkEditSorter {
227
- compare(a, b) {
228
- if (a instanceof FileElement && b instanceof FileElement) {
229
- return compareBulkFileOperations(a.edit, b.edit);
230
- }
231
- if (a instanceof TextEditElement && b instanceof TextEditElement) {
232
- return Range.compareRangesUsingStarts(a.edit.textEdit.textEdit.range, b.edit.textEdit.textEdit.range);
233
- }
234
- return 0;
235
- }
236
- }
237
- function compareBulkFileOperations(a, b) {
238
- return compare(( a.uri.toString()), ( b.uri.toString()));
239
- }
240
- let BulkEditAccessibilityProvider = class BulkEditAccessibilityProvider {
241
- constructor(_labelService) {
242
- this._labelService = _labelService;
243
- }
244
- getWidgetAriaLabel() {
245
- return localize(5393, "Bulk Edit");
246
- }
247
- getRole(_element) {
248
- return "checkbox";
249
- }
250
- getAriaLabel(element) {
251
- if (element instanceof FileElement) {
252
- if (element.edit.textEdits.length > 0) {
253
- if (element.edit.type & BulkFileOperationType.Rename && element.edit.newUri) {
254
- return localize(
255
- 5394,
256
- "Renaming {0} to {1}, also making text edits",
257
- this._labelService.getUriLabel(element.edit.uri, {
258
- relative: true
259
- }),
260
- this._labelService.getUriLabel(element.edit.newUri, {
261
- relative: true
262
- })
263
- );
264
- } else if (element.edit.type & BulkFileOperationType.Create) {
265
- return localize(
266
- 5395,
267
- "Creating {0}, also making text edits",
268
- this._labelService.getUriLabel(element.edit.uri, {
269
- relative: true
270
- })
271
- );
272
- } else if (element.edit.type & BulkFileOperationType.Delete) {
273
- return localize(
274
- 5396,
275
- "Deleting {0}, also making text edits",
276
- this._labelService.getUriLabel(element.edit.uri, {
277
- relative: true
278
- })
279
- );
280
- } else {
281
- return localize(
282
- 5397,
283
- "{0}, making text edits",
284
- this._labelService.getUriLabel(element.edit.uri, {
285
- relative: true
286
- })
287
- );
288
- }
289
- } else {
290
- if (element.edit.type & BulkFileOperationType.Rename && element.edit.newUri) {
291
- return localize(
292
- 5398,
293
- "Renaming {0} to {1}",
294
- this._labelService.getUriLabel(element.edit.uri, {
295
- relative: true
296
- }),
297
- this._labelService.getUriLabel(element.edit.newUri, {
298
- relative: true
299
- })
300
- );
301
- } else if (element.edit.type & BulkFileOperationType.Create) {
302
- return localize(5399, "Creating {0}", this._labelService.getUriLabel(element.edit.uri, {
303
- relative: true
304
- }));
305
- } else if (element.edit.type & BulkFileOperationType.Delete) {
306
- return localize(5400, "Deleting {0}", this._labelService.getUriLabel(element.edit.uri, {
307
- relative: true
308
- }));
309
- }
310
- }
311
- }
312
- if (element instanceof TextEditElement) {
313
- if (element.selecting.length > 0 && element.inserting.length > 0) {
314
- return localize(
315
- 5401,
316
- "line {0}, replacing {1} with {2}",
317
- element.edit.textEdit.textEdit.range.startLineNumber,
318
- element.selecting,
319
- element.inserting
320
- );
321
- } else if (element.selecting.length > 0 && element.inserting.length === 0) {
322
- return localize(
323
- 5402,
324
- "line {0}, removing {1}",
325
- element.edit.textEdit.textEdit.range.startLineNumber,
326
- element.selecting
327
- );
328
- } else if (element.selecting.length === 0 && element.inserting.length > 0) {
329
- return localize(
330
- 5403,
331
- "line {0}, inserting {1}",
332
- element.edit.textEdit.textEdit.range.startLineNumber,
333
- element.selecting
334
- );
335
- }
336
- }
337
- return null;
338
- }
339
- };
340
- BulkEditAccessibilityProvider = ( __decorate([( __param(0, ILabelService))], BulkEditAccessibilityProvider));
341
- class BulkEditIdentityProvider {
342
- getId(element) {
343
- if (element instanceof FileElement) {
344
- return element.edit.uri + (element.parent instanceof CategoryElement ? JSON.stringify(element.parent.category.metadata) : "");
345
- } else if (element instanceof TextEditElement) {
346
- return ( element.parent.edit.uri.toString()) + element.idx;
347
- } else {
348
- return JSON.stringify(element.category.metadata);
349
- }
350
- }
351
- }
352
- class CategoryElementTemplate {
353
- constructor(container) {
354
- container.classList.add("category");
355
- this.icon = createElement("div");
356
- container.appendChild(this.icon);
357
- this.label = ( new IconLabel(container));
358
- }
359
- }
360
- let CategoryElementRenderer = class CategoryElementRenderer {
361
- static {
362
- CategoryElementRenderer_1 = this;
363
- }
364
- static {
365
- this.id = "CategoryElementRenderer";
366
- }
367
- constructor(_themeService) {
368
- this._themeService = _themeService;
369
- this.templateId = CategoryElementRenderer_1.id;
370
- }
371
- renderTemplate(container) {
372
- return ( new CategoryElementTemplate(container));
373
- }
374
- renderElement(node, _index, template) {
375
- template.icon.style.setProperty("--background-dark", null);
376
- template.icon.style.setProperty("--background-light", null);
377
- template.icon.style.color = "";
378
- const {
379
- metadata
380
- } = node.element.category;
381
- if (ThemeIcon.isThemeIcon(metadata.iconPath)) {
382
- const className = ThemeIcon.asClassName(metadata.iconPath);
383
- template.icon.className = className ? `theme-icon ${className}` : "";
384
- template.icon.style.color = metadata.iconPath.color ? this._themeService.getColorTheme().getColor(metadata.iconPath.color.id)?.toString() ?? "" : "";
385
- } else if (URI.isUri(metadata.iconPath)) {
386
- template.icon.className = "uri-icon";
387
- template.icon.style.setProperty("--background-dark", asCSSUrl(metadata.iconPath));
388
- template.icon.style.setProperty("--background-light", asCSSUrl(metadata.iconPath));
389
- } else if (metadata.iconPath) {
390
- template.icon.className = "uri-icon";
391
- template.icon.style.setProperty("--background-dark", asCSSUrl(metadata.iconPath.dark));
392
- template.icon.style.setProperty("--background-light", asCSSUrl(metadata.iconPath.light));
393
- }
394
- template.label.setLabel(metadata.label, metadata.description, {
395
- descriptionMatches: createMatches(node.filterData)
396
- });
397
- }
398
- disposeTemplate(template) {
399
- template.label.dispose();
400
- }
401
- };
402
- CategoryElementRenderer = CategoryElementRenderer_1 = ( __decorate([( __param(0, IThemeService))], CategoryElementRenderer));
403
- let FileElementTemplate = class FileElementTemplate {
404
- constructor(container, resourceLabels, _labelService) {
405
- this._labelService = _labelService;
406
- this._disposables = ( new DisposableStore());
407
- this._localDisposables = ( new DisposableStore());
408
- this._checkbox = this._disposables.add(( new Checkbox("", false, defaultCheckboxStyles)));
409
- this._checkbox.domNode.classList.add("edit-checkbox");
410
- this._checkbox.domNode.tabIndex = -1;
411
- container.appendChild(this._checkbox.domNode);
412
- this._label = resourceLabels.create(container, {
413
- supportHighlights: true
414
- });
415
- this._details = createElement("span");
416
- this._details.className = "details";
417
- container.appendChild(this._details);
418
- }
419
- dispose() {
420
- this._localDisposables.dispose();
421
- this._disposables.dispose();
422
- this._label.dispose();
423
- }
424
- set(element, score) {
425
- this._localDisposables.clear();
426
- this._checkbox.checked = element.isChecked();
427
- if (element.isDisabled()) {
428
- this._checkbox.disable();
429
- } else {
430
- this._checkbox.enable();
431
- }
432
- this._checkbox.domNode.tabIndex = -1;
433
- this._localDisposables.add(this._checkbox.onChange(() => {
434
- element.setChecked(this._checkbox.checked);
435
- }));
436
- if (element.edit.type & BulkFileOperationType.Rename && element.edit.newUri) {
437
- this._label.setResource({
438
- resource: element.edit.uri,
439
- name: ( localize(5404, "{0} → {1}", this._labelService.getUriLabel(element.edit.uri, {
440
- relative: true
441
- }), this._labelService.getUriLabel(element.edit.newUri, {
442
- relative: true
443
- })))
444
- }, {
445
- fileDecorations: {
446
- colors: true,
447
- badges: false
448
- }
449
- });
450
- this._details.innerText = ( localize(5405, "(renaming)"));
451
- } else {
452
- const options = {
453
- matches: createMatches(score),
454
- fileKind: FileKind.FILE,
455
- fileDecorations: {
456
- colors: true,
457
- badges: false
458
- },
459
- extraClasses: []
460
- };
461
- if (element.edit.type & BulkFileOperationType.Create) {
462
- this._details.innerText = ( localize(5406, "(creating)"));
463
- } else if (element.edit.type & BulkFileOperationType.Delete) {
464
- this._details.innerText = ( localize(5407, "(deleting)"));
465
- options.extraClasses.push("delete");
466
- } else {
467
- this._details.innerText = "";
468
- }
469
- this._label.setFile(element.edit.uri, options);
470
- }
471
- }
472
- };
473
- FileElementTemplate = ( __decorate([( __param(2, ILabelService))], FileElementTemplate));
474
- let FileElementRenderer = class FileElementRenderer {
475
- static {
476
- FileElementRenderer_1 = this;
477
- }
478
- static {
479
- this.id = "FileElementRenderer";
480
- }
481
- constructor(_resourceLabels, _labelService) {
482
- this._resourceLabels = _resourceLabels;
483
- this._labelService = _labelService;
484
- this.templateId = FileElementRenderer_1.id;
485
- }
486
- renderTemplate(container) {
487
- return ( new FileElementTemplate(container, this._resourceLabels, this._labelService));
488
- }
489
- renderElement(node, _index, template) {
490
- template.set(node.element, node.filterData);
491
- }
492
- disposeTemplate(template) {
493
- template.dispose();
494
- }
495
- };
496
- FileElementRenderer = FileElementRenderer_1 = ( __decorate([( __param(1, ILabelService))], FileElementRenderer));
497
- let TextEditElementTemplate = class TextEditElementTemplate {
498
- constructor(container, _themeService) {
499
- this._themeService = _themeService;
500
- this._disposables = ( new DisposableStore());
501
- this._localDisposables = ( new DisposableStore());
502
- container.classList.add("textedit");
503
- this._checkbox = this._disposables.add(( new Checkbox("", false, defaultCheckboxStyles)));
504
- this._checkbox.domNode.classList.add("edit-checkbox");
505
- this._checkbox.domNode.tabIndex = -1;
506
- container.appendChild(this._checkbox.domNode);
507
- this._icon = createElement("div");
508
- container.appendChild(this._icon);
509
- this._label = this._disposables.add(( new HighlightedLabel(container)));
510
- }
511
- dispose() {
512
- this._localDisposables.dispose();
513
- this._disposables.dispose();
514
- }
515
- set(element) {
516
- this._localDisposables.clear();
517
- this._localDisposables.add(this._checkbox.onChange(() => {
518
- element.setChecked(this._checkbox.checked);
519
- }));
520
- this._checkbox.checked = element.isChecked();
521
- if (element.isDisabled()) {
522
- this._checkbox.disable();
523
- } else {
524
- this._checkbox.enable();
525
- }
526
- this._checkbox.domNode.tabIndex = -1;
527
- let value = "";
528
- value += element.prefix;
529
- value += element.selecting;
530
- value += element.inserting;
531
- value += element.suffix;
532
- const selectHighlight = {
533
- start: element.prefix.length,
534
- end: element.prefix.length + element.selecting.length,
535
- extraClasses: ["remove"]
536
- };
537
- const insertHighlight = {
538
- start: selectHighlight.end,
539
- end: selectHighlight.end + element.inserting.length,
540
- extraClasses: ["insert"]
541
- };
542
- let title;
543
- const {
544
- metadata
545
- } = element.edit.textEdit;
546
- if (metadata && metadata.description) {
547
- title = ( localize(5408, "{0} - {1}", metadata.label, metadata.description));
548
- } else if (metadata) {
549
- title = metadata.label;
550
- }
551
- const iconPath = metadata?.iconPath;
552
- if (!iconPath) {
553
- this._icon.style.display = "none";
554
- } else {
555
- this._icon.style.display = "block";
556
- this._icon.style.setProperty("--background-dark", null);
557
- this._icon.style.setProperty("--background-light", null);
558
- if (ThemeIcon.isThemeIcon(iconPath)) {
559
- const className = ThemeIcon.asClassName(iconPath);
560
- this._icon.className = className ? `theme-icon ${className}` : "";
561
- this._icon.style.color = iconPath.color ? this._themeService.getColorTheme().getColor(iconPath.color.id)?.toString() ?? "" : "";
562
- } else if (URI.isUri(iconPath)) {
563
- this._icon.className = "uri-icon";
564
- this._icon.style.setProperty("--background-dark", asCSSUrl(iconPath));
565
- this._icon.style.setProperty("--background-light", asCSSUrl(iconPath));
566
- } else {
567
- this._icon.className = "uri-icon";
568
- this._icon.style.setProperty("--background-dark", asCSSUrl(iconPath.dark));
569
- this._icon.style.setProperty("--background-light", asCSSUrl(iconPath.light));
570
- }
571
- }
572
- this._label.set(value, [selectHighlight, insertHighlight], title, true);
573
- this._icon.title = title || "";
574
- }
575
- };
576
- TextEditElementTemplate = ( __decorate([( __param(1, IThemeService))], TextEditElementTemplate));
577
- let TextEditElementRenderer = class TextEditElementRenderer {
578
- static {
579
- TextEditElementRenderer_1 = this;
580
- }
581
- static {
582
- this.id = "TextEditElementRenderer";
583
- }
584
- constructor(_themeService) {
585
- this._themeService = _themeService;
586
- this.templateId = TextEditElementRenderer_1.id;
587
- }
588
- renderTemplate(container) {
589
- return ( new TextEditElementTemplate(container, this._themeService));
590
- }
591
- renderElement(
592
- {
593
- element
594
- },
595
- _index,
596
- template
597
- ) {
598
- template.set(element);
599
- }
600
- disposeTemplate(template) {
601
- template.dispose();
602
- }
603
- };
604
- TextEditElementRenderer = TextEditElementRenderer_1 = ( __decorate([( __param(0, IThemeService))], TextEditElementRenderer));
605
- class BulkEditDelegate {
606
- getHeight() {
607
- return 23;
608
- }
609
- getTemplateId(element) {
610
- if (element instanceof FileElement) {
611
- return FileElementRenderer.id;
612
- } else if (element instanceof TextEditElement) {
613
- return TextEditElementRenderer.id;
614
- } else {
615
- return CategoryElementRenderer.id;
616
- }
617
- }
618
- }
619
- class BulkEditNaviLabelProvider {
620
- getKeyboardNavigationLabel(element) {
621
- if (element instanceof FileElement) {
622
- return basename(element.edit.uri);
623
- } else if (element instanceof CategoryElement) {
624
- return element.category.metadata.label;
625
- }
626
- return undefined;
627
- }
628
- }
629
-
630
- export { BulkEditAccessibilityProvider, BulkEditDataSource, BulkEditDelegate, BulkEditIdentityProvider, BulkEditNaviLabelProvider, BulkEditSorter, CategoryElement, CategoryElementRenderer, FileElement, FileElementRenderer, TextEditElement, TextEditElementRenderer, compareBulkFileOperations };