@codingame/monaco-vscode-files-service-override 37.0.0 → 37.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-files-service-override",
3
- "version": "37.0.0",
3
+ "version": "37.1.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - files service-override",
6
6
  "keywords": [],
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "37.0.0"
18
+ "@codingame/monaco-vscode-api": "37.1.0"
19
19
  },
20
20
  "main": "index.js",
21
21
  "module": "index.js",
@@ -10,13 +10,13 @@ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
10
10
  import { createFileSystemProviderError, FileSystemProviderErrorCode, FileType, FileSystemProviderCapabilities, FileChangeType } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
11
11
  import { BroadcastDataChannel } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/broadcast';
12
12
 
13
- const ERR_FILE_NOT_FOUND = createFileSystemProviderError(( localize(2257, "File does not exist")), FileSystemProviderErrorCode.FileNotFound);
14
- const ERR_FILE_IS_DIR = createFileSystemProviderError(( localize(2258, "File is Directory")), FileSystemProviderErrorCode.FileIsADirectory);
15
- const ERR_FILE_NOT_DIR = createFileSystemProviderError(( localize(2259, "File is not a directory")), FileSystemProviderErrorCode.FileNotADirectory);
16
- const ERR_DIR_NOT_EMPTY = createFileSystemProviderError(( localize(2260, "Directory is not empty")), FileSystemProviderErrorCode.Unknown);
17
- const ERR_FILE_EXCEEDS_STORAGE_QUOTA = createFileSystemProviderError(( localize(2261, "File exceeds available storage quota")), FileSystemProviderErrorCode.FileExceedsStorageQuota);
13
+ const ERR_FILE_NOT_FOUND = createFileSystemProviderError(( localize(2303, "File does not exist")), FileSystemProviderErrorCode.FileNotFound);
14
+ const ERR_FILE_IS_DIR = createFileSystemProviderError(( localize(2304, "File is Directory")), FileSystemProviderErrorCode.FileIsADirectory);
15
+ const ERR_FILE_NOT_DIR = createFileSystemProviderError(( localize(2305, "File is not a directory")), FileSystemProviderErrorCode.FileNotADirectory);
16
+ const ERR_DIR_NOT_EMPTY = createFileSystemProviderError(( localize(2306, "Directory is not empty")), FileSystemProviderErrorCode.Unknown);
17
+ const ERR_FILE_EXCEEDS_STORAGE_QUOTA = createFileSystemProviderError(( localize(2307, "File exceeds available storage quota")), FileSystemProviderErrorCode.FileExceedsStorageQuota);
18
18
  const ERR_UNKNOWN_INTERNAL = message => createFileSystemProviderError(( localize(
19
- 2262,
19
+ 2308,
20
20
  "Internal error occurred in IndexedDB File System Provider. ({0})",
21
21
  message
22
22
  )), FileSystemProviderErrorCode.Unknown);
@@ -33,7 +33,7 @@ async function mkdirp(providerExtUri, provider, directory) {
33
33
  const stat = await provider.stat(directory);
34
34
  if ((stat.type & FileType.Directory) === 0) {
35
35
  throw ( new Error(( localize(
36
- 2263,
36
+ 2309,
37
37
  "Unable to create folder '{0}' that already exists but is not a directory",
38
38
  resourceForError(directory)
39
39
  ))));
@@ -159,7 +159,7 @@ let FileService = class FileService extends Disposable {
159
159
  async withProvider(resource) {
160
160
  if (!isAbsolutePath(resource)) {
161
161
  throw ( new FileOperationError(( localize(
162
- 2264,
162
+ 2310,
163
163
  "Unable to resolve filesystem provider with relative file path '{0}'",
164
164
  this.resourceForError(resource)
165
165
  )), FileOperationResult.FILE_INVALID_PATH));
@@ -169,7 +169,7 @@ let FileService = class FileService extends Disposable {
169
169
  if (!provider) {
170
170
  const error = ( new ErrorNoTelemetry());
171
171
  error.message = ( localize(
172
- 2265,
172
+ 2311,
173
173
  "ENOPRO: No file system provider found for resource '{0}'",
174
174
  (resource.toString())
175
175
  ));
@@ -201,7 +201,7 @@ let FileService = class FileService extends Disposable {
201
201
  } catch (error) {
202
202
  if (toFileSystemProviderErrorCode(error) === FileSystemProviderErrorCode.FileNotFound) {
203
203
  throw ( new FileOperationError(( localize(
204
- 2266,
204
+ 2312,
205
205
  "Unable to resolve nonexistent file '{0}'",
206
206
  this.resourceForError(resource)
207
207
  )), FileOperationResult.FILE_NOT_FOUND));
@@ -357,7 +357,7 @@ let FileService = class FileService extends Disposable {
357
357
  async doValidateCreateFile(resource, options) {
358
358
  if (!options?.overwrite && (await this.exists(resource))) {
359
359
  throw ( new FileOperationError(( localize(
360
- 2267,
360
+ 2313,
361
361
  "Unable to create file '{0}' that already exists when overwrite flag is not set",
362
362
  this.resourceForError(resource)
363
363
  )), FileOperationResult.FILE_MODIFIED_SINCE, options));
@@ -415,7 +415,7 @@ let FileService = class FileService extends Disposable {
415
415
  this._onDidRunOperation.fire(( new FileOperationEvent(resource, FileOperation.WRITE)));
416
416
  } catch (error) {
417
417
  throw ( new FileOperationError(( localize(
418
- 2268,
418
+ 2314,
419
419
  "Unable to write file '{0}' ({1})",
420
420
  this.resourceForError(resource),
421
421
  (ensureFileSystemProviderError(error).toString())
@@ -447,14 +447,14 @@ let FileService = class FileService extends Disposable {
447
447
  const unlock = !!options?.unlock;
448
448
  if (unlock && !(provider.capabilities & FileSystemProviderCapabilities.FileWriteUnlock)) {
449
449
  throw ( new Error(( localize(
450
- 2269,
450
+ 2315,
451
451
  "Unable to unlock file '{0}' because provider does not support it.",
452
452
  this.resourceForError(resource)
453
453
  ))));
454
454
  }
455
455
  if (options?.append && !hasFileAppendCapability(provider)) {
456
456
  throw ( new FileOperationError(( localize(
457
- 2270,
457
+ 2316,
458
458
  "Filesystem provider for scheme '{0}' does not does not support append",
459
459
  this.resourceForError(resource)
460
460
  )), FileOperationResult.FILE_PERMISSION_DENIED));
@@ -463,21 +463,21 @@ let FileService = class FileService extends Disposable {
463
463
  if (atomic) {
464
464
  if (!(provider.capabilities & FileSystemProviderCapabilities.FileAtomicWrite)) {
465
465
  throw ( new Error(( localize(
466
- 2271,
466
+ 2317,
467
467
  "Unable to atomically write file '{0}' because provider does not support it.",
468
468
  this.resourceForError(resource)
469
469
  ))));
470
470
  }
471
471
  if (!(provider.capabilities & FileSystemProviderCapabilities.FileReadWrite)) {
472
472
  throw ( new Error(( localize(
473
- 2272,
473
+ 2318,
474
474
  "Unable to atomically write file '{0}' because provider does not support unbuffered writes.",
475
475
  this.resourceForError(resource)
476
476
  ))));
477
477
  }
478
478
  if (unlock) {
479
479
  throw ( new Error(( localize(
480
- 2273,
480
+ 2319,
481
481
  "Unable to unlock file '{0}' because atomic write is enabled.",
482
482
  this.resourceForError(resource)
483
483
  ))));
@@ -491,7 +491,7 @@ let FileService = class FileService extends Disposable {
491
491
  }
492
492
  if ((stat.type & FileType.Directory) !== 0) {
493
493
  throw ( new FileOperationError(( localize(
494
- 2274,
494
+ 2320,
495
495
  "Unable to write file '{0}' that is actually a directory",
496
496
  this.resourceForError(resource)
497
497
  )), FileOperationResult.FILE_IS_DIRECTORY, options));
@@ -520,7 +520,7 @@ let FileService = class FileService extends Disposable {
520
520
  }
521
521
  } catch (error) {}
522
522
  }
523
- throw ( new FileOperationError(( localize(2275, "File Modified Since")), FileOperationResult.FILE_MODIFIED_SINCE, options));
523
+ throw ( new FileOperationError(( localize(2321, "File Modified Since")), FileOperationResult.FILE_MODIFIED_SINCE, options));
524
524
  }
525
525
  return {
526
526
  stat,
@@ -604,7 +604,7 @@ let FileService = class FileService extends Disposable {
604
604
  }
605
605
  restoreReadError(error, resource, options) {
606
606
  const message = ( localize(
607
- 2276,
607
+ 2322,
608
608
  "Unable to read file '{0}' ({1})",
609
609
  this.resourceForError(resource),
610
610
  (ensureFileSystemProviderError(error).toString())
@@ -666,13 +666,13 @@ let FileService = class FileService extends Disposable {
666
666
  });
667
667
  if (stat.isDirectory) {
668
668
  throw ( new FileOperationError(( localize(
669
- 2277,
669
+ 2323,
670
670
  "Unable to read file '{0}' that is actually a directory",
671
671
  this.resourceForError(resource)
672
672
  )), FileOperationResult.FILE_IS_DIRECTORY, options));
673
673
  }
674
674
  if (typeof options?.etag === "string" && options.etag !== ETAG_DISABLED && options.etag === stat.etag) {
675
- throw ( new NotModifiedSinceFileOperationError(( localize(2278, "File not modified since")), stat, options));
675
+ throw ( new NotModifiedSinceFileOperationError(( localize(2324, "File not modified since")), stat, options));
676
676
  }
677
677
  this.validateReadFileLimits(resource, stat.size, options);
678
678
  return stat;
@@ -680,7 +680,7 @@ let FileService = class FileService extends Disposable {
680
680
  validateReadFileLimits(resource, size, options) {
681
681
  if (typeof options?.limits?.size === "number" && size > options.limits.size) {
682
682
  throw ( new TooLargeFileOperationError(( localize(
683
- 2279,
683
+ 2325,
684
684
  "Unable to read file '{0}' that is too large to open",
685
685
  this.resourceForError(resource)
686
686
  )), FileOperationResult.FILE_TOO_LARGE, size, options));
@@ -825,7 +825,7 @@ let FileService = class FileService extends Disposable {
825
825
  }
826
826
  if (isSameResourceWithDifferentPathCase && mode === "copy") {
827
827
  throw ( new Error(( localize(
828
- 2280,
828
+ 2326,
829
829
  "Unable to copy when source '{0}' is same as target '{1}' with different path case on a case insensitive file system",
830
830
  this.resourceForError(source),
831
831
  this.resourceForError(target)
@@ -833,7 +833,7 @@ let FileService = class FileService extends Disposable {
833
833
  }
834
834
  if (!isSameResourceWithDifferentPathCase && providerExtUri.isEqualOrParent(target, source)) {
835
835
  throw ( new Error(( localize(
836
- 2281,
836
+ 2327,
837
837
  "Unable to move/copy when source '{0}' is parent of target '{1}'.",
838
838
  this.resourceForError(source),
839
839
  this.resourceForError(target)
@@ -844,7 +844,7 @@ let FileService = class FileService extends Disposable {
844
844
  if (exists && !isSameResourceWithDifferentPathCase) {
845
845
  if (!overwrite) {
846
846
  throw ( new FileOperationError(( localize(
847
- 2282,
847
+ 2328,
848
848
  "Unable to move/copy '{0}' because target '{1}' already exists at destination.",
849
849
  this.resourceForError(source),
850
850
  this.resourceForError(target)
@@ -856,7 +856,7 @@ let FileService = class FileService extends Disposable {
856
856
  } = this.getExtUri(sourceProvider);
857
857
  if (providerExtUri.isEqualOrParent(source, target)) {
858
858
  throw ( new Error(( localize(
859
- 2283,
859
+ 2329,
860
860
  "Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",
861
861
  this.resourceForError(source),
862
862
  this.resourceForError(target)
@@ -907,7 +907,7 @@ let FileService = class FileService extends Disposable {
907
907
  const useTrash = !!options?.useTrash;
908
908
  if (useTrash && !(provider.capabilities & FileSystemProviderCapabilities.Trash)) {
909
909
  throw ( new Error(( localize(
910
- 2284,
910
+ 2330,
911
911
  "Unable to delete file '{0}' via trash because provider does not support it.",
912
912
  this.resourceForError(resource)
913
913
  ))));
@@ -915,14 +915,14 @@ let FileService = class FileService extends Disposable {
915
915
  const atomic = options?.atomic;
916
916
  if (atomic && !(provider.capabilities & FileSystemProviderCapabilities.FileAtomicDelete)) {
917
917
  throw ( new Error(( localize(
918
- 2285,
918
+ 2331,
919
919
  "Unable to delete file '{0}' atomically because provider does not support it.",
920
920
  this.resourceForError(resource)
921
921
  ))));
922
922
  }
923
923
  if (useTrash && atomic) {
924
924
  throw ( new Error(( localize(
925
- 2286,
925
+ 2332,
926
926
  "Unable to atomically delete file '{0}' because using trash is enabled.",
927
927
  this.resourceForError(resource)
928
928
  ))));
@@ -935,7 +935,7 @@ let FileService = class FileService extends Disposable {
935
935
  this.throwIfFileIsReadonly(resource, stat);
936
936
  } else {
937
937
  throw ( new FileOperationError(( localize(
938
- 2287,
938
+ 2333,
939
939
  "Unable to delete nonexistent file '{0}'",
940
940
  this.resourceForError(resource)
941
941
  )), FileOperationResult.FILE_NOT_FOUND));
@@ -945,7 +945,7 @@ let FileService = class FileService extends Disposable {
945
945
  const stat = await this.resolve(resource);
946
946
  if (stat.isDirectory && Array.isArray(stat.children) && stat.children.length > 0) {
947
947
  throw ( new Error(( localize(
948
- 2288,
948
+ 2334,
949
949
  "Unable to delete non-empty folder '{0}'.",
950
950
  this.resourceForError(resource)
951
951
  ))));
@@ -1278,7 +1278,7 @@ let FileService = class FileService extends Disposable {
1278
1278
  throwIfFileSystemIsReadonly(provider, resource) {
1279
1279
  if (provider.capabilities & FileSystemProviderCapabilities.Readonly) {
1280
1280
  throw ( new FileOperationError(( localize(
1281
- 2289,
1281
+ 2335,
1282
1282
  "Unable to modify read-only file '{0}'",
1283
1283
  this.resourceForError(resource)
1284
1284
  )), FileOperationResult.FILE_PERMISSION_DENIED));
@@ -1288,7 +1288,7 @@ let FileService = class FileService extends Disposable {
1288
1288
  throwIfFileIsReadonly(resource, stat) {
1289
1289
  if ((stat.permissions ?? 0) & FilePermission.Readonly) {
1290
1290
  throw ( new FileOperationError(( localize(
1291
- 2289,
1291
+ 2335,
1292
1292
  "Unable to modify read-only file '{0}'",
1293
1293
  this.resourceForError(resource)
1294
1294
  )), FileOperationResult.FILE_PERMISSION_DENIED));
@@ -80,7 +80,7 @@ function throwIfCancelled(token) {
80
80
  }
81
81
  function throwIfTooLarge(totalBytesRead, options) {
82
82
  if (typeof options?.limits?.size === "number" && totalBytesRead > options.limits.size) {
83
- throw createFileSystemProviderError(( localize(2296, "File is too large to open")), FileSystemProviderErrorCode.FileTooLarge);
83
+ throw createFileSystemProviderError(( localize(2342, "File is too large to open")), FileSystemProviderErrorCode.FileTooLarge);
84
84
  }
85
85
  return true;
86
86
  }
@@ -56,10 +56,10 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
56
56
  AbstractTextFileService_1 = this;
57
57
  }
58
58
  static {
59
- this.TEXTFILE_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource("textFileCreate.source", ( localize(19719, "File Created")));
59
+ this.TEXTFILE_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource("textFileCreate.source", ( localize(20051, "File Created")));
60
60
  }
61
61
  static {
62
- this.TEXTFILE_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource("textFileOverwrite.source", ( localize(19720, "File Replaced")));
62
+ this.TEXTFILE_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource("textFileOverwrite.source", ( localize(20052, "File Replaced")));
63
63
  }
64
64
  constructor(
65
65
  fileService,
@@ -108,7 +108,7 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
108
108
  constructor(files) {
109
109
  super();
110
110
  this.files = files;
111
- this.label = ( localize(19721, "Text File Model Decorations"));
111
+ this.label = ( localize(20053, "Text File Model Decorations"));
112
112
  this._onDidChange = this._register(( new Emitter()));
113
113
  this.onDidChange = this._onDidChange.event;
114
114
  this.registerListeners();
@@ -143,20 +143,20 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
143
143
  color: listErrorForeground,
144
144
  letter: Codicon.lockSmall,
145
145
  strikethrough: true,
146
- tooltip: ( localize(19722, "Deleted, Read-only"))
146
+ tooltip: ( localize(20054, "Deleted, Read-only"))
147
147
  };
148
148
  }
149
149
  else if (isReadonly) {
150
150
  return {
151
151
  letter: Codicon.lockSmall,
152
- tooltip: ( localize(19723, "Read-only"))
152
+ tooltip: ( localize(20055, "Read-only"))
153
153
  };
154
154
  }
155
155
  else if (isOrphaned) {
156
156
  return {
157
157
  color: listErrorForeground,
158
158
  strikethrough: true,
159
- tooltip: ( localize(19724, "Deleted"))
159
+ tooltip: ( localize(20056, "Deleted"))
160
160
  };
161
161
  }
162
162
  return undefined;
@@ -207,7 +207,7 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
207
207
  } catch (error) {
208
208
  cts.dispose(true);
209
209
  if (error.decodeStreamErrorKind === DecodeStreamErrorKind.STREAM_IS_BINARY) {
210
- throw ( new TextFileOperationError(( localize(19725, "File seems to be binary and cannot be opened as text")), TextFileOperationResult.FILE_IS_BINARY, options));
210
+ throw ( new TextFileOperationError(( localize(20057, "File seems to be binary and cannot be opened as text")), TextFileOperationResult.FILE_IS_BINARY, options));
211
211
  }
212
212
  else {
213
213
  throw error;
@@ -481,17 +481,17 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
481
481
  } = await this.dialogService.confirm({
482
482
  type: "warning",
483
483
  message: ( localize(
484
- 19726,
484
+ 20058,
485
485
  "'{0}' already exists. Do you want to replace it?",
486
486
  basename(resource)
487
487
  )),
488
488
  detail: ( localize(
489
- 19727,
489
+ 20059,
490
490
  "A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",
491
491
  basename(resource),
492
492
  basename(dirname(resource))
493
493
  )),
494
- primaryButton: ( localize(19728, "&&Replace"))
494
+ primaryButton: ( localize(20060, "&&Replace"))
495
495
  });
496
496
  return confirmed;
497
497
  }
@@ -501,12 +501,12 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
501
501
  } = await this.dialogService.confirm({
502
502
  type: "warning",
503
503
  message: ( localize(
504
- 19729,
504
+ 20061,
505
505
  "'{0}' is marked as read-only. Do you want to save anyway?",
506
506
  basename(resource)
507
507
  )),
508
- detail: ( localize(19730, "Paths can be configured as read-only via settings.")),
509
- primaryButton: ( localize(19731, "&&Save Anyway"))
508
+ detail: ( localize(20062, "Paths can be configured as read-only via settings.")),
509
+ primaryButton: ( localize(20063, "&&Save Anyway"))
510
510
  });
511
511
  return confirmed;
512
512
  }
@@ -70,7 +70,7 @@ let TextFileEditorModelManager = class TextFileEditorModelManager extends Dispos
70
70
  return {
71
71
  onSaveError(error, model) {
72
72
  notificationService.error(( localize(
73
- 19735,
73
+ 20067,
74
74
  "Failed to save '{0}': {1}",
75
75
  model.name,
76
76
  toErrorMessage(error, false)
@@ -26,13 +26,13 @@ let TextFileSaveParticipant = class TextFileSaveParticipant extends Disposable {
26
26
  const cts = ( new CancellationTokenSource(token));
27
27
  model.textEditorModel?.pushStackElement();
28
28
  progress.report({
29
- message: ( localize(19736, "Running Code Actions and Formatters..."))
29
+ message: ( localize(20068, "Running Code Actions and Formatters..."))
30
30
  });
31
31
  let bubbleCancel = false;
32
32
  await this.progressService.withProgress({
33
33
  priority: NotificationPriority.URGENT,
34
34
  location: ProgressLocation.Notification,
35
- cancellable: ( localize(19737, "Skip")),
35
+ cancellable: ( localize(20069, "Skip")),
36
36
  delay: model.isDirty() ? 5000 : 3000
37
37
  }, async progress => {
38
38
  const participants = Array.from(this.saveParticipants).sort((a, b) => {