@codingame/monaco-vscode-working-copy-service-override 37.2.0 → 37.3.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 +3 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +17 -13
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupTracker.js +4 -4
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.js +6 -6
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyHistoryTracker.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-working-copy-service-override",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - working-copy service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "37.
|
|
19
|
-
"@codingame/monaco-vscode-files-service-override": "37.
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.3.0",
|
|
19
|
+
"@codingame/monaco-vscode-files-service-override": "37.3.0"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
|
@@ -33,16 +33,18 @@ class WorkingCopyBackupsModel {
|
|
|
33
33
|
try {
|
|
34
34
|
const backupRootStat = await this.fileService.resolve(this.backupRoot);
|
|
35
35
|
if (backupRootStat.children) {
|
|
36
|
-
await Promises.settled(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
await Promises.settled(
|
|
37
|
+
backupRootStat.children.filter(child => child.isDirectory).map(async backupSchemaFolder => {
|
|
38
|
+
const backupSchemaFolderStat = await this.fileService.resolve(backupSchemaFolder.resource);
|
|
39
|
+
if (backupSchemaFolderStat.children) {
|
|
40
|
+
for (const backupForSchema of backupSchemaFolderStat.children) {
|
|
41
|
+
if (!backupForSchema.isDirectory) {
|
|
42
|
+
this.add(backupForSchema.resource);
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
+
})
|
|
47
|
+
);
|
|
46
48
|
}
|
|
47
49
|
} catch (error) {}
|
|
48
50
|
}
|
|
@@ -219,11 +221,11 @@ let WorkingCopyBackupServiceImpl = class WorkingCopyBackupServiceImpl extends Di
|
|
|
219
221
|
for (const exceptWorkingCopy of except) {
|
|
220
222
|
exceptMap.set(this.toBackupResource(exceptWorkingCopy), true);
|
|
221
223
|
}
|
|
222
|
-
await Promises.settled(
|
|
224
|
+
await Promises.settled(model.get().map(async backupResource => {
|
|
223
225
|
if (!( exceptMap.has(backupResource))) {
|
|
224
226
|
await this.doDiscardBackup(backupResource);
|
|
225
227
|
}
|
|
226
|
-
}))
|
|
228
|
+
}));
|
|
227
229
|
}
|
|
228
230
|
else {
|
|
229
231
|
await this.deleteIgnoreFileNotFound(this.backupWorkspaceHome);
|
|
@@ -261,7 +263,9 @@ let WorkingCopyBackupServiceImpl = class WorkingCopyBackupServiceImpl extends Di
|
|
|
261
263
|
async getBackups() {
|
|
262
264
|
const model = await this.ready;
|
|
263
265
|
await this.joinBackups();
|
|
264
|
-
const backups = await Promise.all(
|
|
266
|
+
const backups = await Promise.all(
|
|
267
|
+
model.get().map(backupResource => this.resolveIdentifier(backupResource, model))
|
|
268
|
+
);
|
|
265
269
|
return coalesce(backups);
|
|
266
270
|
}
|
|
267
271
|
async resolveIdentifier(backupResource, model) {
|
|
@@ -410,10 +414,10 @@ class InMemoryWorkingCopyBackupService extends Disposable {
|
|
|
410
414
|
return undefined;
|
|
411
415
|
}
|
|
412
416
|
async getBackups() {
|
|
413
|
-
return
|
|
417
|
+
return Array.from(this.backups.entries()).map(([resource, backup]) => ({
|
|
414
418
|
typeId: backup.typeId,
|
|
415
419
|
resource
|
|
416
|
-
}))
|
|
420
|
+
}));
|
|
417
421
|
}
|
|
418
422
|
async discardBackup(identifier) {
|
|
419
423
|
this.backups.delete(this.toBackupResource(identifier));
|
|
@@ -273,24 +273,24 @@ class WorkingCopyBackupTracker extends Disposable {
|
|
|
273
273
|
restoredBackups.add(unrestoredBackup);
|
|
274
274
|
}
|
|
275
275
|
if (nonOpenedEditorsForBackups.size > 0) {
|
|
276
|
-
await this.editorService.openEditors(
|
|
276
|
+
await this.editorService.openEditors([...nonOpenedEditorsForBackups].map(nonOpenedEditorForBackup => ({
|
|
277
277
|
editor: nonOpenedEditorForBackup,
|
|
278
278
|
options: {
|
|
279
279
|
pinned: true,
|
|
280
280
|
preserveFocus: true,
|
|
281
281
|
inactive: true
|
|
282
282
|
}
|
|
283
|
-
})))
|
|
283
|
+
})));
|
|
284
284
|
for (const nonOpenedEditorForBackup of nonOpenedEditorsForBackups) {
|
|
285
285
|
openedEditorsForBackups.add(nonOpenedEditorForBackup);
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
await Promises.settled(
|
|
288
|
+
await Promises.settled([...openedEditorsForBackups].map(async openedEditorForBackup => {
|
|
289
289
|
if (this.editorService.isVisible(openedEditorForBackup)) {
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
292
|
return openedEditorForBackup.resolve();
|
|
293
|
-
}))
|
|
293
|
+
}));
|
|
294
294
|
for (const restoredBackup of restoredBackups) {
|
|
295
295
|
this.unrestoredBackups.delete(restoredBackup);
|
|
296
296
|
}
|
|
@@ -36,7 +36,7 @@ class WorkingCopyHistoryModel {
|
|
|
36
36
|
this.ENTRIES_FILE = "entries.json";
|
|
37
37
|
}
|
|
38
38
|
static {
|
|
39
|
-
this.FILE_SAVED_SOURCE = SaveSourceRegistry.registerSource("default.source", ( localize(
|
|
39
|
+
this.FILE_SAVED_SOURCE = SaveSourceRegistry.registerSource("default.source", ( localize(22561, "File Saved")));
|
|
40
40
|
}
|
|
41
41
|
static {
|
|
42
42
|
this.SETTINGS = {
|
|
@@ -371,14 +371,14 @@ class WorkingCopyHistoryModel {
|
|
|
371
371
|
const serializedModel = {
|
|
372
372
|
version: 1,
|
|
373
373
|
resource: ( workingCopyResource.toString()),
|
|
374
|
-
entries:
|
|
374
|
+
entries: this.entries.map(entry => {
|
|
375
375
|
return {
|
|
376
376
|
id: entry.id,
|
|
377
377
|
source: entry.source !== WorkingCopyHistoryModel.FILE_SAVED_SOURCE ? entry.source : undefined,
|
|
378
378
|
sourceDescription: entry.sourceDescription,
|
|
379
379
|
timestamp: entry.timestamp
|
|
380
380
|
};
|
|
381
|
-
})
|
|
381
|
+
})
|
|
382
382
|
};
|
|
383
383
|
await this.fileService.writeFile(
|
|
384
384
|
historyEntriesListingFile,
|
|
@@ -429,10 +429,10 @@ let WorkingCopyHistoryService = class WorkingCopyHistoryService extends Disposab
|
|
|
429
429
|
WorkingCopyHistoryService_1 = this;
|
|
430
430
|
}
|
|
431
431
|
static {
|
|
432
|
-
this.FILE_MOVED_SOURCE = SaveSourceRegistry.registerSource("moved.source", ( localize(
|
|
432
|
+
this.FILE_MOVED_SOURCE = SaveSourceRegistry.registerSource("moved.source", ( localize(22562, "File Moved")));
|
|
433
433
|
}
|
|
434
434
|
static {
|
|
435
|
-
this.FILE_RENAMED_SOURCE = SaveSourceRegistry.registerSource("renamed.source", ( localize(
|
|
435
|
+
this.FILE_RENAMED_SOURCE = SaveSourceRegistry.registerSource("renamed.source", ( localize(22563, "File Renamed")));
|
|
436
436
|
}
|
|
437
437
|
constructor(
|
|
438
438
|
fileService,
|
|
@@ -684,7 +684,7 @@ let NativeWorkingCopyHistoryService = class NativeWorkingCopyHistoryService exte
|
|
|
684
684
|
this.storeAllCts.dispose(true);
|
|
685
685
|
e.join(this.storeAll(e.token), {
|
|
686
686
|
id: "join.workingCopyHistory",
|
|
687
|
-
label: ( localize(
|
|
687
|
+
label: ( localize(22564, "Saving local history"))
|
|
688
688
|
});
|
|
689
689
|
}
|
|
690
690
|
onDidChangeModels() {
|
|
@@ -33,7 +33,7 @@ let WorkingCopyHistoryTracker = class WorkingCopyHistoryTracker extends Disposab
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
static {
|
|
36
|
-
this.UNDO_REDO_SAVE_SOURCE = SaveSourceRegistry.registerSource("undoRedo.source", ( localize(
|
|
36
|
+
this.UNDO_REDO_SAVE_SOURCE = SaveSourceRegistry.registerSource("undoRedo.source", ( localize(22565, "Undo / Redo")));
|
|
37
37
|
}
|
|
38
38
|
constructor(
|
|
39
39
|
workingCopyService,
|