@codingame/monaco-vscode-files-service-override 36.2.7 → 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 +2 -2
- package/vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js +6 -6
- package/vscode/src/vs/platform/files/common/fileService.d.ts +2 -2
- package/vscode/src/vs/platform/files/common/fileService.js +32 -30
- package/vscode/src/vs/platform/files/common/io.js +1 -1
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +13 -13
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +1 -1
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-files-service-override",
|
|
3
|
-
"version": "
|
|
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": "
|
|
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(
|
|
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(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
|
-
|
|
19
|
+
2308,
|
|
20
20
|
"Internal error occurred in IndexedDB File System Provider. ({0})",
|
|
21
21
|
message
|
|
22
22
|
)), FileSystemProviderErrorCode.Unknown);
|
|
@@ -37,9 +37,9 @@ export declare class FileService extends Disposable implements IFileService {
|
|
|
37
37
|
resolve(resource: URI, options: IResolveMetadataFileOptions): Promise<IFileStatWithMetadata>;
|
|
38
38
|
resolve(resource: URI, options?: IResolveFileOptions): Promise<IFileStat>;
|
|
39
39
|
private doResolveFile;
|
|
40
|
-
protected toFileStat(provider: IFileSystemProvider, resource: URI, stat: IStat | {
|
|
40
|
+
protected toFileStat(provider: IFileSystemProvider, resource: URI, stat: IStat | ({
|
|
41
41
|
type: FileType;
|
|
42
|
-
} & Partial<IStat
|
|
42
|
+
} & Partial<IStat>), siblings: number | undefined, resolveMetadata: boolean, recurse: (stat: IFileStat, siblings?: number) => boolean): Promise<IFileStat>;
|
|
43
43
|
protected toFileStat(provider: IFileSystemProvider, resource: URI, stat: IStat, siblings: number | undefined, resolveMetadata: true, recurse: (stat: IFileStat, siblings?: number) => boolean): Promise<IFileStatWithMetadata>;
|
|
44
44
|
resolveAll(toResolve: {
|
|
45
45
|
resource: URI;
|
|
@@ -14,7 +14,7 @@ import { mark } from '@codingame/monaco-vscode-api/vscode/vs/base/common/perform
|
|
|
14
14
|
import { isAbsolutePath, extUri, extUriIgnorePathCase } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
15
15
|
import { isReadableStream, peekStream, peekReadable, consumeStream, transform, newWriteableStream, isReadableBufferedStream, listenStream } from '@codingame/monaco-vscode-api/vscode/vs/base/common/stream';
|
|
16
16
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
17
|
-
import { FileType, toFileSystemProviderErrorCode, FileSystemProviderErrorCode, FileChangesEvent, FileOperationError, FileOperationResult, hasOpenReadWriteCloseCapability, hasReadWriteCapability, hasFileReadStreamCapability, ensureFileSystemProviderError, etag, FilePermission, FileSystemProviderCapabilities, hasFileRealpathCapability, FileOperationEvent, FileOperation, hasFileAtomicWriteCapability,
|
|
17
|
+
import { FileType, toFileSystemProviderErrorCode, FileSystemProviderErrorCode, FileChangesEvent, FileOperationError, FileOperationResult, hasOpenReadWriteCloseCapability, hasReadWriteCapability, hasFileReadStreamCapability, ensureFileSystemProviderError, etag, FilePermission, FileSystemProviderCapabilities, toFileOperationResult, hasFileRealpathCapability, FileOperationEvent, FileOperation, hasFileAtomicWriteCapability, hasFileAppendCapability, ETAG_DISABLED, hasFileAtomicReadCapability, NotModifiedSinceFileOperationError, TooLargeFileOperationError, hasFileFolderCopyCapability, hasFileAtomicDeleteCapability, hasFileCloneCapability } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
18
18
|
import { readFileIntoStream } from './io.js';
|
|
19
19
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
20
20
|
import { ErrorNoTelemetry } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
204
|
+
2312,
|
|
205
205
|
"Unable to resolve nonexistent file '{0}'",
|
|
206
206
|
this.resourceForError(resource)
|
|
207
207
|
)), FileOperationResult.FILE_NOT_FOUND));
|
|
@@ -305,7 +305,9 @@ let FileService = class FileService extends Disposable {
|
|
|
305
305
|
success: true
|
|
306
306
|
};
|
|
307
307
|
} catch (error) {
|
|
308
|
-
|
|
308
|
+
if (toFileOperationResult(error) !== FileOperationResult.FILE_NOT_FOUND) {
|
|
309
|
+
this.logService.trace(error);
|
|
310
|
+
}
|
|
309
311
|
return {
|
|
310
312
|
stat: undefined,
|
|
311
313
|
success: false
|
|
@@ -355,7 +357,7 @@ let FileService = class FileService extends Disposable {
|
|
|
355
357
|
async doValidateCreateFile(resource, options) {
|
|
356
358
|
if (!options?.overwrite && (await this.exists(resource))) {
|
|
357
359
|
throw ( new FileOperationError(( localize(
|
|
358
|
-
|
|
360
|
+
2313,
|
|
359
361
|
"Unable to create file '{0}' that already exists when overwrite flag is not set",
|
|
360
362
|
this.resourceForError(resource)
|
|
361
363
|
)), FileOperationResult.FILE_MODIFIED_SINCE, options));
|
|
@@ -413,7 +415,7 @@ let FileService = class FileService extends Disposable {
|
|
|
413
415
|
this._onDidRunOperation.fire(( new FileOperationEvent(resource, FileOperation.WRITE)));
|
|
414
416
|
} catch (error) {
|
|
415
417
|
throw ( new FileOperationError(( localize(
|
|
416
|
-
|
|
418
|
+
2314,
|
|
417
419
|
"Unable to write file '{0}' ({1})",
|
|
418
420
|
this.resourceForError(resource),
|
|
419
421
|
(ensureFileSystemProviderError(error).toString())
|
|
@@ -445,14 +447,14 @@ let FileService = class FileService extends Disposable {
|
|
|
445
447
|
const unlock = !!options?.unlock;
|
|
446
448
|
if (unlock && !(provider.capabilities & FileSystemProviderCapabilities.FileWriteUnlock)) {
|
|
447
449
|
throw ( new Error(( localize(
|
|
448
|
-
|
|
450
|
+
2315,
|
|
449
451
|
"Unable to unlock file '{0}' because provider does not support it.",
|
|
450
452
|
this.resourceForError(resource)
|
|
451
453
|
))));
|
|
452
454
|
}
|
|
453
455
|
if (options?.append && !hasFileAppendCapability(provider)) {
|
|
454
456
|
throw ( new FileOperationError(( localize(
|
|
455
|
-
|
|
457
|
+
2316,
|
|
456
458
|
"Filesystem provider for scheme '{0}' does not does not support append",
|
|
457
459
|
this.resourceForError(resource)
|
|
458
460
|
)), FileOperationResult.FILE_PERMISSION_DENIED));
|
|
@@ -461,21 +463,21 @@ let FileService = class FileService extends Disposable {
|
|
|
461
463
|
if (atomic) {
|
|
462
464
|
if (!(provider.capabilities & FileSystemProviderCapabilities.FileAtomicWrite)) {
|
|
463
465
|
throw ( new Error(( localize(
|
|
464
|
-
|
|
466
|
+
2317,
|
|
465
467
|
"Unable to atomically write file '{0}' because provider does not support it.",
|
|
466
468
|
this.resourceForError(resource)
|
|
467
469
|
))));
|
|
468
470
|
}
|
|
469
471
|
if (!(provider.capabilities & FileSystemProviderCapabilities.FileReadWrite)) {
|
|
470
472
|
throw ( new Error(( localize(
|
|
471
|
-
|
|
473
|
+
2318,
|
|
472
474
|
"Unable to atomically write file '{0}' because provider does not support unbuffered writes.",
|
|
473
475
|
this.resourceForError(resource)
|
|
474
476
|
))));
|
|
475
477
|
}
|
|
476
478
|
if (unlock) {
|
|
477
479
|
throw ( new Error(( localize(
|
|
478
|
-
|
|
480
|
+
2319,
|
|
479
481
|
"Unable to unlock file '{0}' because atomic write is enabled.",
|
|
480
482
|
this.resourceForError(resource)
|
|
481
483
|
))));
|
|
@@ -489,7 +491,7 @@ let FileService = class FileService extends Disposable {
|
|
|
489
491
|
}
|
|
490
492
|
if ((stat.type & FileType.Directory) !== 0) {
|
|
491
493
|
throw ( new FileOperationError(( localize(
|
|
492
|
-
|
|
494
|
+
2320,
|
|
493
495
|
"Unable to write file '{0}' that is actually a directory",
|
|
494
496
|
this.resourceForError(resource)
|
|
495
497
|
)), FileOperationResult.FILE_IS_DIRECTORY, options));
|
|
@@ -518,7 +520,7 @@ let FileService = class FileService extends Disposable {
|
|
|
518
520
|
}
|
|
519
521
|
} catch (error) {}
|
|
520
522
|
}
|
|
521
|
-
throw ( new FileOperationError(( localize(
|
|
523
|
+
throw ( new FileOperationError(( localize(2321, "File Modified Since")), FileOperationResult.FILE_MODIFIED_SINCE, options));
|
|
522
524
|
}
|
|
523
525
|
return {
|
|
524
526
|
stat,
|
|
@@ -602,7 +604,7 @@ let FileService = class FileService extends Disposable {
|
|
|
602
604
|
}
|
|
603
605
|
restoreReadError(error, resource, options) {
|
|
604
606
|
const message = ( localize(
|
|
605
|
-
|
|
607
|
+
2322,
|
|
606
608
|
"Unable to read file '{0}' ({1})",
|
|
607
609
|
this.resourceForError(resource),
|
|
608
610
|
(ensureFileSystemProviderError(error).toString())
|
|
@@ -664,13 +666,13 @@ let FileService = class FileService extends Disposable {
|
|
|
664
666
|
});
|
|
665
667
|
if (stat.isDirectory) {
|
|
666
668
|
throw ( new FileOperationError(( localize(
|
|
667
|
-
|
|
669
|
+
2323,
|
|
668
670
|
"Unable to read file '{0}' that is actually a directory",
|
|
669
671
|
this.resourceForError(resource)
|
|
670
672
|
)), FileOperationResult.FILE_IS_DIRECTORY, options));
|
|
671
673
|
}
|
|
672
674
|
if (typeof options?.etag === "string" && options.etag !== ETAG_DISABLED && options.etag === stat.etag) {
|
|
673
|
-
throw ( new NotModifiedSinceFileOperationError(( localize(
|
|
675
|
+
throw ( new NotModifiedSinceFileOperationError(( localize(2324, "File not modified since")), stat, options));
|
|
674
676
|
}
|
|
675
677
|
this.validateReadFileLimits(resource, stat.size, options);
|
|
676
678
|
return stat;
|
|
@@ -678,7 +680,7 @@ let FileService = class FileService extends Disposable {
|
|
|
678
680
|
validateReadFileLimits(resource, size, options) {
|
|
679
681
|
if (typeof options?.limits?.size === "number" && size > options.limits.size) {
|
|
680
682
|
throw ( new TooLargeFileOperationError(( localize(
|
|
681
|
-
|
|
683
|
+
2325,
|
|
682
684
|
"Unable to read file '{0}' that is too large to open",
|
|
683
685
|
this.resourceForError(resource)
|
|
684
686
|
)), FileOperationResult.FILE_TOO_LARGE, size, options));
|
|
@@ -823,7 +825,7 @@ let FileService = class FileService extends Disposable {
|
|
|
823
825
|
}
|
|
824
826
|
if (isSameResourceWithDifferentPathCase && mode === "copy") {
|
|
825
827
|
throw ( new Error(( localize(
|
|
826
|
-
|
|
828
|
+
2326,
|
|
827
829
|
"Unable to copy when source '{0}' is same as target '{1}' with different path case on a case insensitive file system",
|
|
828
830
|
this.resourceForError(source),
|
|
829
831
|
this.resourceForError(target)
|
|
@@ -831,7 +833,7 @@ let FileService = class FileService extends Disposable {
|
|
|
831
833
|
}
|
|
832
834
|
if (!isSameResourceWithDifferentPathCase && providerExtUri.isEqualOrParent(target, source)) {
|
|
833
835
|
throw ( new Error(( localize(
|
|
834
|
-
|
|
836
|
+
2327,
|
|
835
837
|
"Unable to move/copy when source '{0}' is parent of target '{1}'.",
|
|
836
838
|
this.resourceForError(source),
|
|
837
839
|
this.resourceForError(target)
|
|
@@ -842,7 +844,7 @@ let FileService = class FileService extends Disposable {
|
|
|
842
844
|
if (exists && !isSameResourceWithDifferentPathCase) {
|
|
843
845
|
if (!overwrite) {
|
|
844
846
|
throw ( new FileOperationError(( localize(
|
|
845
|
-
|
|
847
|
+
2328,
|
|
846
848
|
"Unable to move/copy '{0}' because target '{1}' already exists at destination.",
|
|
847
849
|
this.resourceForError(source),
|
|
848
850
|
this.resourceForError(target)
|
|
@@ -854,7 +856,7 @@ let FileService = class FileService extends Disposable {
|
|
|
854
856
|
} = this.getExtUri(sourceProvider);
|
|
855
857
|
if (providerExtUri.isEqualOrParent(source, target)) {
|
|
856
858
|
throw ( new Error(( localize(
|
|
857
|
-
|
|
859
|
+
2329,
|
|
858
860
|
"Unable to move/copy '{0}' into '{1}' since a file would replace the folder it is contained in.",
|
|
859
861
|
this.resourceForError(source),
|
|
860
862
|
this.resourceForError(target)
|
|
@@ -905,7 +907,7 @@ let FileService = class FileService extends Disposable {
|
|
|
905
907
|
const useTrash = !!options?.useTrash;
|
|
906
908
|
if (useTrash && !(provider.capabilities & FileSystemProviderCapabilities.Trash)) {
|
|
907
909
|
throw ( new Error(( localize(
|
|
908
|
-
|
|
910
|
+
2330,
|
|
909
911
|
"Unable to delete file '{0}' via trash because provider does not support it.",
|
|
910
912
|
this.resourceForError(resource)
|
|
911
913
|
))));
|
|
@@ -913,14 +915,14 @@ let FileService = class FileService extends Disposable {
|
|
|
913
915
|
const atomic = options?.atomic;
|
|
914
916
|
if (atomic && !(provider.capabilities & FileSystemProviderCapabilities.FileAtomicDelete)) {
|
|
915
917
|
throw ( new Error(( localize(
|
|
916
|
-
|
|
918
|
+
2331,
|
|
917
919
|
"Unable to delete file '{0}' atomically because provider does not support it.",
|
|
918
920
|
this.resourceForError(resource)
|
|
919
921
|
))));
|
|
920
922
|
}
|
|
921
923
|
if (useTrash && atomic) {
|
|
922
924
|
throw ( new Error(( localize(
|
|
923
|
-
|
|
925
|
+
2332,
|
|
924
926
|
"Unable to atomically delete file '{0}' because using trash is enabled.",
|
|
925
927
|
this.resourceForError(resource)
|
|
926
928
|
))));
|
|
@@ -933,7 +935,7 @@ let FileService = class FileService extends Disposable {
|
|
|
933
935
|
this.throwIfFileIsReadonly(resource, stat);
|
|
934
936
|
} else {
|
|
935
937
|
throw ( new FileOperationError(( localize(
|
|
936
|
-
|
|
938
|
+
2333,
|
|
937
939
|
"Unable to delete nonexistent file '{0}'",
|
|
938
940
|
this.resourceForError(resource)
|
|
939
941
|
)), FileOperationResult.FILE_NOT_FOUND));
|
|
@@ -943,7 +945,7 @@ let FileService = class FileService extends Disposable {
|
|
|
943
945
|
const stat = await this.resolve(resource);
|
|
944
946
|
if (stat.isDirectory && Array.isArray(stat.children) && stat.children.length > 0) {
|
|
945
947
|
throw ( new Error(( localize(
|
|
946
|
-
|
|
948
|
+
2334,
|
|
947
949
|
"Unable to delete non-empty folder '{0}'.",
|
|
948
950
|
this.resourceForError(resource)
|
|
949
951
|
))));
|
|
@@ -1276,7 +1278,7 @@ let FileService = class FileService extends Disposable {
|
|
|
1276
1278
|
throwIfFileSystemIsReadonly(provider, resource) {
|
|
1277
1279
|
if (provider.capabilities & FileSystemProviderCapabilities.Readonly) {
|
|
1278
1280
|
throw ( new FileOperationError(( localize(
|
|
1279
|
-
|
|
1281
|
+
2335,
|
|
1280
1282
|
"Unable to modify read-only file '{0}'",
|
|
1281
1283
|
this.resourceForError(resource)
|
|
1282
1284
|
)), FileOperationResult.FILE_PERMISSION_DENIED));
|
|
@@ -1286,7 +1288,7 @@ let FileService = class FileService extends Disposable {
|
|
|
1286
1288
|
throwIfFileIsReadonly(resource, stat) {
|
|
1287
1289
|
if ((stat.permissions ?? 0) & FilePermission.Readonly) {
|
|
1288
1290
|
throw ( new FileOperationError(( localize(
|
|
1289
|
-
|
|
1291
|
+
2335,
|
|
1290
1292
|
"Unable to modify read-only file '{0}'",
|
|
1291
1293
|
this.resourceForError(resource)
|
|
1292
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
484
|
+
20058,
|
|
485
485
|
"'{0}' already exists. Do you want to replace it?",
|
|
486
486
|
basename(resource)
|
|
487
487
|
)),
|
|
488
488
|
detail: ( localize(
|
|
489
|
-
|
|
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(
|
|
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
|
-
|
|
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(
|
|
509
|
-
primaryButton: ( localize(
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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) => {
|