@codingame/monaco-vscode-bulk-edit-service-override 11.1.2 → 12.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/index.d.ts +2 -1
- package/index.js +14 -1
- package/package.json +23 -7
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +82 -64
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +7 -5
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +2 -1
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/conflicts.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/conflicts.js +3 -2
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/opaqueEdits.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/opaqueEdits.js +67 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution.js +67 -74
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPane.js +65 -60
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.d.ts +87 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditPreview.js +56 -54
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.d.ts +132 -0
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/preview/bulkEditTree.js +112 -119
- package/bulkEdit.js +0 -12
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ITextModelContentProvider, ITextModelService } from "vscode/vscode/vs/editor/common/services/resolverService";
|
|
2
|
+
import { URI } from "vscode/vscode/vs/base/common/uri";
|
|
3
|
+
import { ILanguageService } from "vscode/vscode/vs/editor/common/languages/language";
|
|
4
|
+
import { IModelService } from "vscode/vscode/vs/editor/common/services/model";
|
|
5
|
+
import { WorkspaceEditMetadata } from "vscode/vscode/vs/editor/common/languages";
|
|
6
|
+
import { ISingleEditOperation } from "vscode/vscode/vs/editor/common/core/editOperation";
|
|
7
|
+
import { ServicesAccessor, IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
8
|
+
import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
|
|
9
|
+
import { Event } from "vscode/vscode/vs/base/common/event";
|
|
10
|
+
import { ConflictDetector } from "../conflicts.js";
|
|
11
|
+
import { ResourceEdit, ResourceFileEdit, ResourceTextEdit } from "vscode/vscode/vs/editor/browser/services/bulkEditService";
|
|
12
|
+
export declare class CheckedStates<T extends object> {
|
|
13
|
+
private readonly _states;
|
|
14
|
+
private _checkedCount;
|
|
15
|
+
private readonly _onDidChange;
|
|
16
|
+
readonly onDidChange: Event<T>;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
get checkedCount(): number;
|
|
19
|
+
isChecked(obj: T): boolean;
|
|
20
|
+
updateChecked(obj: T, value: boolean): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class BulkTextEdit {
|
|
23
|
+
readonly parent: BulkFileOperation;
|
|
24
|
+
readonly textEdit: ResourceTextEdit;
|
|
25
|
+
constructor(parent: BulkFileOperation, textEdit: ResourceTextEdit);
|
|
26
|
+
}
|
|
27
|
+
export declare enum BulkFileOperationType {
|
|
28
|
+
TextEdit = 1,
|
|
29
|
+
Create = 2,
|
|
30
|
+
Delete = 4,
|
|
31
|
+
Rename = 8
|
|
32
|
+
}
|
|
33
|
+
export declare class BulkFileOperation {
|
|
34
|
+
readonly uri: URI;
|
|
35
|
+
readonly parent: BulkFileOperations;
|
|
36
|
+
type: number;
|
|
37
|
+
textEdits: BulkTextEdit[];
|
|
38
|
+
originalEdits: Map<number, ResourceTextEdit | ResourceFileEdit>;
|
|
39
|
+
newUri?: URI;
|
|
40
|
+
constructor(uri: URI, parent: BulkFileOperations);
|
|
41
|
+
addEdit(index: number, type: BulkFileOperationType, edit: ResourceTextEdit | ResourceFileEdit): void;
|
|
42
|
+
needsConfirmation(): boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare class BulkCategory {
|
|
45
|
+
readonly metadata: WorkspaceEditMetadata;
|
|
46
|
+
private static readonly _defaultMetadata;
|
|
47
|
+
static keyOf(metadata?: WorkspaceEditMetadata): string;
|
|
48
|
+
readonly operationByResource: Map<string, BulkFileOperation>;
|
|
49
|
+
constructor(metadata?: WorkspaceEditMetadata);
|
|
50
|
+
get fileOperations(): IterableIterator<BulkFileOperation>;
|
|
51
|
+
}
|
|
52
|
+
export declare class BulkFileOperations {
|
|
53
|
+
private readonly _bulkEdit;
|
|
54
|
+
private readonly _fileService;
|
|
55
|
+
static create(accessor: ServicesAccessor, bulkEdit: ResourceEdit[]): Promise<BulkFileOperations>;
|
|
56
|
+
readonly checked: CheckedStates<ResourceEdit>;
|
|
57
|
+
readonly fileOperations: BulkFileOperation[];
|
|
58
|
+
readonly categories: BulkCategory[];
|
|
59
|
+
readonly conflicts: ConflictDetector;
|
|
60
|
+
constructor(_bulkEdit: ResourceEdit[], _fileService: IFileService, instaService: IInstantiationService);
|
|
61
|
+
dispose(): void;
|
|
62
|
+
_init(): Promise<this>;
|
|
63
|
+
getWorkspaceEdit(): ResourceEdit[];
|
|
64
|
+
private getFileEditOperation;
|
|
65
|
+
getFileEdits(uri: URI): Promise<ISingleEditOperation[]>;
|
|
66
|
+
getUriOfEdit(edit: ResourceEdit): URI;
|
|
67
|
+
}
|
|
68
|
+
export declare class BulkEditPreviewProvider implements ITextModelContentProvider {
|
|
69
|
+
private readonly _operations;
|
|
70
|
+
private readonly _languageService;
|
|
71
|
+
private readonly _modelService;
|
|
72
|
+
private readonly _textModelResolverService;
|
|
73
|
+
private static readonly Schema;
|
|
74
|
+
static emptyPreview: URI;
|
|
75
|
+
static fromPreviewUri(uri: URI): URI;
|
|
76
|
+
private readonly _disposables;
|
|
77
|
+
private readonly _ready;
|
|
78
|
+
private readonly _modelPreviewEdits;
|
|
79
|
+
private readonly _instanceId;
|
|
80
|
+
constructor(_operations: BulkFileOperations, _languageService: ILanguageService, _modelService: IModelService, _textModelResolverService: ITextModelService);
|
|
81
|
+
dispose(): void;
|
|
82
|
+
asPreviewUri(uri: URI): URI;
|
|
83
|
+
private _init;
|
|
84
|
+
private _applyTextEditsToPreviewModel;
|
|
85
|
+
private _getOrCreatePreviewModel;
|
|
86
|
+
provideTextContent(previewUri: URI): Promise<import("vscode/vscode/vs/editor/common/model").ITextModel | null>;
|
|
87
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
3
4
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
4
5
|
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
@@ -24,9 +25,9 @@ import { MicrotaskDelay } from 'vscode/vscode/vs/base/common/symbols';
|
|
|
24
25
|
var BulkFileOperations_1, BulkEditPreviewProvider_1;
|
|
25
26
|
class CheckedStates {
|
|
26
27
|
constructor() {
|
|
27
|
-
this._states = (
|
|
28
|
+
this._states = ( new WeakMap());
|
|
28
29
|
this._checkedCount = 0;
|
|
29
|
-
this._onDidChange = (
|
|
30
|
+
this._onDidChange = ( new Emitter());
|
|
30
31
|
this.onDidChange = this._onDidChange.event;
|
|
31
32
|
}
|
|
32
33
|
dispose() {
|
|
@@ -66,21 +67,28 @@ class BulkTextEdit {
|
|
|
66
67
|
this.textEdit = textEdit;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
70
|
+
var BulkFileOperationType;
|
|
71
|
+
(function (BulkFileOperationType) {
|
|
72
|
+
BulkFileOperationType[BulkFileOperationType["TextEdit"] = 1] = "TextEdit";
|
|
73
|
+
BulkFileOperationType[BulkFileOperationType["Create"] = 2] = "Create";
|
|
74
|
+
BulkFileOperationType[BulkFileOperationType["Delete"] = 4] = "Delete";
|
|
75
|
+
BulkFileOperationType[BulkFileOperationType["Rename"] = 8] = "Rename";
|
|
76
|
+
})(BulkFileOperationType || (BulkFileOperationType = {}));
|
|
69
77
|
class BulkFileOperation {
|
|
70
78
|
constructor(uri, parent) {
|
|
71
79
|
this.uri = uri;
|
|
72
80
|
this.parent = parent;
|
|
73
81
|
this.type = 0;
|
|
74
82
|
this.textEdits = [];
|
|
75
|
-
this.originalEdits = (
|
|
83
|
+
this.originalEdits = ( new Map());
|
|
76
84
|
}
|
|
77
85
|
addEdit(index, type, edit) {
|
|
78
86
|
this.type |= type;
|
|
79
87
|
this.originalEdits.set(index, edit);
|
|
80
88
|
if (edit instanceof ResourceTextEdit) {
|
|
81
|
-
this.textEdits.push((
|
|
89
|
+
this.textEdits.push(( new BulkTextEdit(this, edit)));
|
|
82
90
|
}
|
|
83
|
-
else if (type ===
|
|
91
|
+
else if (type === BulkFileOperationType.Rename) {
|
|
84
92
|
this.newUri = edit.newResource;
|
|
85
93
|
}
|
|
86
94
|
}
|
|
@@ -94,22 +102,20 @@ class BulkFileOperation {
|
|
|
94
102
|
}
|
|
95
103
|
}
|
|
96
104
|
class BulkCategory {
|
|
97
|
-
static { this._defaultMetadata = (
|
|
98
|
-
label: ( localize(
|
|
105
|
+
static { this._defaultMetadata = ( Object.freeze({
|
|
106
|
+
label: ( localize(4094, "Other")),
|
|
99
107
|
icon: Codicon.symbolFile,
|
|
100
108
|
needsConfirmation: false
|
|
101
|
-
}))
|
|
109
|
+
})); }
|
|
102
110
|
static keyOf(metadata) {
|
|
103
111
|
return metadata?.label || '<default>';
|
|
104
112
|
}
|
|
105
113
|
constructor(metadata = BulkCategory._defaultMetadata) {
|
|
106
114
|
this.metadata = metadata;
|
|
107
|
-
this.operationByResource = (
|
|
115
|
+
this.operationByResource = ( new Map());
|
|
108
116
|
}
|
|
109
117
|
get fileOperations() {
|
|
110
|
-
return (
|
|
111
|
-
(this.operationByResource.values())
|
|
112
|
-
);
|
|
118
|
+
return ( this.operationByResource.values());
|
|
113
119
|
}
|
|
114
120
|
}
|
|
115
121
|
let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
@@ -120,7 +126,7 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
120
126
|
constructor(_bulkEdit, _fileService, instaService) {
|
|
121
127
|
this._bulkEdit = _bulkEdit;
|
|
122
128
|
this._fileService = _fileService;
|
|
123
|
-
this.checked = (
|
|
129
|
+
this.checked = ( new CheckedStates());
|
|
124
130
|
this.fileOperations = [];
|
|
125
131
|
this.categories = [];
|
|
126
132
|
this.conflicts = instaService.createInstance(ConflictDetector, _bulkEdit);
|
|
@@ -130,21 +136,21 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
130
136
|
this.conflicts.dispose();
|
|
131
137
|
}
|
|
132
138
|
async _init() {
|
|
133
|
-
const operationByResource = (
|
|
134
|
-
const operationByCategory = (
|
|
135
|
-
const newToOldUri = (
|
|
139
|
+
const operationByResource = ( new Map());
|
|
140
|
+
const operationByCategory = ( new Map());
|
|
141
|
+
const newToOldUri = ( new ResourceMap());
|
|
136
142
|
for (let idx = 0; idx < this._bulkEdit.length; idx++) {
|
|
137
143
|
const edit = this._bulkEdit[idx];
|
|
138
144
|
let uri;
|
|
139
145
|
let type;
|
|
140
146
|
this.checked.updateChecked(edit, !edit.metadata?.needsConfirmation);
|
|
141
147
|
if (edit instanceof ResourceTextEdit) {
|
|
142
|
-
type =
|
|
148
|
+
type = BulkFileOperationType.TextEdit;
|
|
143
149
|
uri = edit.resource;
|
|
144
150
|
}
|
|
145
151
|
else if (edit instanceof ResourceFileEdit) {
|
|
146
152
|
if (edit.newResource && edit.oldResource) {
|
|
147
|
-
type =
|
|
153
|
+
type = BulkFileOperationType.Rename;
|
|
148
154
|
uri = edit.oldResource;
|
|
149
155
|
if (edit.options?.overwrite === undefined && edit.options?.ignoreIfExists && (await this._fileService.exists(uri))) {
|
|
150
156
|
continue;
|
|
@@ -152,14 +158,14 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
152
158
|
newToOldUri.set(edit.newResource, uri);
|
|
153
159
|
}
|
|
154
160
|
else if (edit.oldResource) {
|
|
155
|
-
type =
|
|
161
|
+
type = BulkFileOperationType.Delete;
|
|
156
162
|
uri = edit.oldResource;
|
|
157
163
|
if (edit.options?.ignoreIfNotExists && !(await this._fileService.exists(uri))) {
|
|
158
164
|
continue;
|
|
159
165
|
}
|
|
160
166
|
}
|
|
161
167
|
else if (edit.newResource) {
|
|
162
|
-
type =
|
|
168
|
+
type = BulkFileOperationType.Create;
|
|
163
169
|
uri = edit.newResource;
|
|
164
170
|
if (edit.options?.overwrite === undefined && edit.options?.ignoreIfExists && (await this._fileService.exists(uri))) {
|
|
165
171
|
continue;
|
|
@@ -175,13 +181,13 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
175
181
|
const insert = (uri, map) => {
|
|
176
182
|
let key = extUri.getComparisonKey(uri, true);
|
|
177
183
|
let operation = map.get(key);
|
|
178
|
-
if (!operation && (
|
|
184
|
+
if (!operation && ( newToOldUri.has(uri))) {
|
|
179
185
|
uri = newToOldUri.get(uri);
|
|
180
186
|
key = extUri.getComparisonKey(uri, true);
|
|
181
187
|
operation = map.get(key);
|
|
182
188
|
}
|
|
183
189
|
if (!operation) {
|
|
184
|
-
operation = (
|
|
190
|
+
operation = ( new BulkFileOperation(uri, this));
|
|
185
191
|
map.set(key, operation);
|
|
186
192
|
}
|
|
187
193
|
operation.addEdit(idx, type, edit);
|
|
@@ -190,7 +196,7 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
190
196
|
const key = BulkCategory.keyOf(edit.metadata);
|
|
191
197
|
let category = operationByCategory.get(key);
|
|
192
198
|
if (!category) {
|
|
193
|
-
category = (
|
|
199
|
+
category = ( new BulkCategory(edit.metadata));
|
|
194
200
|
operationByCategory.set(key, category);
|
|
195
201
|
}
|
|
196
202
|
insert(uri, category.operationByResource);
|
|
@@ -198,15 +204,15 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
198
204
|
operationByResource.forEach(value => this.fileOperations.push(value));
|
|
199
205
|
operationByCategory.forEach(value => this.categories.push(value));
|
|
200
206
|
for (const file of this.fileOperations) {
|
|
201
|
-
if (file.type !==
|
|
207
|
+
if (file.type !== BulkFileOperationType.TextEdit) {
|
|
202
208
|
let checked = true;
|
|
203
|
-
for (const edit of (
|
|
209
|
+
for (const edit of ( file.originalEdits.values())) {
|
|
204
210
|
if (edit instanceof ResourceFileEdit) {
|
|
205
211
|
checked = checked && this.checked.isChecked(edit);
|
|
206
212
|
}
|
|
207
213
|
}
|
|
208
214
|
if (!checked) {
|
|
209
|
-
for (const edit of (
|
|
215
|
+
for (const edit of ( file.originalEdits.values())) {
|
|
210
216
|
this.checked.updateChecked(edit, checked);
|
|
211
217
|
}
|
|
212
218
|
}
|
|
@@ -247,14 +253,14 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
247
253
|
if (!content) {
|
|
248
254
|
return undefined;
|
|
249
255
|
}
|
|
250
|
-
return EditOperation.replaceMove(Range.lift({ startLineNumber: 0, startColumn: 0, endLineNumber: Number.MAX_VALUE, endColumn: 0 }), (
|
|
256
|
+
return EditOperation.replaceMove(Range.lift({ startLineNumber: 0, startColumn: 0, endLineNumber: Number.MAX_VALUE, endColumn: 0 }), ( content.toString()));
|
|
251
257
|
}
|
|
252
258
|
async getFileEdits(uri) {
|
|
253
259
|
for (const file of this.fileOperations) {
|
|
254
|
-
if ((
|
|
260
|
+
if (( file.uri.toString()) === ( uri.toString())) {
|
|
255
261
|
const result = [];
|
|
256
262
|
let ignoreAll = false;
|
|
257
|
-
for (const edit of (
|
|
263
|
+
for (const edit of ( file.originalEdits.values())) {
|
|
258
264
|
if (edit instanceof ResourceFileEdit) {
|
|
259
265
|
result.push(this.getFileEditOperation(edit));
|
|
260
266
|
}
|
|
@@ -277,35 +283,33 @@ let BulkFileOperations = BulkFileOperations_1 = class BulkFileOperations {
|
|
|
277
283
|
}
|
|
278
284
|
getUriOfEdit(edit) {
|
|
279
285
|
for (const file of this.fileOperations) {
|
|
280
|
-
for (const value of (
|
|
286
|
+
for (const value of ( file.originalEdits.values())) {
|
|
281
287
|
if (value === edit) {
|
|
282
288
|
return file.uri;
|
|
283
289
|
}
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
throw (
|
|
292
|
+
throw ( new Error('invalid edit'));
|
|
287
293
|
}
|
|
288
294
|
};
|
|
289
|
-
BulkFileOperations = BulkFileOperations_1 = (
|
|
290
|
-
(
|
|
291
|
-
(
|
|
292
|
-
], BulkFileOperations))
|
|
295
|
+
BulkFileOperations = BulkFileOperations_1 = ( __decorate([
|
|
296
|
+
( __param(1, IFileService)),
|
|
297
|
+
( __param(2, IInstantiationService))
|
|
298
|
+
], BulkFileOperations));
|
|
293
299
|
let BulkEditPreviewProvider = class BulkEditPreviewProvider {
|
|
294
300
|
static { BulkEditPreviewProvider_1 = this; }
|
|
295
301
|
static { this.Schema = 'vscode-bulkeditpreview-editor'; }
|
|
296
|
-
static { this.emptyPreview = (
|
|
302
|
+
static { this.emptyPreview = ( URI.from({ scheme: this.Schema, fragment: 'empty' })); }
|
|
297
303
|
static fromPreviewUri(uri) {
|
|
298
|
-
return (
|
|
299
|
-
(URI.parse(uri.query))
|
|
300
|
-
);
|
|
304
|
+
return ( URI.parse(uri.query));
|
|
301
305
|
}
|
|
302
306
|
constructor(_operations, _languageService, _modelService, _textModelResolverService) {
|
|
303
307
|
this._operations = _operations;
|
|
304
308
|
this._languageService = _languageService;
|
|
305
309
|
this._modelService = _modelService;
|
|
306
310
|
this._textModelResolverService = _textModelResolverService;
|
|
307
|
-
this._disposables = (
|
|
308
|
-
this._modelPreviewEdits = (
|
|
311
|
+
this._disposables = ( new DisposableStore());
|
|
312
|
+
this._modelPreviewEdits = ( new Map());
|
|
309
313
|
this._instanceId = generateUuid();
|
|
310
314
|
this._disposables.add(this._textModelResolverService.registerTextModelContentProvider(BulkEditPreviewProvider_1.Schema, this));
|
|
311
315
|
this._ready = this._init();
|
|
@@ -314,11 +318,9 @@ let BulkEditPreviewProvider = class BulkEditPreviewProvider {
|
|
|
314
318
|
this._disposables.dispose();
|
|
315
319
|
}
|
|
316
320
|
asPreviewUri(uri) {
|
|
317
|
-
return (
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
))
|
|
321
|
-
);
|
|
321
|
+
return ( URI.from(
|
|
322
|
+
{ scheme: BulkEditPreviewProvider_1.Schema, authority: this._instanceId, path: uri.path, query: ( uri.toString()) }
|
|
323
|
+
));
|
|
322
324
|
}
|
|
323
325
|
async _init() {
|
|
324
326
|
for (const operation of this._operations.fileOperations) {
|
|
@@ -359,17 +361,17 @@ let BulkEditPreviewProvider = class BulkEditPreviewProvider {
|
|
|
359
361
|
return model;
|
|
360
362
|
}
|
|
361
363
|
async provideTextContent(previewUri) {
|
|
362
|
-
if ((
|
|
364
|
+
if (( previewUri.toString()) === ( BulkEditPreviewProvider_1.emptyPreview.toString())) {
|
|
363
365
|
return this._modelService.createModel('', null, previewUri);
|
|
364
366
|
}
|
|
365
367
|
await this._ready;
|
|
366
368
|
return this._modelService.getModel(previewUri);
|
|
367
369
|
}
|
|
368
370
|
};
|
|
369
|
-
BulkEditPreviewProvider = BulkEditPreviewProvider_1 = (
|
|
370
|
-
(
|
|
371
|
-
(
|
|
372
|
-
(
|
|
373
|
-
], BulkEditPreviewProvider))
|
|
371
|
+
BulkEditPreviewProvider = BulkEditPreviewProvider_1 = ( __decorate([
|
|
372
|
+
( __param(1, ILanguageService)),
|
|
373
|
+
( __param(2, IModelService)),
|
|
374
|
+
( __param(3, ITextModelService))
|
|
375
|
+
], BulkEditPreviewProvider));
|
|
374
376
|
|
|
375
|
-
export { BulkCategory, BulkEditPreviewProvider, BulkFileOperation, BulkFileOperations, BulkTextEdit, CheckedStates };
|
|
377
|
+
export { BulkCategory, BulkEditPreviewProvider, BulkFileOperation, BulkFileOperationType, BulkFileOperations, BulkTextEdit, CheckedStates };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { IAsyncDataSource, ITreeRenderer, ITreeNode, ITreeSorter } from "vscode/vscode/vs/base/browser/ui/tree/tree";
|
|
2
|
+
import { ITextModelService } from "vscode/vscode/vs/editor/common/services/resolverService";
|
|
3
|
+
import { FuzzyScore } from "vscode/vscode/vs/base/common/filters";
|
|
4
|
+
import { ResourceLabels } from "@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/browser/labels";
|
|
5
|
+
import { IIdentityProvider, IListVirtualDelegate, IKeyboardNavigationLabelProvider } from "vscode/vscode/vs/base/browser/ui/list/list";
|
|
6
|
+
import { BulkFileOperations, BulkFileOperation, BulkTextEdit, BulkCategory } from "./bulkEditPreview.js";
|
|
7
|
+
import { ILabelService } from "vscode/vscode/vs/platform/label/common/label.service";
|
|
8
|
+
import type { IListAccessibilityProvider } from "vscode/vscode/vs/base/browser/ui/list/listWidget";
|
|
9
|
+
import { IconLabel } from "vscode/vscode/vs/base/browser/ui/iconLabel/iconLabel";
|
|
10
|
+
import { IThemeService } from "vscode/vscode/vs/platform/theme/common/themeService.service";
|
|
11
|
+
import { AriaRole } from "vscode/vscode/vs/base/browser/ui/aria/aria";
|
|
12
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
13
|
+
export interface ICheckable {
|
|
14
|
+
isChecked(): boolean;
|
|
15
|
+
setChecked(value: boolean): void;
|
|
16
|
+
}
|
|
17
|
+
export declare class CategoryElement implements ICheckable {
|
|
18
|
+
readonly parent: BulkFileOperations;
|
|
19
|
+
readonly category: BulkCategory;
|
|
20
|
+
constructor(parent: BulkFileOperations, category: BulkCategory);
|
|
21
|
+
isChecked(): boolean;
|
|
22
|
+
setChecked(value: boolean): void;
|
|
23
|
+
}
|
|
24
|
+
export declare class FileElement implements ICheckable {
|
|
25
|
+
readonly parent: CategoryElement | BulkFileOperations;
|
|
26
|
+
readonly edit: BulkFileOperation;
|
|
27
|
+
constructor(parent: CategoryElement | BulkFileOperations, edit: BulkFileOperation);
|
|
28
|
+
isChecked(): boolean;
|
|
29
|
+
setChecked(value: boolean): void;
|
|
30
|
+
isDisabled(): boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare class TextEditElement implements ICheckable {
|
|
33
|
+
readonly parent: FileElement;
|
|
34
|
+
readonly idx: number;
|
|
35
|
+
readonly edit: BulkTextEdit;
|
|
36
|
+
readonly prefix: string;
|
|
37
|
+
readonly selecting: string;
|
|
38
|
+
readonly inserting: string;
|
|
39
|
+
readonly suffix: string;
|
|
40
|
+
constructor(parent: FileElement, idx: number, edit: BulkTextEdit, prefix: string, selecting: string, inserting: string, suffix: string);
|
|
41
|
+
isChecked(): boolean;
|
|
42
|
+
setChecked(value: boolean): void;
|
|
43
|
+
isDisabled(): boolean;
|
|
44
|
+
}
|
|
45
|
+
export type BulkEditElement = CategoryElement | FileElement | TextEditElement;
|
|
46
|
+
export declare class BulkEditDataSource implements IAsyncDataSource<BulkFileOperations, BulkEditElement> {
|
|
47
|
+
private readonly _textModelService;
|
|
48
|
+
private readonly _instantiationService;
|
|
49
|
+
groupByFile: boolean;
|
|
50
|
+
constructor(_textModelService: ITextModelService, _instantiationService: IInstantiationService);
|
|
51
|
+
hasChildren(element: BulkFileOperations | BulkEditElement): boolean;
|
|
52
|
+
getChildren(element: BulkFileOperations | BulkEditElement): Promise<BulkEditElement[]>;
|
|
53
|
+
}
|
|
54
|
+
export declare class BulkEditSorter implements ITreeSorter<BulkEditElement> {
|
|
55
|
+
compare(a: BulkEditElement, b: BulkEditElement): number;
|
|
56
|
+
}
|
|
57
|
+
export declare function compareBulkFileOperations(a: BulkFileOperation, b: BulkFileOperation): number;
|
|
58
|
+
export declare class BulkEditAccessibilityProvider implements IListAccessibilityProvider<BulkEditElement> {
|
|
59
|
+
private readonly _labelService;
|
|
60
|
+
constructor(_labelService: ILabelService);
|
|
61
|
+
getWidgetAriaLabel(): string;
|
|
62
|
+
getRole(_element: BulkEditElement): AriaRole;
|
|
63
|
+
getAriaLabel(element: BulkEditElement): string | null;
|
|
64
|
+
}
|
|
65
|
+
export declare class BulkEditIdentityProvider implements IIdentityProvider<BulkEditElement> {
|
|
66
|
+
getId(element: BulkEditElement): {
|
|
67
|
+
toString(): string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
declare class CategoryElementTemplate {
|
|
71
|
+
readonly icon: HTMLDivElement;
|
|
72
|
+
readonly label: IconLabel;
|
|
73
|
+
constructor(container: HTMLElement);
|
|
74
|
+
}
|
|
75
|
+
export declare class CategoryElementRenderer implements ITreeRenderer<CategoryElement, FuzzyScore, CategoryElementTemplate> {
|
|
76
|
+
private readonly _themeService;
|
|
77
|
+
static readonly id: string;
|
|
78
|
+
readonly templateId: string;
|
|
79
|
+
constructor(_themeService: IThemeService);
|
|
80
|
+
renderTemplate(container: HTMLElement): CategoryElementTemplate;
|
|
81
|
+
renderElement(node: ITreeNode<CategoryElement, FuzzyScore>, _index: number, template: CategoryElementTemplate): void;
|
|
82
|
+
disposeTemplate(template: CategoryElementTemplate): void;
|
|
83
|
+
}
|
|
84
|
+
declare class FileElementTemplate {
|
|
85
|
+
private readonly _labelService;
|
|
86
|
+
private readonly _disposables;
|
|
87
|
+
private readonly _localDisposables;
|
|
88
|
+
private readonly _checkbox;
|
|
89
|
+
private readonly _label;
|
|
90
|
+
private readonly _details;
|
|
91
|
+
constructor(container: HTMLElement, resourceLabels: ResourceLabels, _labelService: ILabelService);
|
|
92
|
+
dispose(): void;
|
|
93
|
+
set(element: FileElement, score: FuzzyScore | undefined): void;
|
|
94
|
+
}
|
|
95
|
+
export declare class FileElementRenderer implements ITreeRenderer<FileElement, FuzzyScore, FileElementTemplate> {
|
|
96
|
+
private readonly _resourceLabels;
|
|
97
|
+
private readonly _labelService;
|
|
98
|
+
static readonly id: string;
|
|
99
|
+
readonly templateId: string;
|
|
100
|
+
constructor(_resourceLabels: ResourceLabels, _labelService: ILabelService);
|
|
101
|
+
renderTemplate(container: HTMLElement): FileElementTemplate;
|
|
102
|
+
renderElement(node: ITreeNode<FileElement, FuzzyScore>, _index: number, template: FileElementTemplate): void;
|
|
103
|
+
disposeTemplate(template: FileElementTemplate): void;
|
|
104
|
+
}
|
|
105
|
+
declare class TextEditElementTemplate {
|
|
106
|
+
private readonly _themeService;
|
|
107
|
+
private readonly _disposables;
|
|
108
|
+
private readonly _localDisposables;
|
|
109
|
+
private readonly _checkbox;
|
|
110
|
+
private readonly _icon;
|
|
111
|
+
private readonly _label;
|
|
112
|
+
constructor(container: HTMLElement, _themeService: IThemeService);
|
|
113
|
+
dispose(): void;
|
|
114
|
+
set(element: TextEditElement): void;
|
|
115
|
+
}
|
|
116
|
+
export declare class TextEditElementRenderer implements ITreeRenderer<TextEditElement, FuzzyScore, TextEditElementTemplate> {
|
|
117
|
+
private readonly _themeService;
|
|
118
|
+
static readonly id = "TextEditElementRenderer";
|
|
119
|
+
readonly templateId: string;
|
|
120
|
+
constructor(_themeService: IThemeService);
|
|
121
|
+
renderTemplate(container: HTMLElement): TextEditElementTemplate;
|
|
122
|
+
renderElement({ element }: ITreeNode<TextEditElement, FuzzyScore>, _index: number, template: TextEditElementTemplate): void;
|
|
123
|
+
disposeTemplate(_template: TextEditElementTemplate): void;
|
|
124
|
+
}
|
|
125
|
+
export declare class BulkEditDelegate implements IListVirtualDelegate<BulkEditElement> {
|
|
126
|
+
getHeight(): number;
|
|
127
|
+
getTemplateId(element: BulkEditElement): string;
|
|
128
|
+
}
|
|
129
|
+
export declare class BulkEditNaviLabelProvider implements IKeyboardNavigationLabelProvider<BulkEditElement> {
|
|
130
|
+
getKeyboardNavigationLabel(element: BulkEditElement): string | undefined;
|
|
131
|
+
}
|
|
132
|
+
export {};
|