@codingame/monaco-vscode-files-service-override 1.85.6 → 2.0.0-v2.1
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/files.js +17 -19
- package/index.js +3 -4
- package/package.json +4 -4
- package/vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js +10 -10
- package/vscode/src/vs/platform/files/common/fileService.js +17 -17
- package/vscode/src/vs/platform/files/common/io.js +4 -4
- package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +8 -8
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +23 -23
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +15 -15
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +7 -7
- package/vscode/src/vs/platform/files/common/files.js +0 -241
package/files.js
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import { __decorate, __param } from './external/tslib/tslib.es6.js';
|
|
2
|
-
import { SyncDescriptor } from '
|
|
2
|
+
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
3
3
|
import { FileService } from './vscode/src/vs/platform/files/common/fileService.js';
|
|
4
|
-
import { ILogService } from '
|
|
4
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
5
5
|
import { InMemoryFileSystemProvider } from 'vscode/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
6
6
|
export { InMemoryFileSystemProvider } from 'vscode/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
7
|
-
import { URI } from '
|
|
8
|
-
import { FileType, FilePermission, toFileSystemProviderErrorCode } from '
|
|
9
|
-
export { FileChangeType, FileSystemProviderCapabilities } from '
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
export { HTMLFileSystemProvider } from 'monaco-editor/esm/vs/platform/files/browser/htmlFileSystemProvider.js';
|
|
16
|
-
import * as path from 'monaco-editor/esm/vs/base/common/path.js';
|
|
7
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
8
|
+
import { FileType, FilePermission, createFileSystemProviderError, FileSystemProviderErrorCode, FileSystemProviderError, IFileService, toFileSystemProviderErrorCode } from 'vscode/vscode/vs/platform/files/common/files';
|
|
9
|
+
export { FileChangeType, FilePermission, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType } from 'vscode/vscode/vs/platform/files/common/files';
|
|
10
|
+
import { Disposable, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
11
|
+
import { extUri, joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
12
|
+
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
13
|
+
export { HTMLFileSystemProvider } from 'vscode/vscode/vs/platform/files/browser/htmlFileSystemProvider';
|
|
14
|
+
import { relative } from 'vscode/vscode/vs/base/common/path';
|
|
17
15
|
import 'vscode/vscode/vs/workbench/contrib/files/browser/files.contribution';
|
|
18
|
-
import { Schemas } from '
|
|
16
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
19
17
|
import { IndexedDBFileSystemProvider } from './vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js';
|
|
20
|
-
import { IndexedDB } from '
|
|
21
|
-
export { IndexedDB } from '
|
|
22
|
-
import { ITelemetryService } from '
|
|
18
|
+
import { IndexedDB } from 'vscode/vscode/vs/base/browser/indexedDB';
|
|
19
|
+
export { IndexedDB } from 'vscode/vscode/vs/base/browser/indexedDB';
|
|
20
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
23
21
|
import { BufferLogger } from 'vscode/vscode/vs/platform/log/common/bufferLog';
|
|
24
|
-
import { localizeWithPath } from '
|
|
22
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
25
23
|
import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles';
|
|
26
24
|
import { BrowserTextFileService } from './vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js';
|
|
27
25
|
import { IFilesConfigurationService, FilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
@@ -169,7 +167,7 @@ class RegisteredFileSystemProvider extends Disposable {
|
|
|
169
167
|
}
|
|
170
168
|
async readdir(resource) {
|
|
171
169
|
const includedPaths = ( Array.from(( this.files.keys()))
|
|
172
|
-
.map(uri =>
|
|
170
|
+
.map(uri => relative(resource.path, ( URI.parse(uri)).path)))
|
|
173
171
|
.filter(path => !path.startsWith('..'));
|
|
174
172
|
const files = includedPaths.filter(path => !path.includes('/'));
|
|
175
173
|
const directories = ( includedPaths.filter(path => path.includes('/')).map(path => path.slice(0, path.indexOf('/'))));
|
|
@@ -526,4 +524,4 @@ function registerFileSystemOverlay(priority, provider) {
|
|
|
526
524
|
return fileSystemProvider.register(priority, provider);
|
|
527
525
|
}
|
|
528
526
|
|
|
529
|
-
export { CustomSchemas, DelegateFileSystemProvider,
|
|
527
|
+
export { CustomSchemas, DelegateFileSystemProvider, IndexedDBFileSystemProvider, RegisteredFile, RegisteredFileSystemProvider, RegisteredMemoryFile, RegisteredReadOnlyFile, createIndexedDBProviders, getServiceOverride as default, initFile, registerCustomProvider, registerExtensionFile, registerFileSystemOverlay };
|
package/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { CustomSchemas, DelegateFileSystemProvider, RegisteredFile, RegisteredFileSystemProvider, RegisteredMemoryFile, RegisteredReadOnlyFile, createIndexedDBProviders, default, initFile, registerCustomProvider, registerExtensionFile, registerFileSystemOverlay } from './files.js';
|
|
2
|
-
export { FileChangeType, FilePermission, FileSystemProviderCapabilities, FileType } from '
|
|
3
|
-
export {
|
|
4
|
-
export { HTMLFileSystemProvider } from 'monaco-editor/esm/vs/platform/files/browser/htmlFileSystemProvider.js';
|
|
5
|
-
export { IndexedDB } from 'monaco-editor/esm/vs/base/browser/indexedDB.js';
|
|
2
|
+
export { FileChangeType, FilePermission, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType } from 'vscode/vscode/vs/platform/files/common/files';
|
|
3
|
+
export { HTMLFileSystemProvider } from 'vscode/vscode/vs/platform/files/browser/htmlFileSystemProvider';
|
|
6
4
|
export { InMemoryFileSystemProvider } from 'vscode/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
5
|
+
export { IndexedDB } from 'vscode/vscode/vs/base/browser/indexedDB';
|
|
7
6
|
export { IndexedDBFileSystemProvider } from './vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-files-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-v2.1",
|
|
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
|
|
12
|
+
"url": "git@github.com:CodinGame/monaco-vscode-api.git"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
15
|
"private": false,
|
|
@@ -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@
|
|
22
|
-
"
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.0.0-v2.1",
|
|
22
|
+
"vscode-marked": "npm:marked@=3.0.2"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Throttler } from '
|
|
2
|
-
import { VSBuffer } from '
|
|
3
|
-
import { Event, Emitter } from '
|
|
4
|
-
import { Disposable } from '
|
|
5
|
-
import { ExtUri } from '
|
|
6
|
-
import { isString } from '
|
|
7
|
-
import { URI } from '
|
|
8
|
-
import { localizeWithPath } from '
|
|
9
|
-
import { createFileSystemProviderError, FileSystemProviderErrorCode, FileType, FileSystemProviderError } from '
|
|
10
|
-
import { DBClosedError } from '
|
|
1
|
+
import { Throttler } from 'vscode/vscode/vs/base/common/async';
|
|
2
|
+
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
3
|
+
import { Event, Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { ExtUri } from 'vscode/vscode/vs/base/common/resources';
|
|
6
|
+
import { isString } from 'vscode/vscode/vs/base/common/types';
|
|
7
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
8
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
9
|
+
import { createFileSystemProviderError, FileSystemProviderErrorCode, FileType, FileSystemProviderError } from 'vscode/vscode/vs/platform/files/common/files';
|
|
10
|
+
import { DBClosedError } from 'vscode/vscode/vs/base/browser/indexedDB';
|
|
11
11
|
import { BroadcastDataChannel } from 'vscode/vscode/vs/base/browser/broadcast';
|
|
12
12
|
|
|
13
13
|
const ERR_FILE_NOT_FOUND = createFileSystemProviderError(( localizeWithPath(
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { coalesce } from '
|
|
3
|
-
import { ResourceQueue, Promises } from '
|
|
4
|
-
import { VSBuffer, bufferToReadable, streamToBuffer, newWriteableBufferStream, bufferedStreamToBuffer, readableToBuffer } from '
|
|
5
|
-
import { CancellationTokenSource, CancellationToken } from '
|
|
6
|
-
import { Emitter } from '
|
|
7
|
-
import { hash } from '
|
|
8
|
-
import { Iterable } from '
|
|
9
|
-
import { Disposable, DisposableStore, toDisposable, dispose } from '
|
|
10
|
-
import { TernarySearchTree } from '
|
|
11
|
-
import { Schemas } from '
|
|
12
|
-
import { mark } from '
|
|
13
|
-
import { isAbsolutePath, extUri, extUriIgnorePathCase } from '
|
|
14
|
-
import { isReadableStream, peekStream, peekReadable, consumeStream, transform, newWriteableStream, isReadableBufferedStream, listenStream } from '
|
|
15
|
-
import { localizeWithPath } from '
|
|
16
|
-
import { FileChangesEvent, FileOperationError, hasOpenReadWriteCloseCapability, hasReadWriteCapability, hasFileReadStreamCapability, toFileSystemProviderErrorCode, FileSystemProviderErrorCode, ensureFileSystemProviderError, FileType, FilePermission, etag, FileOperationEvent, hasFileAtomicWriteCapability, toFileOperationResult, ETAG_DISABLED, hasFileAtomicReadCapability, NotModifiedSinceFileOperationError, TooLargeFileOperationError, hasFileFolderCopyCapability, hasFileAtomicDeleteCapability, hasFileCloneCapability } from '
|
|
2
|
+
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
3
|
+
import { ResourceQueue, Promises } from 'vscode/vscode/vs/base/common/async';
|
|
4
|
+
import { VSBuffer, bufferToReadable, streamToBuffer, newWriteableBufferStream, bufferedStreamToBuffer, readableToBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
5
|
+
import { CancellationTokenSource, CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
6
|
+
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
7
|
+
import { hash } from 'vscode/vscode/vs/base/common/hash';
|
|
8
|
+
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
9
|
+
import { Disposable, DisposableStore, toDisposable, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
10
|
+
import { TernarySearchTree } from 'vscode/vscode/vs/base/common/ternarySearchTree';
|
|
11
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
12
|
+
import { mark } from 'vscode/vscode/vs/base/common/performance';
|
|
13
|
+
import { isAbsolutePath, extUri, extUriIgnorePathCase } from 'vscode/vscode/vs/base/common/resources';
|
|
14
|
+
import { isReadableStream, peekStream, peekReadable, consumeStream, transform, newWriteableStream, isReadableBufferedStream, listenStream } from 'vscode/vscode/vs/base/common/stream';
|
|
15
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
16
|
+
import { FileChangesEvent, FileOperationError, hasOpenReadWriteCloseCapability, hasReadWriteCapability, hasFileReadStreamCapability, toFileSystemProviderErrorCode, FileSystemProviderErrorCode, ensureFileSystemProviderError, FileType, FilePermission, etag, FileOperationEvent, hasFileAtomicWriteCapability, toFileOperationResult, ETAG_DISABLED, hasFileAtomicReadCapability, NotModifiedSinceFileOperationError, TooLargeFileOperationError, hasFileFolderCopyCapability, hasFileAtomicDeleteCapability, hasFileCloneCapability } from 'vscode/vscode/vs/platform/files/common/files';
|
|
17
17
|
import { readFileIntoStream } from './io.js';
|
|
18
|
-
import { ILogService } from '
|
|
19
|
-
import { ErrorNoTelemetry } from '
|
|
18
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
19
|
+
import { ErrorNoTelemetry } from 'vscode/vscode/vs/base/common/errors';
|
|
20
20
|
|
|
21
21
|
var FileService_1;
|
|
22
22
|
let FileService = class FileService extends Disposable {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { VSBuffer } from '
|
|
2
|
-
import { canceled } from '
|
|
3
|
-
import { localizeWithPath } from '
|
|
4
|
-
import { ensureFileSystemProviderError, createFileSystemProviderError, FileSystemProviderErrorCode } from '
|
|
1
|
+
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
2
|
+
import { canceled } from 'vscode/vscode/vs/base/common/errors';
|
|
3
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
+
import { ensureFileSystemProviderError, createFileSystemProviderError, FileSystemProviderErrorCode } from 'vscode/vscode/vs/platform/files/common/files';
|
|
5
5
|
|
|
6
6
|
async function readFileIntoStream(provider, resource, target, transformer, options, token) {
|
|
7
7
|
let error = undefined;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { AbstractTextFileService } from './textFileService.js';
|
|
3
3
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
4
|
-
import { ICodeEditorService } from '
|
|
5
|
-
import { IModelService } from '
|
|
6
|
-
import { ILanguageService } from '
|
|
7
|
-
import { ITextResourceConfigurationService } from '
|
|
4
|
+
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
5
|
+
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
6
|
+
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
7
|
+
import { ITextResourceConfigurationService } from 'vscode/vscode/vs/editor/common/services/textResourceConfiguration';
|
|
8
8
|
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
9
|
-
import { IFileService } from '
|
|
10
|
-
import { IInstantiationService } from '
|
|
11
|
-
import { ILogService } from '
|
|
9
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
10
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
12
12
|
import { IElevatedFileService } from 'vscode/vscode/vs/workbench/services/files/common/elevatedFileService';
|
|
13
13
|
import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
14
14
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
15
15
|
import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService';
|
|
16
16
|
import { IUntitledTextEditorService } from 'vscode/vscode/vs/workbench/services/untitled/common/untitledTextEditorService';
|
|
17
|
-
import { IUriIdentityService } from '
|
|
17
|
+
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
18
18
|
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService';
|
|
19
19
|
import { IDecorationsService } from 'vscode/vscode/vs/workbench/services/decorations/common/decorations';
|
|
20
20
|
import { IDialogService, IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from '
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { TextFileOperationError, toBufferOrReadable, stringToSnapshot } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles';
|
|
4
4
|
import { SaveSourceRegistry } from 'vscode/vscode/vs/workbench/common/editor';
|
|
5
5
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
6
|
-
import { IFileService } from '
|
|
7
|
-
import { Disposable } from '
|
|
8
|
-
import { extname } from '
|
|
6
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
7
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
8
|
+
import { extname } from 'vscode/vscode/vs/base/common/path';
|
|
9
9
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
10
10
|
import { IUntitledTextEditorService } from 'vscode/vscode/vs/workbench/services/untitled/common/untitledTextEditorService';
|
|
11
11
|
import { UntitledTextEditorModel } from 'vscode/vscode/vs/workbench/services/untitled/common/untitledTextEditorModel';
|
|
12
12
|
import { TextFileEditorModelManager } from '../common/textFileEditorModelManager.js';
|
|
13
|
-
import { IInstantiationService } from '
|
|
14
|
-
import { Schemas } from '
|
|
15
|
-
import { createTextBufferFactoryFromStream, createTextBufferFactoryFromSnapshot } from '
|
|
16
|
-
import { IModelService } from '
|
|
17
|
-
import { isEqual, toLocalResource, basename, dirname, joinPath, extname as extname$1 } from '
|
|
13
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
14
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
15
|
+
import { createTextBufferFactoryFromStream, createTextBufferFactoryFromSnapshot } from 'vscode/vscode/vs/editor/common/model/textModel';
|
|
16
|
+
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
17
|
+
import { isEqual, toLocalResource, basename, dirname, joinPath, extname as extname$1 } from 'vscode/vscode/vs/base/common/resources';
|
|
18
18
|
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
19
|
-
import { bufferToStream } from '
|
|
20
|
-
import { ITextResourceConfigurationService } from '
|
|
21
|
-
import { PLAINTEXT_LANGUAGE_ID } from '
|
|
19
|
+
import { bufferToStream } from 'vscode/vscode/vs/base/common/buffer';
|
|
20
|
+
import { ITextResourceConfigurationService } from 'vscode/vscode/vs/editor/common/services/textResourceConfiguration';
|
|
21
|
+
import { PLAINTEXT_LANGUAGE_ID } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
|
|
22
22
|
import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
23
23
|
import { BaseTextEditorModel } from 'vscode/vscode/vs/workbench/common/editor/textEditorModel';
|
|
24
|
-
import { ICodeEditorService } from '
|
|
24
|
+
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
25
25
|
import { IPathService } from 'vscode/vscode/vs/workbench/services/path/common/pathService';
|
|
26
26
|
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService';
|
|
27
|
-
import { IUriIdentityService } from '
|
|
28
|
-
import { WORKSPACE_EXTENSION, IWorkspaceContextService } from '
|
|
27
|
+
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
28
|
+
import { WORKSPACE_EXTENSION, IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
29
29
|
import { UTF8, toEncodeReadable, toDecodeStream, UTF16be, UTF16le, UTF8_with_bom, encodingExists } from 'vscode/vscode/vs/workbench/services/textfile/common/encoding';
|
|
30
|
-
import { consumeStream } from '
|
|
31
|
-
import { ILanguageService } from '
|
|
32
|
-
import { ILogService } from '
|
|
33
|
-
import { CancellationTokenSource, CancellationToken } from '
|
|
30
|
+
import { consumeStream } from 'vscode/vscode/vs/base/common/stream';
|
|
31
|
+
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
32
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
33
|
+
import { CancellationTokenSource, CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
34
34
|
import { IElevatedFileService } from 'vscode/vscode/vs/workbench/services/files/common/elevatedFileService';
|
|
35
35
|
import { IDecorationsService } from 'vscode/vscode/vs/workbench/services/decorations/common/decorations';
|
|
36
|
-
import { Emitter } from '
|
|
37
|
-
import { Codicon } from '
|
|
38
|
-
import { listErrorForeground } from '
|
|
39
|
-
import { firstOrDefault } from '
|
|
36
|
+
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
37
|
+
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
38
|
+
import { listErrorForeground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
39
|
+
import { firstOrDefault } from 'vscode/vscode/vs/base/common/arrays';
|
|
40
40
|
import { IDialogService, IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
41
41
|
|
|
42
42
|
var AbstractTextFileService_1;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from '
|
|
3
|
-
import { toErrorMessage } from '
|
|
4
|
-
import { Emitter, Event } from '
|
|
5
|
-
import { URI } from '
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { toErrorMessage } from 'vscode/vscode/vs/base/common/errorMessage';
|
|
4
|
+
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
5
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
6
6
|
import { TextFileEditorModel } from 'vscode/vscode/vs/workbench/services/textfile/common/textFileEditorModel';
|
|
7
|
-
import { Disposable, DisposableStore, dispose } from '
|
|
8
|
-
import { IInstantiationService } from '
|
|
9
|
-
import { ResourceMap } from '
|
|
10
|
-
import { IFileService } from '
|
|
11
|
-
import { ResourceQueue, Promises } from '
|
|
12
|
-
import { onUnexpectedError } from '
|
|
7
|
+
import { Disposable, DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
8
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
|
+
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
10
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
11
|
+
import { ResourceQueue, Promises } from 'vscode/vscode/vs/base/common/async';
|
|
12
|
+
import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
13
13
|
import { TextFileSaveParticipant } from './textFileSaveParticipant.js';
|
|
14
|
-
import { INotificationService } from '
|
|
14
|
+
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
15
15
|
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService';
|
|
16
|
-
import { joinPath, extname } from '
|
|
17
|
-
import { createTextBufferFactoryFromSnapshot } from '
|
|
18
|
-
import { PLAINTEXT_LANGUAGE_ID, PLAINTEXT_EXTENSION } from '
|
|
19
|
-
import { IUriIdentityService } from '
|
|
16
|
+
import { joinPath, extname } from 'vscode/vscode/vs/base/common/resources';
|
|
17
|
+
import { createTextBufferFactoryFromSnapshot } from 'vscode/vscode/vs/editor/common/model/textModel';
|
|
18
|
+
import { PLAINTEXT_LANGUAGE_ID, PLAINTEXT_EXTENSION } from 'vscode/vscode/vs/editor/common/languages/modesRegistry';
|
|
19
|
+
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
20
20
|
|
|
21
21
|
let TextFileEditorModelManager = class TextFileEditorModelManager extends Disposable {
|
|
22
22
|
get models() {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from '
|
|
3
|
-
import { raceCancellation } from '
|
|
4
|
-
import { CancellationTokenSource } from '
|
|
5
|
-
import { ILogService } from '
|
|
6
|
-
import { IProgressService } from '
|
|
7
|
-
import { Disposable, toDisposable } from '
|
|
8
|
-
import { insert } from '
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { raceCancellation } from 'vscode/vscode/vs/base/common/async';
|
|
4
|
+
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
5
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
6
|
+
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
7
|
+
import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
8
|
+
import { insert } from 'vscode/vscode/vs/base/common/arrays';
|
|
9
9
|
|
|
10
10
|
let TextFileSaveParticipant = class TextFileSaveParticipant extends Disposable {
|
|
11
11
|
constructor(progressService, logService) {
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { TernarySearchTree } from 'monaco-editor/esm/vs/base/common/ternarySearchTree.js';
|
|
2
|
-
import { isNumber } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
3
|
-
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
4
|
-
import { Lazy } from 'monaco-editor/esm/vs/base/common/lazy.js';
|
|
5
|
-
|
|
6
|
-
var FileType;
|
|
7
|
-
( (function(FileType) {
|
|
8
|
-
FileType[FileType["Unknown"] = 0] = "Unknown";
|
|
9
|
-
FileType[FileType["File"] = 1] = "File";
|
|
10
|
-
FileType[FileType["Directory"] = 2] = "Directory";
|
|
11
|
-
FileType[FileType["SymbolicLink"] = 64] = "SymbolicLink";
|
|
12
|
-
})(FileType || (FileType = {})));
|
|
13
|
-
var FilePermission;
|
|
14
|
-
( (function(FilePermission) {
|
|
15
|
-
FilePermission[FilePermission["Readonly"] = 1] = "Readonly";
|
|
16
|
-
FilePermission[FilePermission["Locked"] = 2] = "Locked";
|
|
17
|
-
})(FilePermission || (FilePermission = {})));
|
|
18
|
-
var FileSystemProviderCapabilities;
|
|
19
|
-
( (function(FileSystemProviderCapabilities) {
|
|
20
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["None"] = 0] = "None";
|
|
21
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["FileReadWrite"] = 2] = "FileReadWrite";
|
|
22
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["FileOpenReadWriteClose"] = 4] = "FileOpenReadWriteClose";
|
|
23
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["FileReadStream"] = 16] = "FileReadStream";
|
|
24
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["FileFolderCopy"] = 8] = "FileFolderCopy";
|
|
25
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["PathCaseSensitive"] = 1024] = "PathCaseSensitive";
|
|
26
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["Readonly"] = 2048] = "Readonly";
|
|
27
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["Trash"] = 4096] = "Trash";
|
|
28
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["FileWriteUnlock"] = 8192] = "FileWriteUnlock";
|
|
29
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["FileAtomicRead"] = 16384] = "FileAtomicRead";
|
|
30
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["FileAtomicWrite"] = 32768] = "FileAtomicWrite";
|
|
31
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["FileAtomicDelete"] = 65536] = "FileAtomicDelete";
|
|
32
|
-
FileSystemProviderCapabilities[FileSystemProviderCapabilities["FileClone"] = 131072] = "FileClone";
|
|
33
|
-
})(FileSystemProviderCapabilities || (FileSystemProviderCapabilities = {})));
|
|
34
|
-
var FileSystemProviderErrorCode;
|
|
35
|
-
( (function(FileSystemProviderErrorCode) {
|
|
36
|
-
FileSystemProviderErrorCode["FileExists"] = "EntryExists";
|
|
37
|
-
FileSystemProviderErrorCode["FileNotFound"] = "EntryNotFound";
|
|
38
|
-
FileSystemProviderErrorCode["FileNotADirectory"] = "EntryNotADirectory";
|
|
39
|
-
FileSystemProviderErrorCode["FileIsADirectory"] = "EntryIsADirectory";
|
|
40
|
-
FileSystemProviderErrorCode["FileExceedsStorageQuota"] = "EntryExceedsStorageQuota";
|
|
41
|
-
FileSystemProviderErrorCode["FileTooLarge"] = "EntryTooLarge";
|
|
42
|
-
FileSystemProviderErrorCode["FileWriteLocked"] = "EntryWriteLocked";
|
|
43
|
-
FileSystemProviderErrorCode["NoPermissions"] = "NoPermissions";
|
|
44
|
-
FileSystemProviderErrorCode["Unavailable"] = "Unavailable";
|
|
45
|
-
FileSystemProviderErrorCode["Unknown"] = "Unknown";
|
|
46
|
-
})(FileSystemProviderErrorCode || (FileSystemProviderErrorCode = {})));
|
|
47
|
-
class FileSystemProviderError extends Error {
|
|
48
|
-
static create(error, code) {
|
|
49
|
-
const providerError = ( new FileSystemProviderError(( error.toString()), code));
|
|
50
|
-
markAsFileSystemProviderError(providerError, code);
|
|
51
|
-
return providerError;
|
|
52
|
-
}
|
|
53
|
-
constructor(message, code) {
|
|
54
|
-
super(message);
|
|
55
|
-
this.code = code;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function markAsFileSystemProviderError(error, code) {
|
|
59
|
-
error.name = code ? `${code} (FileSystemError)` : `FileSystemError`;
|
|
60
|
-
return error;
|
|
61
|
-
}
|
|
62
|
-
function toFileSystemProviderErrorCode(error) {
|
|
63
|
-
if (!error) {
|
|
64
|
-
return FileSystemProviderErrorCode.Unknown;
|
|
65
|
-
}
|
|
66
|
-
if (error instanceof FileSystemProviderError) {
|
|
67
|
-
return error.code;
|
|
68
|
-
}
|
|
69
|
-
const match = /^(.+) \(FileSystemError\)$/.exec(error.name);
|
|
70
|
-
if (!match) {
|
|
71
|
-
return FileSystemProviderErrorCode.Unknown;
|
|
72
|
-
}
|
|
73
|
-
switch (match[1]) {
|
|
74
|
-
case FileSystemProviderErrorCode.FileExists: return FileSystemProviderErrorCode.FileExists;
|
|
75
|
-
case FileSystemProviderErrorCode.FileIsADirectory: return FileSystemProviderErrorCode.FileIsADirectory;
|
|
76
|
-
case FileSystemProviderErrorCode.FileNotADirectory: return FileSystemProviderErrorCode.FileNotADirectory;
|
|
77
|
-
case FileSystemProviderErrorCode.FileNotFound: return FileSystemProviderErrorCode.FileNotFound;
|
|
78
|
-
case FileSystemProviderErrorCode.FileTooLarge: return FileSystemProviderErrorCode.FileTooLarge;
|
|
79
|
-
case FileSystemProviderErrorCode.FileWriteLocked: return FileSystemProviderErrorCode.FileWriteLocked;
|
|
80
|
-
case FileSystemProviderErrorCode.NoPermissions: return FileSystemProviderErrorCode.NoPermissions;
|
|
81
|
-
case FileSystemProviderErrorCode.Unavailable: return FileSystemProviderErrorCode.Unavailable;
|
|
82
|
-
}
|
|
83
|
-
return FileSystemProviderErrorCode.Unknown;
|
|
84
|
-
}
|
|
85
|
-
var FileChangeType;
|
|
86
|
-
( (function(FileChangeType) {
|
|
87
|
-
FileChangeType[FileChangeType["UPDATED"] = 0] = "UPDATED";
|
|
88
|
-
FileChangeType[FileChangeType["ADDED"] = 1] = "ADDED";
|
|
89
|
-
FileChangeType[FileChangeType["DELETED"] = 2] = "DELETED";
|
|
90
|
-
})(FileChangeType || (FileChangeType = {})));
|
|
91
|
-
class FileChangesEvent {
|
|
92
|
-
static { this.MIXED_CORRELATION = null; }
|
|
93
|
-
constructor(changes, ignorePathCasing) {
|
|
94
|
-
this.ignorePathCasing = ignorePathCasing;
|
|
95
|
-
this.correlationId = undefined;
|
|
96
|
-
this.added = ( new Lazy(() => {
|
|
97
|
-
const added = TernarySearchTree.forUris(() => this.ignorePathCasing);
|
|
98
|
-
added.fill(( this.rawAdded.map(resource => [resource, true])));
|
|
99
|
-
return added;
|
|
100
|
-
}));
|
|
101
|
-
this.updated = ( new Lazy(() => {
|
|
102
|
-
const updated = TernarySearchTree.forUris(() => this.ignorePathCasing);
|
|
103
|
-
updated.fill(( this.rawUpdated.map(resource => [resource, true])));
|
|
104
|
-
return updated;
|
|
105
|
-
}));
|
|
106
|
-
this.deleted = ( new Lazy(() => {
|
|
107
|
-
const deleted = TernarySearchTree.forUris(() => this.ignorePathCasing);
|
|
108
|
-
deleted.fill(( this.rawDeleted.map(resource => [resource, true])));
|
|
109
|
-
return deleted;
|
|
110
|
-
}));
|
|
111
|
-
this.rawAdded = [];
|
|
112
|
-
this.rawUpdated = [];
|
|
113
|
-
this.rawDeleted = [];
|
|
114
|
-
for (const change of changes) {
|
|
115
|
-
switch (change.type) {
|
|
116
|
-
case 1 :
|
|
117
|
-
this.rawAdded.push(change.resource);
|
|
118
|
-
break;
|
|
119
|
-
case 0 :
|
|
120
|
-
this.rawUpdated.push(change.resource);
|
|
121
|
-
break;
|
|
122
|
-
case 2 :
|
|
123
|
-
this.rawDeleted.push(change.resource);
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
if (this.correlationId !== FileChangesEvent.MIXED_CORRELATION) {
|
|
127
|
-
if (typeof change.cId === 'number') {
|
|
128
|
-
if (this.correlationId === undefined) {
|
|
129
|
-
this.correlationId = change.cId;
|
|
130
|
-
}
|
|
131
|
-
else if (this.correlationId !== change.cId) {
|
|
132
|
-
this.correlationId = FileChangesEvent.MIXED_CORRELATION;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
if (this.correlationId !== undefined) {
|
|
137
|
-
this.correlationId = FileChangesEvent.MIXED_CORRELATION;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
contains(resource, ...types) {
|
|
144
|
-
return this.doContains(resource, { includeChildren: false }, ...types);
|
|
145
|
-
}
|
|
146
|
-
affects(resource, ...types) {
|
|
147
|
-
return this.doContains(resource, { includeChildren: true }, ...types);
|
|
148
|
-
}
|
|
149
|
-
doContains(resource, options, ...types) {
|
|
150
|
-
if (!resource) {
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
const hasTypesFilter = types.length > 0;
|
|
154
|
-
if (!hasTypesFilter || types.includes(1 )) {
|
|
155
|
-
if (this.added.value.get(resource)) {
|
|
156
|
-
return true;
|
|
157
|
-
}
|
|
158
|
-
if (options.includeChildren && this.added.value.findSuperstr(resource)) {
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if (!hasTypesFilter || types.includes(0 )) {
|
|
163
|
-
if (this.updated.value.get(resource)) {
|
|
164
|
-
return true;
|
|
165
|
-
}
|
|
166
|
-
if (options.includeChildren && this.updated.value.findSuperstr(resource)) {
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
if (!hasTypesFilter || types.includes(2 )) {
|
|
171
|
-
if (this.deleted.value.findSubstr(resource) ) {
|
|
172
|
-
return true;
|
|
173
|
-
}
|
|
174
|
-
if (options.includeChildren && this.deleted.value.findSuperstr(resource)) {
|
|
175
|
-
return true;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
gotAdded() {
|
|
181
|
-
return this.rawAdded.length > 0;
|
|
182
|
-
}
|
|
183
|
-
gotDeleted() {
|
|
184
|
-
return this.rawDeleted.length > 0;
|
|
185
|
-
}
|
|
186
|
-
gotUpdated() {
|
|
187
|
-
return this.rawUpdated.length > 0;
|
|
188
|
-
}
|
|
189
|
-
correlates(correlationId) {
|
|
190
|
-
return this.correlationId === correlationId;
|
|
191
|
-
}
|
|
192
|
-
hasCorrelation() {
|
|
193
|
-
return typeof this.correlationId === 'number';
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
class ByteSize {
|
|
197
|
-
static { this.KB = 1024; }
|
|
198
|
-
static { this.MB = ByteSize.KB * ByteSize.KB; }
|
|
199
|
-
static { this.GB = ByteSize.MB * ByteSize.KB; }
|
|
200
|
-
static { this.TB = ByteSize.GB * ByteSize.KB; }
|
|
201
|
-
static formatSize(size) {
|
|
202
|
-
if (!isNumber(size)) {
|
|
203
|
-
size = 0;
|
|
204
|
-
}
|
|
205
|
-
if (size < ByteSize.KB) {
|
|
206
|
-
return ( localizeWithPath('vs/platform/files/common/files', 'sizeB', "{0}B", size.toFixed(0)));
|
|
207
|
-
}
|
|
208
|
-
if (size < ByteSize.MB) {
|
|
209
|
-
return ( localizeWithPath(
|
|
210
|
-
'vs/platform/files/common/files',
|
|
211
|
-
'sizeKB',
|
|
212
|
-
"{0}KB",
|
|
213
|
-
(size / ByteSize.KB).toFixed(2)
|
|
214
|
-
));
|
|
215
|
-
}
|
|
216
|
-
if (size < ByteSize.GB) {
|
|
217
|
-
return ( localizeWithPath(
|
|
218
|
-
'vs/platform/files/common/files',
|
|
219
|
-
'sizeMB',
|
|
220
|
-
"{0}MB",
|
|
221
|
-
(size / ByteSize.MB).toFixed(2)
|
|
222
|
-
));
|
|
223
|
-
}
|
|
224
|
-
if (size < ByteSize.TB) {
|
|
225
|
-
return ( localizeWithPath(
|
|
226
|
-
'vs/platform/files/common/files',
|
|
227
|
-
'sizeGB',
|
|
228
|
-
"{0}GB",
|
|
229
|
-
(size / ByteSize.GB).toFixed(2)
|
|
230
|
-
));
|
|
231
|
-
}
|
|
232
|
-
return ( localizeWithPath(
|
|
233
|
-
'vs/platform/files/common/files',
|
|
234
|
-
'sizeTB',
|
|
235
|
-
"{0}TB",
|
|
236
|
-
(size / ByteSize.TB).toFixed(2)
|
|
237
|
-
));
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export { ByteSize, FileChangeType, FileChangesEvent, FilePermission, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, markAsFileSystemProviderError, toFileSystemProviderErrorCode };
|