@codingame/monaco-vscode-files-service-override 10.1.2 → 10.1.4
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/platform/files/browser/indexedDBFileSystemProvider.js +6 -6
- package/vscode/src/vs/platform/files/common/fileService.js +27 -27
- package/vscode/src/vs/platform/files/common/io.js +1 -1
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +13 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-files-service-override",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.4",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git@github.com
|
|
12
|
+
"url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
15
|
"private": false,
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@10.1.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.1.4"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -10,13 +10,13 @@ import { createFileSystemProviderError, FileSystemProviderErrorCode, FileType, F
|
|
|
10
10
|
import { DBClosedError } from 'vscode/vscode/vs/base/browser/indexedDB';
|
|
11
11
|
import { BroadcastDataChannel } from 'vscode/vscode/vs/base/browser/broadcast';
|
|
12
12
|
|
|
13
|
-
const ERR_FILE_NOT_FOUND = createFileSystemProviderError(( localize(
|
|
14
|
-
const ERR_FILE_IS_DIR = createFileSystemProviderError(( localize(
|
|
15
|
-
const ERR_FILE_NOT_DIR = createFileSystemProviderError(( localize(
|
|
16
|
-
const ERR_DIR_NOT_EMPTY = createFileSystemProviderError(( localize(
|
|
17
|
-
const ERR_FILE_EXCEEDS_STORAGE_QUOTA = createFileSystemProviderError(( localize(
|
|
13
|
+
const ERR_FILE_NOT_FOUND = createFileSystemProviderError(( localize(740, "File does not exist")), FileSystemProviderErrorCode.FileNotFound);
|
|
14
|
+
const ERR_FILE_IS_DIR = createFileSystemProviderError(( localize(741, "File is Directory")), FileSystemProviderErrorCode.FileIsADirectory);
|
|
15
|
+
const ERR_FILE_NOT_DIR = createFileSystemProviderError(( localize(742, "File is not a directory")), FileSystemProviderErrorCode.FileNotADirectory);
|
|
16
|
+
const ERR_DIR_NOT_EMPTY = createFileSystemProviderError(( localize(743, "Directory is not empty")), FileSystemProviderErrorCode.Unknown);
|
|
17
|
+
const ERR_FILE_EXCEEDS_STORAGE_QUOTA = createFileSystemProviderError(( localize(744, "File exceeds available storage quota")), FileSystemProviderErrorCode.FileExceedsStorageQuota);
|
|
18
18
|
const ERR_UNKNOWN_INTERNAL = (message) => createFileSystemProviderError(( localize(
|
|
19
|
-
|
|
19
|
+
745,
|
|
20
20
|
"Internal error occurred in IndexedDB File System Provider. ({0})",
|
|
21
21
|
message
|
|
22
22
|
)), FileSystemProviderErrorCode.Unknown);
|
|
@@ -34,7 +34,7 @@ async function mkdirp(providerExtUri, provider, directory) {
|
|
|
34
34
|
const stat = await provider.stat(directory);
|
|
35
35
|
if ((stat.type & FileType.Directory) === 0) {
|
|
36
36
|
throw ( (new Error(localize(
|
|
37
|
-
|
|
37
|
+
712,
|
|
38
38
|
"Unable to create folder '{0}' that already exists but is not a directory",
|
|
39
39
|
resourceForError(directory)
|
|
40
40
|
))));
|
|
@@ -149,7 +149,7 @@ let FileService = class FileService extends Disposable {
|
|
|
149
149
|
async withProvider(resource) {
|
|
150
150
|
if (!isAbsolutePath(resource)) {
|
|
151
151
|
throw ( (new FileOperationError(localize(
|
|
152
|
-
|
|
152
|
+
713,
|
|
153
153
|
"Unable to resolve filesystem provider with relative file path '{0}'",
|
|
154
154
|
this.resourceForError(resource)
|
|
155
155
|
), 8 )));
|
|
@@ -159,7 +159,7 @@ let FileService = class FileService extends Disposable {
|
|
|
159
159
|
if (!provider) {
|
|
160
160
|
const error = ( (new ErrorNoTelemetry()));
|
|
161
161
|
error.message = ( localize(
|
|
162
|
-
|
|
162
|
+
714,
|
|
163
163
|
"ENOPRO: No file system provider found for resource '{0}'",
|
|
164
164
|
(resource.toString())
|
|
165
165
|
));
|
|
@@ -192,7 +192,7 @@ let FileService = class FileService extends Disposable {
|
|
|
192
192
|
catch (error) {
|
|
193
193
|
if (toFileSystemProviderErrorCode(error) === FileSystemProviderErrorCode.FileNotFound) {
|
|
194
194
|
throw ( (new FileOperationError(localize(
|
|
195
|
-
|
|
195
|
+
715,
|
|
196
196
|
"Unable to resolve nonexistent file '{0}'",
|
|
197
197
|
this.resourceForError(resource)
|
|
198
198
|
), 1 )));
|
|
@@ -303,7 +303,7 @@ let FileService = class FileService extends Disposable {
|
|
|
303
303
|
async doValidateCreateFile(resource, options) {
|
|
304
304
|
if (!options?.overwrite && (await this.exists(resource))) {
|
|
305
305
|
throw ( (new FileOperationError(localize(
|
|
306
|
-
|
|
306
|
+
716,
|
|
307
307
|
"Unable to create file '{0}' that already exists when overwrite flag is not set",
|
|
308
308
|
this.resourceForError(resource)
|
|
309
309
|
), 3 , options)));
|
|
@@ -361,7 +361,7 @@ let FileService = class FileService extends Disposable {
|
|
|
361
361
|
}
|
|
362
362
|
catch (error) {
|
|
363
363
|
throw ( (new FileOperationError(localize(
|
|
364
|
-
|
|
364
|
+
717,
|
|
365
365
|
"Unable to write file '{0}' ({1})",
|
|
366
366
|
this.resourceForError(resource),
|
|
367
367
|
( (ensureFileSystemProviderError(error).toString()))
|
|
@@ -373,7 +373,7 @@ let FileService = class FileService extends Disposable {
|
|
|
373
373
|
const unlock = !!options?.unlock;
|
|
374
374
|
if (unlock && !((provider.capabilities & 8192) )) {
|
|
375
375
|
throw ( (new Error(localize(
|
|
376
|
-
|
|
376
|
+
718,
|
|
377
377
|
"Unable to unlock file '{0}' because provider does not support it.",
|
|
378
378
|
this.resourceForError(resource)
|
|
379
379
|
))));
|
|
@@ -382,21 +382,21 @@ let FileService = class FileService extends Disposable {
|
|
|
382
382
|
if (atomic) {
|
|
383
383
|
if (!((provider.capabilities & 32768) )) {
|
|
384
384
|
throw ( (new Error(localize(
|
|
385
|
-
|
|
385
|
+
719,
|
|
386
386
|
"Unable to atomically write file '{0}' because provider does not support it.",
|
|
387
387
|
this.resourceForError(resource)
|
|
388
388
|
))));
|
|
389
389
|
}
|
|
390
390
|
if (!((provider.capabilities & 2) )) {
|
|
391
391
|
throw ( (new Error(localize(
|
|
392
|
-
|
|
392
|
+
720,
|
|
393
393
|
"Unable to atomically write file '{0}' because provider does not support unbuffered writes.",
|
|
394
394
|
this.resourceForError(resource)
|
|
395
395
|
))));
|
|
396
396
|
}
|
|
397
397
|
if (unlock) {
|
|
398
398
|
throw ( (new Error(localize(
|
|
399
|
-
|
|
399
|
+
721,
|
|
400
400
|
"Unable to unlock file '{0}' because atomic write is enabled.",
|
|
401
401
|
this.resourceForError(resource)
|
|
402
402
|
))));
|
|
@@ -411,7 +411,7 @@ let FileService = class FileService extends Disposable {
|
|
|
411
411
|
}
|
|
412
412
|
if ((stat.type & FileType.Directory) !== 0) {
|
|
413
413
|
throw ( (new FileOperationError(localize(
|
|
414
|
-
|
|
414
|
+
722,
|
|
415
415
|
"Unable to write file '{0}' that is actually a directory",
|
|
416
416
|
this.resourceForError(resource)
|
|
417
417
|
), 0 , options)));
|
|
@@ -421,7 +421,7 @@ let FileService = class FileService extends Disposable {
|
|
|
421
421
|
typeof stat.mtime === 'number' && typeof stat.size === 'number' &&
|
|
422
422
|
options.mtime < stat.mtime && options.etag !== etag({ mtime: options.mtime , size: stat.size })) {
|
|
423
423
|
throw ( (new FileOperationError(
|
|
424
|
-
localize(
|
|
424
|
+
localize(723, "File Modified Since"),
|
|
425
425
|
3 ,
|
|
426
426
|
options
|
|
427
427
|
)));
|
|
@@ -508,7 +508,7 @@ let FileService = class FileService extends Disposable {
|
|
|
508
508
|
}
|
|
509
509
|
restoreReadError(error, resource, options) {
|
|
510
510
|
const message = ( localize(
|
|
511
|
-
|
|
511
|
+
724,
|
|
512
512
|
"Unable to read file '{0}' ({1})",
|
|
513
513
|
this.resourceForError(resource),
|
|
514
514
|
(ensureFileSystemProviderError(error).toString())
|
|
@@ -574,13 +574,13 @@ let FileService = class FileService extends Disposable {
|
|
|
574
574
|
const stat = await this.resolve(resource, { resolveMetadata: true });
|
|
575
575
|
if (stat.isDirectory) {
|
|
576
576
|
throw ( (new FileOperationError(localize(
|
|
577
|
-
|
|
577
|
+
725,
|
|
578
578
|
"Unable to read file '{0}' that is actually a directory",
|
|
579
579
|
this.resourceForError(resource)
|
|
580
580
|
), 0 , options)));
|
|
581
581
|
}
|
|
582
582
|
if (typeof options?.etag === 'string' && options.etag !== ETAG_DISABLED && options.etag === stat.etag) {
|
|
583
|
-
throw ( (new NotModifiedSinceFileOperationError(localize(
|
|
583
|
+
throw ( (new NotModifiedSinceFileOperationError(localize(726, "File not modified since"), stat, options)));
|
|
584
584
|
}
|
|
585
585
|
this.validateReadFileLimits(resource, stat.size, options);
|
|
586
586
|
return stat;
|
|
@@ -588,7 +588,7 @@ let FileService = class FileService extends Disposable {
|
|
|
588
588
|
validateReadFileLimits(resource, size, options) {
|
|
589
589
|
if (typeof options?.limits?.size === 'number' && size > options.limits.size) {
|
|
590
590
|
throw ( (new TooLargeFileOperationError(localize(
|
|
591
|
-
|
|
591
|
+
727,
|
|
592
592
|
"Unable to read file '{0}' that is too large to open",
|
|
593
593
|
this.resourceForError(resource)
|
|
594
594
|
), 7 , size, options)));
|
|
@@ -710,7 +710,7 @@ let FileService = class FileService extends Disposable {
|
|
|
710
710
|
}
|
|
711
711
|
if (isSameResourceWithDifferentPathCase && mode === 'copy') {
|
|
712
712
|
throw ( (new Error(localize(
|
|
713
|
-
|
|
713
|
+
728,
|
|
714
714
|
"Unable to copy when source '{0}' is same as target '{1}' with different path case on a case insensitive file system",
|
|
715
715
|
this.resourceForError(source),
|
|
716
716
|
this.resourceForError(target)
|
|
@@ -718,7 +718,7 @@ let FileService = class FileService extends Disposable {
|
|
|
718
718
|
}
|
|
719
719
|
if (!isSameResourceWithDifferentPathCase && providerExtUri.isEqualOrParent(target, source)) {
|
|
720
720
|
throw ( (new Error(localize(
|
|
721
|
-
|
|
721
|
+
729,
|
|
722
722
|
"Unable to move/copy when source '{0}' is parent of target '{1}'.",
|
|
723
723
|
this.resourceForError(source),
|
|
724
724
|
this.resourceForError(target)
|
|
@@ -729,7 +729,7 @@ let FileService = class FileService extends Disposable {
|
|
|
729
729
|
if (exists && !isSameResourceWithDifferentPathCase) {
|
|
730
730
|
if (!overwrite) {
|
|
731
731
|
throw ( (new FileOperationError(localize(
|
|
732
|
-
|
|
732
|
+
730,
|
|
733
733
|
"Unable to move/copy '{0}' because target '{1}' already exists at destination.",
|
|
734
734
|
this.resourceForError(source),
|
|
735
735
|
this.resourceForError(target)
|
|
@@ -739,7 +739,7 @@ let FileService = class FileService extends Disposable {
|
|
|
739
739
|
const { providerExtUri } = this.getExtUri(sourceProvider);
|
|
740
740
|
if (providerExtUri.isEqualOrParent(source, target)) {
|
|
741
741
|
throw ( (new Error(localize(
|
|
742
|
-
|
|
742
|
+
731,
|
|
743
743
|
"Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",
|
|
744
744
|
this.resourceForError(source),
|
|
745
745
|
this.resourceForError(target)
|
|
@@ -784,7 +784,7 @@ let FileService = class FileService extends Disposable {
|
|
|
784
784
|
const useTrash = !!options?.useTrash;
|
|
785
785
|
if (useTrash && !((provider.capabilities & 4096) )) {
|
|
786
786
|
throw ( (new Error(localize(
|
|
787
|
-
|
|
787
|
+
732,
|
|
788
788
|
"Unable to delete file '{0}' via trash because provider does not support it.",
|
|
789
789
|
this.resourceForError(resource)
|
|
790
790
|
))));
|
|
@@ -792,14 +792,14 @@ let FileService = class FileService extends Disposable {
|
|
|
792
792
|
const atomic = options?.atomic;
|
|
793
793
|
if (atomic && !((provider.capabilities & 65536) )) {
|
|
794
794
|
throw ( (new Error(localize(
|
|
795
|
-
|
|
795
|
+
733,
|
|
796
796
|
"Unable to delete file '{0}' atomically because provider does not support it.",
|
|
797
797
|
this.resourceForError(resource)
|
|
798
798
|
))));
|
|
799
799
|
}
|
|
800
800
|
if (useTrash && atomic) {
|
|
801
801
|
throw ( (new Error(localize(
|
|
802
|
-
|
|
802
|
+
734,
|
|
803
803
|
"Unable to atomically delete file '{0}' because using trash is enabled.",
|
|
804
804
|
this.resourceForError(resource)
|
|
805
805
|
))));
|
|
@@ -815,7 +815,7 @@ let FileService = class FileService extends Disposable {
|
|
|
815
815
|
}
|
|
816
816
|
else {
|
|
817
817
|
throw ( (new FileOperationError(localize(
|
|
818
|
-
|
|
818
|
+
735,
|
|
819
819
|
"Unable to delete nonexistent file '{0}'",
|
|
820
820
|
this.resourceForError(resource)
|
|
821
821
|
), 1 )));
|
|
@@ -825,7 +825,7 @@ let FileService = class FileService extends Disposable {
|
|
|
825
825
|
const stat = await this.resolve(resource);
|
|
826
826
|
if (stat.isDirectory && Array.isArray(stat.children) && stat.children.length > 0) {
|
|
827
827
|
throw ( (new Error(localize(
|
|
828
|
-
|
|
828
|
+
736,
|
|
829
829
|
"Unable to delete non-empty folder '{0}'.",
|
|
830
830
|
this.resourceForError(resource)
|
|
831
831
|
))));
|
|
@@ -1086,7 +1086,7 @@ let FileService = class FileService extends Disposable {
|
|
|
1086
1086
|
throwIfFileSystemIsReadonly(provider, resource) {
|
|
1087
1087
|
if (provider.capabilities & 2048 ) {
|
|
1088
1088
|
throw ( (new FileOperationError(localize(
|
|
1089
|
-
|
|
1089
|
+
737,
|
|
1090
1090
|
"Unable to modify read-only file '{0}'",
|
|
1091
1091
|
this.resourceForError(resource)
|
|
1092
1092
|
), 6 )));
|
|
@@ -1096,7 +1096,7 @@ let FileService = class FileService extends Disposable {
|
|
|
1096
1096
|
throwIfFileIsReadonly(resource, stat) {
|
|
1097
1097
|
if ((stat.permissions ?? 0) & FilePermission.Readonly) {
|
|
1098
1098
|
throw ( (new FileOperationError(localize(
|
|
1099
|
-
|
|
1099
|
+
737,
|
|
1100
1100
|
"Unable to modify read-only file '{0}'",
|
|
1101
1101
|
this.resourceForError(resource)
|
|
1102
1102
|
), 6 )));
|
|
@@ -69,7 +69,7 @@ function throwIfCancelled(token) {
|
|
|
69
69
|
}
|
|
70
70
|
function throwIfTooLarge(totalBytesRead, options) {
|
|
71
71
|
if (typeof options?.limits?.size === 'number' && totalBytesRead > options.limits.size) {
|
|
72
|
-
throw createFileSystemProviderError(localize(
|
|
72
|
+
throw createFileSystemProviderError(localize(4558, "File is too large to open"), FileSystemProviderErrorCode.FileTooLarge);
|
|
73
73
|
}
|
|
74
74
|
return true;
|
|
75
75
|
}
|
|
@@ -51,8 +51,8 @@ import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
|
51
51
|
var AbstractTextFileService_1;
|
|
52
52
|
let AbstractTextFileService = class AbstractTextFileService extends Disposable {
|
|
53
53
|
static { AbstractTextFileService_1 = this; }
|
|
54
|
-
static { this.TEXTFILE_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('textFileCreate.source', ( localize(
|
|
55
|
-
static { this.TEXTFILE_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('textFileOverwrite.source', ( localize(
|
|
54
|
+
static { this.TEXTFILE_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('textFileCreate.source', ( localize(4559, "File Created"))); }
|
|
55
|
+
static { this.TEXTFILE_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('textFileOverwrite.source', ( localize(4560, "File Replaced"))); }
|
|
56
56
|
constructor(fileService, untitledTextEditorService, lifecycleService, instantiationService, modelService, environmentService, dialogService, fileDialogService, textResourceConfigurationService, filesConfigurationService, codeEditorService, pathService, workingCopyFileService, uriIdentityService, languageService, logService, elevatedFileService, decorationsService) {
|
|
57
57
|
super();
|
|
58
58
|
this.fileService = fileService;
|
|
@@ -82,7 +82,7 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
|
|
|
82
82
|
constructor(files) {
|
|
83
83
|
super();
|
|
84
84
|
this.files = files;
|
|
85
|
-
this.label = ( localize(
|
|
85
|
+
this.label = ( localize(4561, "Text File Model Decorations"));
|
|
86
86
|
this._onDidChange = this._register(( (new Emitter())));
|
|
87
87
|
this.onDidChange = this._onDidChange.event;
|
|
88
88
|
this.registerListeners();
|
|
@@ -109,20 +109,20 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
|
|
|
109
109
|
color: listErrorForeground,
|
|
110
110
|
letter: Codicon.lockSmall,
|
|
111
111
|
strikethrough: true,
|
|
112
|
-
tooltip: ( localize(
|
|
112
|
+
tooltip: ( localize(4562, "Deleted, Read-only")),
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
else if (isReadonly) {
|
|
116
116
|
return {
|
|
117
117
|
letter: Codicon.lockSmall,
|
|
118
|
-
tooltip: ( localize(
|
|
118
|
+
tooltip: ( localize(4563, "Read-only")),
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
else if (isOrphaned) {
|
|
122
122
|
return {
|
|
123
123
|
color: listErrorForeground,
|
|
124
124
|
strikethrough: true,
|
|
125
|
-
tooltip: ( localize(
|
|
125
|
+
tooltip: ( localize(4564, "Deleted")),
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
return undefined;
|
|
@@ -176,7 +176,7 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
|
|
|
176
176
|
cts.dispose(true);
|
|
177
177
|
if (error.decodeStreamErrorKind === 1 ) {
|
|
178
178
|
throw ( (new TextFileOperationError(
|
|
179
|
-
localize(
|
|
179
|
+
localize(4565, "File seems to be binary and cannot be opened as text"),
|
|
180
180
|
0 ,
|
|
181
181
|
options
|
|
182
182
|
)));
|
|
@@ -394,17 +394,17 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
|
|
|
394
394
|
const { confirmed } = await this.dialogService.confirm({
|
|
395
395
|
type: 'warning',
|
|
396
396
|
message: ( localize(
|
|
397
|
-
|
|
397
|
+
4566,
|
|
398
398
|
"'{0}' already exists. Do you want to replace it?",
|
|
399
399
|
basename(resource)
|
|
400
400
|
)),
|
|
401
401
|
detail: ( localize(
|
|
402
|
-
|
|
402
|
+
4567,
|
|
403
403
|
"A file or folder with the name '{0}' already exists in the folder '{1}'. Replacing it will overwrite its current contents.",
|
|
404
404
|
basename(resource),
|
|
405
405
|
basename(dirname(resource))
|
|
406
406
|
)),
|
|
407
|
-
primaryButton: ( localize(
|
|
407
|
+
primaryButton: ( localize(4568, "&&Replace")),
|
|
408
408
|
});
|
|
409
409
|
return confirmed;
|
|
410
410
|
}
|
|
@@ -412,12 +412,12 @@ let AbstractTextFileService = class AbstractTextFileService extends Disposable {
|
|
|
412
412
|
const { confirmed } = await this.dialogService.confirm({
|
|
413
413
|
type: 'warning',
|
|
414
414
|
message: ( localize(
|
|
415
|
-
|
|
415
|
+
4569,
|
|
416
416
|
"'{0}' is marked as read-only. Do you want to save anyway?",
|
|
417
417
|
basename(resource)
|
|
418
418
|
)),
|
|
419
|
-
detail: ( localize(
|
|
420
|
-
primaryButton: ( localize(
|
|
419
|
+
detail: ( localize(4570, "Paths can be configured as read-only via settings.")),
|
|
420
|
+
primaryButton: ( localize(4571, "&&Save Anyway"))
|
|
421
421
|
});
|
|
422
422
|
return confirmed;
|
|
423
423
|
}
|