@codingame/monaco-vscode-working-copy-service-override 9.0.3 → 10.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 +3 -3
- package/vscode/src/vs/workbench/services/workingCopy/browser/workingCopyHistoryService.js +0 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +1 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyEditorService.js +1 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyHistoryService.js +9 -10
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyHistoryTracker.js +2 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyService.js +0 -1
- package/workingCopy.js +3 -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": "10.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
30
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.0",
|
|
30
|
+
"@codingame/monaco-vscode-files-service-override": "10.0.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -7,7 +7,6 @@ import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.serv
|
|
|
7
7
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
8
8
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
9
9
|
import { WorkingCopyHistoryService } from '../common/workingCopyHistoryService.js';
|
|
10
|
-
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
11
10
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
11
|
|
|
13
12
|
let BrowserWorkingCopyHistoryService = class BrowserWorkingCopyHistoryService extends WorkingCopyHistoryService {
|
|
@@ -4,7 +4,6 @@ import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
|
4
4
|
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
5
5
|
import { deepClone, equals } from 'vscode/vscode/vs/base/common/objects';
|
|
6
6
|
import { Promises, ResourceQueue } from 'vscode/vscode/vs/base/common/async';
|
|
7
|
-
import { FileOperationResult } from 'vscode/vscode/vs/platform/files/common/files';
|
|
8
7
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
9
8
|
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
10
9
|
import { isReadableStream, peekStream } from 'vscode/vscode/vs/base/common/stream';
|
|
@@ -256,7 +255,7 @@ let WorkingCopyBackupServiceImpl = class WorkingCopyBackupServiceImpl extends Di
|
|
|
256
255
|
await this.fileService.del(backupResource, { recursive: true });
|
|
257
256
|
}
|
|
258
257
|
catch (error) {
|
|
259
|
-
if (error.fileOperationResult !==
|
|
258
|
+
if (error.fileOperationResult !== 1 ) {
|
|
260
259
|
throw error;
|
|
261
260
|
}
|
|
262
261
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
-
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
4
|
-
import { EditorsOrder } from 'vscode/vscode/vs/workbench/common/editor';
|
|
5
3
|
import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
6
4
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
7
5
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -20,7 +18,7 @@ let WorkingCopyEditorService = class WorkingCopyEditorService extends Disposable
|
|
|
20
18
|
return toDisposable(() => this.handlers.delete(handler));
|
|
21
19
|
}
|
|
22
20
|
findEditor(workingCopy) {
|
|
23
|
-
for (const editorIdentifier of this.editorService.getEditors(
|
|
21
|
+
for (const editorIdentifier of this.editorService.getEditors(0 )) {
|
|
24
22
|
if (this.isOpen(workingCopy, editorIdentifier.editor)) {
|
|
25
23
|
return editorIdentifier;
|
|
26
24
|
}
|
|
@@ -4,12 +4,11 @@ import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
|
4
4
|
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types';
|
|
5
5
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
6
6
|
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
7
|
-
import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
8
7
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
9
8
|
import { WorkingCopyHistoryTracker } from './workingCopyHistoryTracker.js';
|
|
10
9
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
10
|
import { MAX_PARALLEL_HISTORY_IO_OPS } from './workingCopyHistory.js';
|
|
12
|
-
import { FileOperationError
|
|
11
|
+
import { FileOperationError } from 'vscode/vscode/vs/platform/files/common/files';
|
|
13
12
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
14
13
|
import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService.service';
|
|
15
14
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
@@ -26,13 +25,13 @@ import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
|
26
25
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
27
26
|
import { SaveSourceRegistry } from 'vscode/vscode/vs/workbench/common/editor';
|
|
28
27
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
29
|
-
import {
|
|
28
|
+
import { distinct } from 'vscode/vscode/vs/base/common/arrays';
|
|
30
29
|
import { escapeRegExpCharacters } from 'vscode/vscode/vs/base/common/strings';
|
|
31
30
|
|
|
32
31
|
var WorkingCopyHistoryService_1, NativeWorkingCopyHistoryService_1;
|
|
33
32
|
class WorkingCopyHistoryModel {
|
|
34
33
|
static { this.ENTRIES_FILE = 'entries.json'; }
|
|
35
|
-
static { this.FILE_SAVED_SOURCE = SaveSourceRegistry.registerSource('default.source', ( localize(
|
|
34
|
+
static { this.FILE_SAVED_SOURCE = SaveSourceRegistry.registerSource('default.source', ( localize(8647, "File Saved"))); }
|
|
36
35
|
static { this.SETTINGS = {
|
|
37
36
|
MAX_ENTRIES: 'workbench.localHistory.maxFileEntries',
|
|
38
37
|
MERGE_PERIOD: 'workbench.localHistory.mergeWindow'
|
|
@@ -74,7 +73,7 @@ class WorkingCopyHistoryModel {
|
|
|
74
73
|
}
|
|
75
74
|
async addEntry(source = WorkingCopyHistoryModel.FILE_SAVED_SOURCE, sourceDescription = undefined, timestamp = Date.now(), token) {
|
|
76
75
|
let entryToReplace = undefined;
|
|
77
|
-
const lastEntry =
|
|
76
|
+
const lastEntry = this.entries.at(-1);
|
|
78
77
|
if (lastEntry && lastEntry.source === source) {
|
|
79
78
|
const configuredReplaceInterval = this.configurationService.getValue(WorkingCopyHistoryModel.SETTINGS.MERGE_PERIOD, { resource: this.workingCopyResource });
|
|
80
79
|
if (timestamp - lastEntry.timestamp <= ((configuredReplaceInterval * 1000) )) {
|
|
@@ -370,7 +369,7 @@ class WorkingCopyHistoryModel {
|
|
|
370
369
|
);
|
|
371
370
|
}
|
|
372
371
|
isFileNotFound(error) {
|
|
373
|
-
return error instanceof FileOperationError && error.fileOperationResult ===
|
|
372
|
+
return error instanceof FileOperationError && error.fileOperationResult === 1 ;
|
|
374
373
|
}
|
|
375
374
|
traceError(error) {
|
|
376
375
|
this.logService.trace('[Working Copy History Service]', error);
|
|
@@ -378,8 +377,8 @@ class WorkingCopyHistoryModel {
|
|
|
378
377
|
}
|
|
379
378
|
let WorkingCopyHistoryService = class WorkingCopyHistoryService extends Disposable {
|
|
380
379
|
static { WorkingCopyHistoryService_1 = this; }
|
|
381
|
-
static { this.FILE_MOVED_SOURCE = SaveSourceRegistry.registerSource('moved.source', ( localize(
|
|
382
|
-
static { this.FILE_RENAMED_SOURCE = SaveSourceRegistry.registerSource('renamed.source', ( localize(
|
|
380
|
+
static { this.FILE_MOVED_SOURCE = SaveSourceRegistry.registerSource('moved.source', ( localize(8648, "File Moved"))); }
|
|
381
|
+
static { this.FILE_RENAMED_SOURCE = SaveSourceRegistry.registerSource('renamed.source', ( localize(8649, "File Renamed"))); }
|
|
383
382
|
constructor(fileService, remoteAgentService, environmentService, uriIdentityService, labelService, logService, configurationService) {
|
|
384
383
|
super();
|
|
385
384
|
this.fileService = fileService;
|
|
@@ -596,7 +595,7 @@ let NativeWorkingCopyHistoryService = class NativeWorkingCopyHistoryService exte
|
|
|
596
595
|
onWillShutdown(e) {
|
|
597
596
|
this.storeAllScheduler.dispose();
|
|
598
597
|
this.storeAllCts.dispose(true);
|
|
599
|
-
e.join(this.storeAll(e.token), { id: 'join.workingCopyHistory', label: ( localize(
|
|
598
|
+
e.join(this.storeAll(e.token), { id: 'join.workingCopyHistory', label: ( localize(8650, "Saving local history")) });
|
|
600
599
|
}
|
|
601
600
|
onDidChangeModels() {
|
|
602
601
|
if (!this.storeAllScheduler.isScheduled()) {
|
|
@@ -633,6 +632,6 @@ NativeWorkingCopyHistoryService = NativeWorkingCopyHistoryService_1 = ( (__decor
|
|
|
633
632
|
( (__param(6, ILogService))),
|
|
634
633
|
( (__param(7, IConfigurationService)))
|
|
635
634
|
], NativeWorkingCopyHistoryService)));
|
|
636
|
-
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(WorkingCopyHistoryTracker,
|
|
635
|
+
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(WorkingCopyHistoryTracker, 3 );
|
|
637
636
|
|
|
638
637
|
export { NativeWorkingCopyHistoryService, WorkingCopyHistoryModel, WorkingCopyHistoryService };
|
|
@@ -16,7 +16,6 @@ import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/working
|
|
|
16
16
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
17
17
|
import { ResourceGlobMatcher } from 'vscode/vscode/vs/workbench/common/resources';
|
|
18
18
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
19
|
-
import { FileOperation } from 'vscode/vscode/vs/platform/files/common/files';
|
|
20
19
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
21
20
|
|
|
22
21
|
var WorkingCopyHistoryTracker_1;
|
|
@@ -27,7 +26,7 @@ let WorkingCopyHistoryTracker = class WorkingCopyHistoryTracker extends Disposab
|
|
|
27
26
|
SIZE_LIMIT: 'workbench.localHistory.maxFileSize',
|
|
28
27
|
EXCLUDES: 'workbench.localHistory.exclude'
|
|
29
28
|
}; }
|
|
30
|
-
static { this.UNDO_REDO_SAVE_SOURCE = SaveSourceRegistry.registerSource('undoRedo.source', ( localize(
|
|
29
|
+
static { this.UNDO_REDO_SAVE_SOURCE = SaveSourceRegistry.registerSource('undoRedo.source', ( localize(10982, "Undo / Redo"))); }
|
|
31
30
|
constructor(workingCopyService, workingCopyHistoryService, uriIdentityService, pathService, configurationService, undoRedoService, contextService, fileService) {
|
|
32
31
|
super();
|
|
33
32
|
this.workingCopyService = workingCopyService;
|
|
@@ -126,7 +125,7 @@ let WorkingCopyHistoryTracker = class WorkingCopyHistoryTracker extends Disposab
|
|
|
126
125
|
return this.shouldTrackHistory(e.workingCopy.resource, e.stat);
|
|
127
126
|
}
|
|
128
127
|
shouldTrackHistoryFromFileOperationEvent(e) {
|
|
129
|
-
if (!e.isOperation(
|
|
128
|
+
if (!e.isOperation(2 )) {
|
|
130
129
|
return false;
|
|
131
130
|
}
|
|
132
131
|
return this.shouldTrackHistory(e.target.resource, e.target);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
2
1
|
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
3
2
|
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
4
3
|
import { Disposable, DisposableMap, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
package/workingCopy.js
CHANGED
|
@@ -17,7 +17,9 @@ import getServiceOverride$1 from '@codingame/monaco-vscode-files-service-overrid
|
|
|
17
17
|
|
|
18
18
|
let BrowserWorkingCopyBackupService = class BrowserWorkingCopyBackupService extends WorkingCopyBackupService {
|
|
19
19
|
constructor(memory, contextService, environmentService, fileService, logService) {
|
|
20
|
-
super(memory
|
|
20
|
+
super(memory
|
|
21
|
+
? undefined
|
|
22
|
+
: joinPath(environmentService.userRoamingDataHome, 'Backups', contextService.getWorkspace().id), fileService, logService);
|
|
21
23
|
}
|
|
22
24
|
};
|
|
23
25
|
BrowserWorkingCopyBackupService = __decorate([
|