@codingame/monaco-vscode-files-service-override 24.2.0 → 25.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-files-service-override",
3
- "version": "24.2.0",
3
+ "version": "25.0.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": "24.2.0"
18
+ "@codingame/monaco-vscode-api": "25.0.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(1900, "File does not exist")), FileSystemProviderErrorCode.FileNotFound);
14
- const ERR_FILE_IS_DIR = createFileSystemProviderError(( localize(1901, "File is Directory")), FileSystemProviderErrorCode.FileIsADirectory);
15
- const ERR_FILE_NOT_DIR = createFileSystemProviderError(( localize(1902, "File is not a directory")), FileSystemProviderErrorCode.FileNotADirectory);
16
- const ERR_DIR_NOT_EMPTY = createFileSystemProviderError(( localize(1903, "Directory is not empty")), FileSystemProviderErrorCode.Unknown);
17
- const ERR_FILE_EXCEEDS_STORAGE_QUOTA = createFileSystemProviderError(( localize(1904, "File exceeds available storage quota")), FileSystemProviderErrorCode.FileExceedsStorageQuota);
13
+ const ERR_FILE_NOT_FOUND = createFileSystemProviderError(( localize(1907, "File does not exist")), FileSystemProviderErrorCode.FileNotFound);
14
+ const ERR_FILE_IS_DIR = createFileSystemProviderError(( localize(1908, "File is Directory")), FileSystemProviderErrorCode.FileIsADirectory);
15
+ const ERR_FILE_NOT_DIR = createFileSystemProviderError(( localize(1909, "File is not a directory")), FileSystemProviderErrorCode.FileNotADirectory);
16
+ const ERR_DIR_NOT_EMPTY = createFileSystemProviderError(( localize(1910, "Directory is not empty")), FileSystemProviderErrorCode.Unknown);
17
+ const ERR_FILE_EXCEEDS_STORAGE_QUOTA = createFileSystemProviderError(( localize(1911, "File exceeds available storage quota")), FileSystemProviderErrorCode.FileExceedsStorageQuota);
18
18
  const ERR_UNKNOWN_INTERNAL = (message) => createFileSystemProviderError(( localize(
19
- 1905,
19
+ 1912,
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
- 1906,
36
+ 1913,
37
37
  "Unable to create folder '{0}' that already exists but is not a directory",
38
38
  resourceForError(directory)
39
39
  ))));
@@ -144,7 +144,7 @@ let FileService = class FileService extends Disposable {
144
144
  async withProvider(resource) {
145
145
  if (!isAbsolutePath(resource)) {
146
146
  throw ( new FileOperationError(( localize(
147
- 1907,
147
+ 1914,
148
148
  "Unable to resolve filesystem provider with relative file path '{0}'",
149
149
  this.resourceForError(resource)
150
150
  )), FileOperationResult.FILE_INVALID_PATH));
@@ -154,7 +154,7 @@ let FileService = class FileService extends Disposable {
154
154
  if (!provider) {
155
155
  const error = ( new ErrorNoTelemetry());
156
156
  error.message = ( localize(
157
- 1908,
157
+ 1915,
158
158
  "ENOPRO: No file system provider found for resource '{0}'",
159
159
  (resource.toString())
160
160
  ));
@@ -187,7 +187,7 @@ let FileService = class FileService extends Disposable {
187
187
  catch (error) {
188
188
  if (toFileSystemProviderErrorCode(error) === FileSystemProviderErrorCode.FileNotFound) {
189
189
  throw ( new FileOperationError(( localize(
190
- 1909,
190
+ 1916,
191
191
  "Unable to resolve nonexistent file '{0}'",
192
192
  this.resourceForError(resource)
193
193
  )), FileOperationResult.FILE_NOT_FOUND));
@@ -233,6 +233,7 @@ let FileService = class FileService extends Disposable {
233
233
  size: stat.size,
234
234
  readonly: Boolean((stat.permissions ?? 0) & FilePermission.Readonly) || Boolean(provider.capabilities & FileSystemProviderCapabilities.Readonly),
235
235
  locked: Boolean((stat.permissions ?? 0) & FilePermission.Locked),
236
+ executable: Boolean((stat.permissions ?? 0) & FilePermission.Executable),
236
237
  etag: etag({ mtime: stat.mtime, size: stat.size }),
237
238
  children: undefined
238
239
  };
@@ -306,7 +307,7 @@ let FileService = class FileService extends Disposable {
306
307
  async doValidateCreateFile(resource, options) {
307
308
  if (!options?.overwrite && (await this.exists(resource))) {
308
309
  throw ( new FileOperationError(( localize(
309
- 1910,
310
+ 1917,
310
311
  "Unable to create file '{0}' that already exists when overwrite flag is not set",
311
312
  this.resourceForError(resource)
312
313
  )), FileOperationResult.FILE_MODIFIED_SINCE, options));
@@ -349,7 +350,7 @@ let FileService = class FileService extends Disposable {
349
350
  }
350
351
  catch (error) {
351
352
  throw ( new FileOperationError(( localize(
352
- 1911,
353
+ 1918,
353
354
  "Unable to write file '{0}' ({1})",
354
355
  this.resourceForError(resource),
355
356
  (ensureFileSystemProviderError(error).toString())
@@ -382,7 +383,7 @@ let FileService = class FileService extends Disposable {
382
383
  const unlock = !!options?.unlock;
383
384
  if (unlock && !(provider.capabilities & FileSystemProviderCapabilities.FileWriteUnlock)) {
384
385
  throw ( new Error(( localize(
385
- 1912,
386
+ 1919,
386
387
  "Unable to unlock file '{0}' because provider does not support it.",
387
388
  this.resourceForError(resource)
388
389
  ))));
@@ -391,21 +392,21 @@ let FileService = class FileService extends Disposable {
391
392
  if (atomic) {
392
393
  if (!(provider.capabilities & FileSystemProviderCapabilities.FileAtomicWrite)) {
393
394
  throw ( new Error(( localize(
394
- 1913,
395
+ 1920,
395
396
  "Unable to atomically write file '{0}' because provider does not support it.",
396
397
  this.resourceForError(resource)
397
398
  ))));
398
399
  }
399
400
  if (!(provider.capabilities & FileSystemProviderCapabilities.FileReadWrite)) {
400
401
  throw ( new Error(( localize(
401
- 1914,
402
+ 1921,
402
403
  "Unable to atomically write file '{0}' because provider does not support unbuffered writes.",
403
404
  this.resourceForError(resource)
404
405
  ))));
405
406
  }
406
407
  if (unlock) {
407
408
  throw ( new Error(( localize(
408
- 1915,
409
+ 1922,
409
410
  "Unable to unlock file '{0}' because atomic write is enabled.",
410
411
  this.resourceForError(resource)
411
412
  ))));
@@ -420,7 +421,7 @@ let FileService = class FileService extends Disposable {
420
421
  }
421
422
  if ((stat.type & FileType.Directory) !== 0) {
422
423
  throw ( new FileOperationError(( localize(
423
- 1916,
424
+ 1923,
424
425
  "Unable to write file '{0}' that is actually a directory",
425
426
  this.resourceForError(resource)
426
427
  )), FileOperationResult.FILE_IS_DIRECTORY, options));
@@ -441,7 +442,7 @@ let FileService = class FileService extends Disposable {
441
442
  catch (error) {
442
443
  }
443
444
  }
444
- throw ( new FileOperationError(( localize(1917, "File Modified Since")), FileOperationResult.FILE_MODIFIED_SINCE, options));
445
+ throw ( new FileOperationError(( localize(1924, "File Modified Since")), FileOperationResult.FILE_MODIFIED_SINCE, options));
445
446
  }
446
447
  return { stat, buffer };
447
448
  }
@@ -523,7 +524,7 @@ let FileService = class FileService extends Disposable {
523
524
  }
524
525
  restoreReadError(error, resource, options) {
525
526
  const message = ( localize(
526
- 1918,
527
+ 1925,
527
528
  "Unable to read file '{0}' ({1})",
528
529
  this.resourceForError(resource),
529
530
  (ensureFileSystemProviderError(error).toString())
@@ -583,13 +584,13 @@ let FileService = class FileService extends Disposable {
583
584
  const stat = await this.resolve(resource, { resolveMetadata: true });
584
585
  if (stat.isDirectory) {
585
586
  throw ( new FileOperationError(( localize(
586
- 1919,
587
+ 1926,
587
588
  "Unable to read file '{0}' that is actually a directory",
588
589
  this.resourceForError(resource)
589
590
  )), FileOperationResult.FILE_IS_DIRECTORY, options));
590
591
  }
591
592
  if (typeof options?.etag === 'string' && options.etag !== ETAG_DISABLED && options.etag === stat.etag) {
592
- throw ( new NotModifiedSinceFileOperationError(( localize(1920, "File not modified since")), stat, options));
593
+ throw ( new NotModifiedSinceFileOperationError(( localize(1927, "File not modified since")), stat, options));
593
594
  }
594
595
  this.validateReadFileLimits(resource, stat.size, options);
595
596
  return stat;
@@ -597,7 +598,7 @@ let FileService = class FileService extends Disposable {
597
598
  validateReadFileLimits(resource, size, options) {
598
599
  if (typeof options?.limits?.size === 'number' && size > options.limits.size) {
599
600
  throw ( new TooLargeFileOperationError(( localize(
600
- 1921,
601
+ 1928,
601
602
  "Unable to read file '{0}' that is too large to open",
602
603
  this.resourceForError(resource)
603
604
  )), FileOperationResult.FILE_TOO_LARGE, size, options));
@@ -719,7 +720,7 @@ let FileService = class FileService extends Disposable {
719
720
  }
720
721
  if (isSameResourceWithDifferentPathCase && mode === 'copy') {
721
722
  throw ( new Error(( localize(
722
- 1922,
723
+ 1929,
723
724
  "Unable to copy when source '{0}' is same as target '{1}' with different path case on a case insensitive file system",
724
725
  this.resourceForError(source),
725
726
  this.resourceForError(target)
@@ -727,7 +728,7 @@ let FileService = class FileService extends Disposable {
727
728
  }
728
729
  if (!isSameResourceWithDifferentPathCase && providerExtUri.isEqualOrParent(target, source)) {
729
730
  throw ( new Error(( localize(
730
- 1923,
731
+ 1930,
731
732
  "Unable to move/copy when source '{0}' is parent of target '{1}'.",
732
733
  this.resourceForError(source),
733
734
  this.resourceForError(target)
@@ -738,7 +739,7 @@ let FileService = class FileService extends Disposable {
738
739
  if (exists && !isSameResourceWithDifferentPathCase) {
739
740
  if (!overwrite) {
740
741
  throw ( new FileOperationError(( localize(
741
- 1924,
742
+ 1931,
742
743
  "Unable to move/copy '{0}' because target '{1}' already exists at destination.",
743
744
  this.resourceForError(source),
744
745
  this.resourceForError(target)
@@ -748,7 +749,7 @@ let FileService = class FileService extends Disposable {
748
749
  const { providerExtUri } = this.getExtUri(sourceProvider);
749
750
  if (providerExtUri.isEqualOrParent(source, target)) {
750
751
  throw ( new Error(( localize(
751
- 1925,
752
+ 1932,
752
753
  "Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",
753
754
  this.resourceForError(source),
754
755
  this.resourceForError(target)
@@ -793,7 +794,7 @@ let FileService = class FileService extends Disposable {
793
794
  const useTrash = !!options?.useTrash;
794
795
  if (useTrash && !(provider.capabilities & FileSystemProviderCapabilities.Trash)) {
795
796
  throw ( new Error(( localize(
796
- 1926,
797
+ 1933,
797
798
  "Unable to delete file '{0}' via trash because provider does not support it.",
798
799
  this.resourceForError(resource)
799
800
  ))));
@@ -801,14 +802,14 @@ let FileService = class FileService extends Disposable {
801
802
  const atomic = options?.atomic;
802
803
  if (atomic && !(provider.capabilities & FileSystemProviderCapabilities.FileAtomicDelete)) {
803
804
  throw ( new Error(( localize(
804
- 1927,
805
+ 1934,
805
806
  "Unable to delete file '{0}' atomically because provider does not support it.",
806
807
  this.resourceForError(resource)
807
808
  ))));
808
809
  }
809
810
  if (useTrash && atomic) {
810
811
  throw ( new Error(( localize(
811
- 1928,
812
+ 1935,
812
813
  "Unable to atomically delete file '{0}' because using trash is enabled.",
813
814
  this.resourceForError(resource)
814
815
  ))));
@@ -824,7 +825,7 @@ let FileService = class FileService extends Disposable {
824
825
  }
825
826
  else {
826
827
  throw ( new FileOperationError(( localize(
827
- 1929,
828
+ 1936,
828
829
  "Unable to delete nonexistent file '{0}'",
829
830
  this.resourceForError(resource)
830
831
  )), FileOperationResult.FILE_NOT_FOUND));
@@ -834,7 +835,7 @@ let FileService = class FileService extends Disposable {
834
835
  const stat = await this.resolve(resource);
835
836
  if (stat.isDirectory && Array.isArray(stat.children) && stat.children.length > 0) {
836
837
  throw ( new Error(( localize(
837
- 1930,
838
+ 1937,
838
839
  "Unable to delete non-empty folder '{0}'.",
839
840
  this.resourceForError(resource)
840
841
  ))));
@@ -1093,7 +1094,7 @@ let FileService = class FileService extends Disposable {
1093
1094
  throwIfFileSystemIsReadonly(provider, resource) {
1094
1095
  if (provider.capabilities & FileSystemProviderCapabilities.Readonly) {
1095
1096
  throw ( new FileOperationError(( localize(
1096
- 1931,
1097
+ 1938,
1097
1098
  "Unable to modify read-only file '{0}'",
1098
1099
  this.resourceForError(resource)
1099
1100
  )), FileOperationResult.FILE_PERMISSION_DENIED));
@@ -1103,7 +1104,7 @@ let FileService = class FileService extends Disposable {
1103
1104
  throwIfFileIsReadonly(resource, stat) {
1104
1105
  if ((stat.permissions ?? 0) & FilePermission.Readonly) {
1105
1106
  throw ( new FileOperationError(( localize(
1106
- 1931,
1107
+ 1938,
1107
1108
  "Unable to modify read-only file '{0}'",
1108
1109
  this.resourceForError(resource)
1109
1110
  )), FileOperationResult.FILE_PERMISSION_DENIED));
@@ -70,7 +70,7 @@ function throwIfCancelled(token) {
70
70
  }
71
71
  function throwIfTooLarge(totalBytesRead, options) {
72
72
  if (typeof options?.limits?.size === 'number' && totalBytesRead > options.limits.size) {
73
- throw createFileSystemProviderError(( localize(1938, "File is too large to open")), FileSystemProviderErrorCode.FileTooLarge);
73
+ throw createFileSystemProviderError(( localize(1945, "File is too large to open")), FileSystemProviderErrorCode.FileTooLarge);
74
74
  }
75
75
  return true;
76
76
  }
@@ -53,8 +53,8 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/sear
53
53
  var AbstractTextFileService_1;
54
54
  let AbstractTextFileService = class AbstractTextFileService extends Disposable {
55
55
  static { AbstractTextFileService_1 = this; }
56
- static { this.TEXTFILE_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('textFileCreate.source', ( localize(14241, "File Created"))); }
57
- static { this.TEXTFILE_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('textFileOverwrite.source', ( localize(14242, "File Replaced"))); }
56
+ static { this.TEXTFILE_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('textFileCreate.source', ( localize(14296, "File Created"))); }
57
+ static { this.TEXTFILE_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('textFileOverwrite.source', ( localize(14297, "File Replaced"))); }
58
58
  constructor(fileService, untitledTextEditorService, lifecycleService, instantiationService, modelService, environmentService, dialogService, fileDialogService, textResourceConfigurationService, filesConfigurationService, codeEditorService, pathService, workingCopyFileService, uriIdentityService, languageService, logService, elevatedFileService, decorationsService) {
59
59
  super();
60
60
  this.fileService = fileService;
@@ -83,7 +83,7 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
83
83
  constructor(files) {
84
84
  super();
85
85
  this.files = files;
86
- this.label = ( localize(14243, "Text File Model Decorations"));
86
+ this.label = ( localize(14298, "Text File Model Decorations"));
87
87
  this._onDidChange = this._register(( new Emitter()));
88
88
  this.onDidChange = this._onDidChange.event;
89
89
  this.registerListeners();
@@ -110,20 +110,20 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
110
110
  color: listErrorForeground,
111
111
  letter: Codicon.lockSmall,
112
112
  strikethrough: true,
113
- tooltip: ( localize(14244, "Deleted, Read-only")),
113
+ tooltip: ( localize(14299, "Deleted, Read-only")),
114
114
  };
115
115
  }
116
116
  else if (isReadonly) {
117
117
  return {
118
118
  letter: Codicon.lockSmall,
119
- tooltip: ( localize(14245, "Read-only")),
119
+ tooltip: ( localize(14300, "Read-only")),
120
120
  };
121
121
  }
122
122
  else if (isOrphaned) {
123
123
  return {
124
124
  color: listErrorForeground,
125
125
  strikethrough: true,
126
- tooltip: ( localize(14246, "Deleted")),
126
+ tooltip: ( localize(14301, "Deleted")),
127
127
  };
128
128
  }
129
129
  return undefined;
@@ -176,7 +176,7 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
176
176
  catch (error) {
177
177
  cts.dispose(true);
178
178
  if (error.decodeStreamErrorKind === DecodeStreamErrorKind.STREAM_IS_BINARY) {
179
- throw ( new TextFileOperationError(( localize(14247, "File seems to be binary and cannot be opened as text")), TextFileOperationResult.FILE_IS_BINARY, options));
179
+ throw ( new TextFileOperationError(( localize(14302, "File seems to be binary and cannot be opened as text")), TextFileOperationResult.FILE_IS_BINARY, options));
180
180
  }
181
181
  else {
182
182
  throw error;
@@ -423,17 +423,17 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
423
423
  const { confirmed } = await this.dialogService.confirm({
424
424
  type: 'warning',
425
425
  message: ( localize(
426
- 14248,
426
+ 14303,
427
427
  "'{0}' already exists. Do you want to replace it?",
428
428
  basename(resource)
429
429
  )),
430
430
  detail: ( localize(
431
- 14249,
431
+ 14304,
432
432
  "A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",
433
433
  basename(resource),
434
434
  basename(dirname(resource))
435
435
  )),
436
- primaryButton: ( localize(14250, "&&Replace")),
436
+ primaryButton: ( localize(14305, "&&Replace")),
437
437
  });
438
438
  return confirmed;
439
439
  }
@@ -441,12 +441,12 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
441
441
  const { confirmed } = await this.dialogService.confirm({
442
442
  type: 'warning',
443
443
  message: ( localize(
444
- 14251,
444
+ 14306,
445
445
  "'{0}' is marked as read-only. Do you want to save anyway?",
446
446
  basename(resource)
447
447
  )),
448
- detail: ( localize(14252, "Paths can be configured as read-only via settings.")),
449
- primaryButton: ( localize(14253, "&&Save Anyway"))
448
+ detail: ( localize(14307, "Paths can be configured as read-only via settings.")),
449
+ primaryButton: ( localize(14308, "&&Save Anyway"))
450
450
  });
451
451
  return confirmed;
452
452
  }
@@ -63,7 +63,7 @@ let TextFileEditorModelManager = class TextFileEditorModelManager extends Dispos
63
63
  return {
64
64
  onSaveError(error, model) {
65
65
  notificationService.error(( localize(
66
- 14257,
66
+ 14312,
67
67
  "Failed to save '{0}': {1}",
68
68
  model.name,
69
69
  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(14258, "Running Code Actions and Formatters..."))
29
+ message: ( localize(14313, "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(14259, "Skip")),
35
+ cancellable: ( localize(14314, "Skip")),
36
36
  delay: model.isDirty() ? 5000 : 3000
37
37
  }, async (progress) => {
38
38
  const participants = Array.from(this.saveParticipants).sort((a, b) => {