@codingame/monaco-vscode-working-copy-service-override 2.0.3 → 2.1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-working-copy-service-override",
3
- "version": "2.0.3",
3
+ "version": "2.1.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@2.0.3",
22
- "@codingame/monaco-vscode-files-service-override": "2.0.3"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@2.1.0",
22
+ "@codingame/monaco-vscode-files-service-override": "2.1.0"
23
23
  }
24
24
  }
@@ -185,7 +185,7 @@ let WorkingCopyBackupServiceImpl = class WorkingCopyBackupServiceImpl extends Di
185
185
  if (( model.has(backupResource, versionId, meta))) {
186
186
  return;
187
187
  }
188
- return this.ioOperationQueues.queueFor(backupResource).queue(async () => {
188
+ return this.ioOperationQueues.queueFor(backupResource, async () => {
189
189
  if (token?.isCancellationRequested) {
190
190
  return;
191
191
  }
@@ -242,7 +242,7 @@ let WorkingCopyBackupServiceImpl = class WorkingCopyBackupServiceImpl extends Di
242
242
  if (token?.isCancellationRequested) {
243
243
  return;
244
244
  }
245
- return this.ioOperationQueues.queueFor(backupResource).queue(async () => {
245
+ return this.ioOperationQueues.queueFor(backupResource, async () => {
246
246
  if (token?.isCancellationRequested) {
247
247
  return;
248
248
  }
@@ -268,7 +268,7 @@ let WorkingCopyBackupServiceImpl = class WorkingCopyBackupServiceImpl extends Di
268
268
  }
269
269
  async resolveIdentifier(backupResource, model) {
270
270
  let res = undefined;
271
- await this.ioOperationQueues.queueFor(backupResource).queue(async () => {
271
+ await this.ioOperationQueues.queueFor(backupResource, async () => {
272
272
  if (!( model.has(backupResource))) {
273
273
  return;
274
274
  }
@@ -308,7 +308,7 @@ let WorkingCopyBackupServiceImpl = class WorkingCopyBackupServiceImpl extends Di
308
308
  const backupResource = this.toBackupResource(identifier);
309
309
  const model = await this.ready;
310
310
  let res = undefined;
311
- await this.ioOperationQueues.queueFor(backupResource).queue(async () => {
311
+ await this.ioOperationQueues.queueFor(backupResource, async () => {
312
312
  if (!( model.has(backupResource))) {
313
313
  return;
314
314
  }
@@ -38,11 +38,8 @@ class WorkingCopyBackupTracker extends Disposable {
38
38
  this.suspendBackupOperations();
39
39
  }
40
40
  static { this.DEFAULT_BACKUP_SCHEDULE_DELAYS = {
41
- [0 ]: 1000,
42
- [3 ]: 1000,
43
- [4 ]: 1000,
44
- [1 ]: 2000,
45
- [2 ]: 1000
41
+ ['default']: 1000,
42
+ ['delayed']: 2000
46
43
  }; }
47
44
  onDidRegister(workingCopy) {
48
45
  if (this.suspended) {
@@ -128,11 +125,14 @@ class WorkingCopyBackupTracker extends Disposable {
128
125
  if (typeof workingCopy.backupDelay === 'number') {
129
126
  return workingCopy.backupDelay;
130
127
  }
131
- let autoSaveMode = this.filesConfigurationService.getAutoSaveMode();
128
+ let backupScheduleDelay;
132
129
  if (workingCopy.capabilities & 2 ) {
133
- autoSaveMode = 0 ;
130
+ backupScheduleDelay = 'default';
134
131
  }
135
- return WorkingCopyBackupTracker.DEFAULT_BACKUP_SCHEDULE_DELAYS[autoSaveMode];
132
+ else {
133
+ backupScheduleDelay = this.filesConfigurationService.hasShortAutoSaveDelay(workingCopy.resource) ? 'delayed' : 'default';
134
+ }
135
+ return WorkingCopyBackupTracker.DEFAULT_BACKUP_SCHEDULE_DELAYS[backupScheduleDelay];
136
136
  }
137
137
  getContentVersion(workingCopy) {
138
138
  return this.mapWorkingCopyToContentVersion.get(workingCopy) || 0;