@codingame/monaco-vscode-working-copy-service-override 18.4.0 → 19.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 +5 -5
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupTracker.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupTracker.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyEditorService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.js +22 -22
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyHistoryTracker.js +3 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyService.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-working-copy-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "19.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - working-copy service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-
|
|
19
|
-
"@codingame/monaco-vscode-
|
|
20
|
-
"@codingame/monaco-vscode-
|
|
21
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
18
|
+
"@codingame/monaco-vscode-6f931a91-88ea-5232-897f-a17ec3929ba5-common": "19.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-86d65fc6-30f9-5dca-9501-e249de688591-common": "19.0.0",
|
|
20
|
+
"@codingame/monaco-vscode-api": "19.0.0",
|
|
21
|
+
"@codingame/monaco-vscode-files-service-override": "19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"main": "index.js",
|
|
24
24
|
"module": "index.js",
|
|
@@ -6,7 +6,7 @@ import { VSBufferReadable, VSBufferReadableStream } from "@codingame/monaco-vsco
|
|
|
6
6
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
7
7
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
8
8
|
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
9
|
-
import { IWorkingCopyBackupMeta, IWorkingCopyIdentifier } from "@codingame/monaco-vscode-
|
|
9
|
+
import { IWorkingCopyBackupMeta, IWorkingCopyIdentifier } from "@codingame/monaco-vscode-86d65fc6-30f9-5dca-9501-e249de688591-common/vscode/vs/workbench/services/workingCopy/common/workingCopy";
|
|
10
10
|
export declare class WorkingCopyBackupsModel {
|
|
11
11
|
private backupRoot;
|
|
12
12
|
private fileService;
|
|
@@ -15,7 +15,7 @@ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
15
15
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
16
16
|
import { hash } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
|
|
17
17
|
import { isEmptyObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
18
|
-
import { NO_TYPE_ID } from '@codingame/monaco-vscode-
|
|
18
|
+
import { NO_TYPE_ID } from '@codingame/monaco-vscode-86d65fc6-30f9-5dca-9501-e249de688591-common/vscode/vs/workbench/services/workingCopy/common/workingCopy';
|
|
19
19
|
|
|
20
20
|
var WorkingCopyBackupServiceImpl_1;
|
|
21
21
|
class WorkingCopyBackupsModel {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IWorkingCopyBackupService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.service";
|
|
2
2
|
import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
3
|
import { IWorkingCopyService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service";
|
|
4
|
-
import { IWorkingCopy, IWorkingCopyIdentifier } from "@codingame/monaco-vscode-
|
|
4
|
+
import { IWorkingCopy, IWorkingCopyIdentifier } from "@codingame/monaco-vscode-86d65fc6-30f9-5dca-9501-e249de688591-common/vscode/vs/workbench/services/workingCopy/common/workingCopy";
|
|
5
5
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
6
6
|
import { ShutdownReason } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle";
|
|
7
7
|
import { ILifecycleService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { Disposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import { WorkingCopyCapabilities } from '@codingame/monaco-vscode-
|
|
3
|
+
import { WorkingCopyCapabilities } from '@codingame/monaco-vscode-86d65fc6-30f9-5dca-9501-e249de688591-common/vscode/vs/workbench/services/workingCopy/common/workingCopy';
|
|
4
4
|
import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
5
5
|
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
6
6
|
import { Promises } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IEditorIdentifier } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
2
2
|
import { EditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorInput";
|
|
3
|
-
import { IWorkingCopy, IWorkingCopyIdentifier } from "@codingame/monaco-vscode-
|
|
3
|
+
import { IWorkingCopy, IWorkingCopyIdentifier } from "@codingame/monaco-vscode-86d65fc6-30f9-5dca-9501-e249de688591-common/vscode/vs/workbench/services/workingCopy/common/workingCopy";
|
|
4
4
|
import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
5
5
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
6
6
|
import { IWorkingCopyEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService.service";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
4
|
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
|
-
import {
|
|
5
|
+
import { assertReturnsDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
6
6
|
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
7
7
|
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
8
8
|
import { LifecyclePhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
@@ -33,7 +33,7 @@ import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/b
|
|
|
33
33
|
var WorkingCopyHistoryService_1, NativeWorkingCopyHistoryService_1;
|
|
34
34
|
class WorkingCopyHistoryModel {
|
|
35
35
|
static { this.ENTRIES_FILE = 'entries.json'; }
|
|
36
|
-
static { this.FILE_SAVED_SOURCE = SaveSourceRegistry.registerSource('default.source', ( localize(
|
|
36
|
+
static { this.FILE_SAVED_SOURCE = SaveSourceRegistry.registerSource('default.source', ( localize(13519, "File Saved"))); }
|
|
37
37
|
static { this.SETTINGS = {
|
|
38
38
|
MAX_ENTRIES: 'workbench.localHistory.maxFileEntries',
|
|
39
39
|
MERGE_PERIOD: 'workbench.localHistory.mergeWindow'
|
|
@@ -95,9 +95,9 @@ class WorkingCopyHistoryModel {
|
|
|
95
95
|
return entry;
|
|
96
96
|
}
|
|
97
97
|
async doAddEntry(source, sourceDescription = undefined, timestamp, token) {
|
|
98
|
-
const workingCopyResource =
|
|
99
|
-
const workingCopyName =
|
|
100
|
-
const historyEntriesFolder =
|
|
98
|
+
const workingCopyResource = assertReturnsDefined(this.workingCopyResource);
|
|
99
|
+
const workingCopyName = assertReturnsDefined(this.workingCopyName);
|
|
100
|
+
const historyEntriesFolder = assertReturnsDefined(this.historyEntriesFolder);
|
|
101
101
|
const id = `${randomPath(undefined, undefined, 4)}${extname(workingCopyResource)}`;
|
|
102
102
|
const location = joinPath(historyEntriesFolder, id);
|
|
103
103
|
await this.fileService.cloneFile(workingCopyResource, location);
|
|
@@ -115,7 +115,7 @@ class WorkingCopyHistoryModel {
|
|
|
115
115
|
return entry;
|
|
116
116
|
}
|
|
117
117
|
async doReplaceEntry(entry, source, sourceDescription = undefined, timestamp, token) {
|
|
118
|
-
const workingCopyResource =
|
|
118
|
+
const workingCopyResource = assertReturnsDefined(this.workingCopyResource);
|
|
119
119
|
await this.fileService.cloneFile(workingCopyResource, entry.location);
|
|
120
120
|
entry.source = source;
|
|
121
121
|
entry.sourceDescription = sourceDescription;
|
|
@@ -186,8 +186,8 @@ class WorkingCopyHistoryModel {
|
|
|
186
186
|
this.entries = Array.from(( entries.values())).sort((entryA, entryB) => entryA.timestamp - entryB.timestamp);
|
|
187
187
|
}
|
|
188
188
|
async resolveEntriesFromDisk() {
|
|
189
|
-
const workingCopyResource =
|
|
190
|
-
const workingCopyName =
|
|
189
|
+
const workingCopyResource = assertReturnsDefined(this.workingCopyResource);
|
|
190
|
+
const workingCopyName = assertReturnsDefined(this.workingCopyName);
|
|
191
191
|
const [entryListing, entryStats] = await Promise.all([
|
|
192
192
|
this.readEntriesFile(),
|
|
193
193
|
this.readEntriesFolder()
|
|
@@ -222,9 +222,9 @@ class WorkingCopyHistoryModel {
|
|
|
222
222
|
}
|
|
223
223
|
async moveEntries(target, source, token) {
|
|
224
224
|
const timestamp = Date.now();
|
|
225
|
-
const sourceDescription = this.labelService.getUriLabel(
|
|
226
|
-
const sourceHistoryEntriesFolder =
|
|
227
|
-
const targetHistoryEntriesFolder =
|
|
225
|
+
const sourceDescription = this.labelService.getUriLabel(assertReturnsDefined(this.workingCopyResource));
|
|
226
|
+
const sourceHistoryEntriesFolder = assertReturnsDefined(this.historyEntriesFolder);
|
|
227
|
+
const targetHistoryEntriesFolder = assertReturnsDefined(target.historyEntriesFolder);
|
|
228
228
|
try {
|
|
229
229
|
for (const entry of this.entries) {
|
|
230
230
|
await this.fileService.move(entry.location, joinPath(targetHistoryEntriesFolder, entry.id), true);
|
|
@@ -244,9 +244,9 @@ class WorkingCopyHistoryModel {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
const allEntries = distinct([...this.entries, ...target.entries], entry => entry.id).sort((entryA, entryB) => entryA.timestamp - entryB.timestamp);
|
|
247
|
-
const targetWorkingCopyResource =
|
|
247
|
+
const targetWorkingCopyResource = assertReturnsDefined(target.workingCopyResource);
|
|
248
248
|
this.setWorkingCopy(targetWorkingCopyResource);
|
|
249
|
-
const targetWorkingCopyName =
|
|
249
|
+
const targetWorkingCopyName = assertReturnsDefined(target.workingCopyName);
|
|
250
250
|
for (const entry of allEntries) {
|
|
251
251
|
this.entries.push({
|
|
252
252
|
id: entry.id,
|
|
@@ -278,7 +278,7 @@ class WorkingCopyHistoryModel {
|
|
|
278
278
|
return this.storedVersionId !== this.versionId;
|
|
279
279
|
}
|
|
280
280
|
async doStore(token) {
|
|
281
|
-
const historyEntriesFolder =
|
|
281
|
+
const historyEntriesFolder = assertReturnsDefined(this.historyEntriesFolder);
|
|
282
282
|
await this.resolveEntriesOnce();
|
|
283
283
|
if (token.isCancellationRequested) {
|
|
284
284
|
return undefined;
|
|
@@ -322,8 +322,8 @@ class WorkingCopyHistoryModel {
|
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
async writeEntriesFile() {
|
|
325
|
-
const workingCopyResource =
|
|
326
|
-
const historyEntriesListingFile =
|
|
325
|
+
const workingCopyResource = assertReturnsDefined(this.workingCopyResource);
|
|
326
|
+
const historyEntriesListingFile = assertReturnsDefined(this.historyEntriesListingFile);
|
|
327
327
|
const serializedModel = {
|
|
328
328
|
version: 1,
|
|
329
329
|
resource: ( workingCopyResource.toString()),
|
|
@@ -339,7 +339,7 @@ class WorkingCopyHistoryModel {
|
|
|
339
339
|
await this.fileService.writeFile(historyEntriesListingFile, VSBuffer.fromString(JSON.stringify(serializedModel)));
|
|
340
340
|
}
|
|
341
341
|
async readEntriesFile() {
|
|
342
|
-
const historyEntriesListingFile =
|
|
342
|
+
const historyEntriesListingFile = assertReturnsDefined(this.historyEntriesListingFile);
|
|
343
343
|
let serializedModel = undefined;
|
|
344
344
|
try {
|
|
345
345
|
serializedModel = JSON.parse(( (await this.fileService.readFile(historyEntriesListingFile)).value.toString()));
|
|
@@ -352,8 +352,8 @@ class WorkingCopyHistoryModel {
|
|
|
352
352
|
return serializedModel;
|
|
353
353
|
}
|
|
354
354
|
async readEntriesFolder() {
|
|
355
|
-
const historyEntriesFolder =
|
|
356
|
-
const historyEntriesNameMatcher =
|
|
355
|
+
const historyEntriesFolder = assertReturnsDefined(this.historyEntriesFolder);
|
|
356
|
+
const historyEntriesNameMatcher = assertReturnsDefined(this.historyEntriesNameMatcher);
|
|
357
357
|
let rawEntries = undefined;
|
|
358
358
|
try {
|
|
359
359
|
rawEntries = (await this.fileService.resolve(historyEntriesFolder, { resolveMetadata: true })).children;
|
|
@@ -379,8 +379,8 @@ class WorkingCopyHistoryModel {
|
|
|
379
379
|
}
|
|
380
380
|
let WorkingCopyHistoryService = class WorkingCopyHistoryService extends Disposable {
|
|
381
381
|
static { WorkingCopyHistoryService_1 = this; }
|
|
382
|
-
static { this.FILE_MOVED_SOURCE = SaveSourceRegistry.registerSource('moved.source', ( localize(
|
|
383
|
-
static { this.FILE_RENAMED_SOURCE = SaveSourceRegistry.registerSource('renamed.source', ( localize(
|
|
382
|
+
static { this.FILE_MOVED_SOURCE = SaveSourceRegistry.registerSource('moved.source', ( localize(13520, "File Moved"))); }
|
|
383
|
+
static { this.FILE_RENAMED_SOURCE = SaveSourceRegistry.registerSource('renamed.source', ( localize(13521, "File Renamed"))); }
|
|
384
384
|
constructor(fileService, remoteAgentService, environmentService, uriIdentityService, labelService, logService, configurationService) {
|
|
385
385
|
super();
|
|
386
386
|
this.fileService = fileService;
|
|
@@ -597,7 +597,7 @@ let NativeWorkingCopyHistoryService = class NativeWorkingCopyHistoryService exte
|
|
|
597
597
|
onWillShutdown(e) {
|
|
598
598
|
this.storeAllScheduler.dispose();
|
|
599
599
|
this.storeAllCts.dispose(true);
|
|
600
|
-
e.join(this.storeAll(e.token), { id: 'join.workingCopyHistory', label: ( localize(
|
|
600
|
+
e.join(this.storeAll(e.token), { id: 'join.workingCopyHistory', label: ( localize(13522, "Saving local history")) });
|
|
601
601
|
}
|
|
602
602
|
onDidChangeModels() {
|
|
603
603
|
if (!this.storeAllScheduler.isScheduled()) {
|
|
@@ -10,12 +10,12 @@ import { IUndoRedoService } from '@codingame/monaco-vscode-api/vscode/vs/platfor
|
|
|
10
10
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
11
11
|
import { SaveSourceRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
12
12
|
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
13
|
-
import { isStoredFileWorkingCopySaveEvent } from '@codingame/monaco-vscode-
|
|
13
|
+
import { isStoredFileWorkingCopySaveEvent } from '@codingame/monaco-vscode-6f931a91-88ea-5232-897f-a17ec3929ba5-common/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy';
|
|
14
14
|
import { MAX_PARALLEL_HISTORY_IO_OPS } from './workingCopyHistory.js';
|
|
15
15
|
import { IWorkingCopyHistoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyHistory.service';
|
|
16
16
|
import { IWorkingCopyService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
|
|
17
17
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
18
|
-
import { ResourceGlobMatcher } from '@codingame/monaco-vscode-
|
|
18
|
+
import { ResourceGlobMatcher } from '@codingame/monaco-vscode-86d65fc6-30f9-5dca-9501-e249de688591-common/vscode/vs/workbench/common/resources';
|
|
19
19
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
20
20
|
import { FileOperation } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
21
21
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
@@ -28,7 +28,7 @@ let WorkingCopyHistoryTracker = class WorkingCopyHistoryTracker extends Disposab
|
|
|
28
28
|
SIZE_LIMIT: 'workbench.localHistory.maxFileSize',
|
|
29
29
|
EXCLUDES: 'workbench.localHistory.exclude'
|
|
30
30
|
}; }
|
|
31
|
-
static { this.UNDO_REDO_SAVE_SOURCE = SaveSourceRegistry.registerSource('undoRedo.source', ( localize(
|
|
31
|
+
static { this.UNDO_REDO_SAVE_SOURCE = SaveSourceRegistry.registerSource('undoRedo.source', ( localize(13523, "Undo / Redo"))); }
|
|
32
32
|
constructor(workingCopyService, workingCopyHistoryService, uriIdentityService, pathService, configurationService, undoRedoService, contextService, fileService) {
|
|
33
33
|
super();
|
|
34
34
|
this.workingCopyService = workingCopyService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
2
|
import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
-
import { IWorkingCopy, IWorkingCopyIdentifier, IWorkingCopySaveEvent as IBaseWorkingCopySaveEvent } from "@codingame/monaco-vscode-
|
|
3
|
+
import { IWorkingCopy, IWorkingCopyIdentifier, IWorkingCopySaveEvent as IBaseWorkingCopySaveEvent } from "@codingame/monaco-vscode-86d65fc6-30f9-5dca-9501-e249de688591-common/vscode/vs/workbench/services/workingCopy/common/workingCopy";
|
|
4
4
|
import { IWorkingCopyService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service";
|
|
5
5
|
export interface IWorkingCopySaveEvent extends IBaseWorkingCopySaveEvent {
|
|
6
6
|
readonly workingCopy: IWorkingCopy;
|