@codingame/monaco-vscode-api 1.69.7 → 1.69.8
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/dist/api.js +8 -7
- package/dist/configuration.js +384 -73
- package/dist/contextkey.js +13 -1
- package/dist/dialogs.js +13 -12
- package/dist/extHost.js +2063 -1396
- package/dist/files.js +100 -105
- package/dist/keybindings.js +358 -307
- package/dist/languageConfiguration.js +5 -4
- package/dist/languageService.js +3 -3
- package/dist/languages.js +4 -3
- package/dist/layout.js +294 -311
- package/dist/messages.js +2 -0
- package/dist/missing-services.js +5304 -5954
- package/dist/modelEditor.js +69 -68
- package/dist/monaco.js +14 -13
- package/dist/notifications.js +268 -337
- package/dist/polyfill.js +446 -913
- package/dist/services.js +1 -1
- package/dist/services2.js +659 -26
- package/dist/snippets.js +102 -109
- package/dist/textmate.js +82 -89
- package/dist/theme.js +396 -407
- package/dist/tokenClassification.js +4 -3
- package/dist/tokenClassificationRegistry.js +78 -84
- package/dist/tools.js +2 -1
- package/dist/workbenchThemeService.js +1 -1
- package/dist/workspaceContext.js +2 -1
- package/package.json +1 -1
package/dist/files.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { b as __decorate, d as __param } from './contextkey.js';
|
|
2
|
+
import { E as Emitter, b as isReadableStream, e as peekStream, h as peekReadable, j as bufferToReadable, s as streamToBuffer, k as consumeStream, t as transform, l as isReadableBufferedStream, m as listenStream, n as bufferedStreamToBuffer, o as readableToBuffer, q as newWriteableBufferStream, u as newWriteableStream } from './polyfill.js';
|
|
3
|
+
import { g as format2, h as getServiceMachineId, R as ResourceQueue, u as unsupported } from './missing-services.js';
|
|
4
|
+
import { v as FileSystemProviderError, b as FileSystemProviderErrorCode, F as FileType, w as ensureFileSystemProviderError, x as createFileSystemProviderError, y as FileChangesEvent, p as FileOperationError, z as hasOpenReadWriteCloseCapability, B as hasReadWriteCapability, D as hasFileReadStreamCapability, E as toFileSystemProviderErrorCode, a as FilePermission, G as etag, H as FileOperationEvent, J as toFileOperationResult, K as ETAG_DISABLED, L as hasFileAtomicReadCapability, N as NotModifiedSinceFileOperationError, M as hasFileFolderCopyCapability, O as hasFileCloneCapability, C as CancellationTokenSource, d as IFileService, l as IProductService, S as Services } from './services2.js';
|
|
4
5
|
import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
5
6
|
import { canceled } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
6
7
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
@@ -15,7 +16,7 @@ import { CancellationToken } from 'monaco-editor/esm/vs/base/common/cancellation
|
|
|
15
16
|
import { Schemas, RemoteAuthorities } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
16
17
|
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
17
18
|
import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
18
|
-
import {
|
|
19
|
+
import { bj as supportsTelemetry, bg as getTelemetryLevel, D as DEFAULT_EXTENSION, G as Disposable$1 } from './extHost.js';
|
|
19
20
|
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
20
21
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
21
22
|
import { isWeb } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
@@ -31,7 +32,7 @@ function getRemoteServerRootPath(product) {
|
|
|
31
32
|
return `/${product.quality ?? 'oss'}-${product.commit ?? 'dev'}`;
|
|
32
33
|
}
|
|
33
34
|
const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
|
34
|
-
const IExtensionResourceLoaderService = (
|
|
35
|
+
const IExtensionResourceLoaderService = ( createDecorator('extensionResourceLoaderService'));
|
|
35
36
|
class AbstractExtensionResourceLoaderService {
|
|
36
37
|
constructor(_fileService, _storageService, _productService, _environmentService, _configurationService) {
|
|
37
38
|
this._fileService = _fileService;
|
|
@@ -42,7 +43,7 @@ class AbstractExtensionResourceLoaderService {
|
|
|
42
43
|
this._webExtensionResourceEndPoint = `${getRemoteServerRootPath(_productService)}/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
|
43
44
|
if (_productService.extensionsGallery) {
|
|
44
45
|
this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate;
|
|
45
|
-
this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority((
|
|
46
|
+
this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(( URI.parse(this._extensionGalleryResourceUrlTemplate))) : undefined;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
get supportsExtensionGalleryResources() {
|
|
@@ -50,9 +51,9 @@ class AbstractExtensionResourceLoaderService {
|
|
|
50
51
|
}
|
|
51
52
|
getExtensionGalleryResourceURL(galleryExtension, path) {
|
|
52
53
|
if (this._extensionGalleryResourceUrlTemplate) {
|
|
53
|
-
const uri = (
|
|
54
|
+
const uri = ( URI.parse(
|
|
54
55
|
format2(this._extensionGalleryResourceUrlTemplate, { publisher: galleryExtension.publisher, name: galleryExtension.name, version: galleryExtension.version, path: 'extension' })
|
|
55
|
-
))
|
|
56
|
+
));
|
|
56
57
|
return this._isWebExtensionResourceEndPoint(uri) ? uri.with({ scheme: RemoteAuthorities.getPreferredWebSchema() }) : uri;
|
|
57
58
|
}
|
|
58
59
|
return undefined;
|
|
@@ -106,7 +107,7 @@ class Directory {
|
|
|
106
107
|
this.mtime = Date.now();
|
|
107
108
|
this.size = 0;
|
|
108
109
|
this.name = name;
|
|
109
|
-
this.entries = (
|
|
110
|
+
this.entries = ( new Map());
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
class InMemoryFileSystemProvider extends Disposable {
|
|
@@ -115,8 +116,8 @@ class InMemoryFileSystemProvider extends Disposable {
|
|
|
115
116
|
this.capabilities = 2
|
|
116
117
|
| 1024 ;
|
|
117
118
|
this.onDidChangeCapabilities = Event.None;
|
|
118
|
-
this.root = (
|
|
119
|
-
this._onDidChangeFile = this._register((
|
|
119
|
+
this.root = ( new Directory(''));
|
|
120
|
+
this._onDidChangeFile = this._register(( new Emitter()));
|
|
120
121
|
this.onDidChangeFile = this._onDidChangeFile.event;
|
|
121
122
|
this._bufferedChanges = [];
|
|
122
123
|
}
|
|
@@ -150,7 +151,7 @@ class InMemoryFileSystemProvider extends Disposable {
|
|
|
150
151
|
throw new FileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
|
|
151
152
|
}
|
|
152
153
|
if (!entry) {
|
|
153
|
-
entry = (
|
|
154
|
+
entry = ( new File$1(basename$1));
|
|
154
155
|
parent.entries.set(basename$1, entry);
|
|
155
156
|
this._fireSoon({ type: 1 , resource });
|
|
156
157
|
}
|
|
@@ -190,7 +191,7 @@ class InMemoryFileSystemProvider extends Disposable {
|
|
|
190
191
|
const basename$1 = basename(resource);
|
|
191
192
|
const dirname$1 = dirname(resource);
|
|
192
193
|
const parent = this._lookupAsDirectory(dirname$1, false);
|
|
193
|
-
const entry = (
|
|
194
|
+
const entry = ( new Directory(basename$1));
|
|
194
195
|
parent.entries.set(entry.name, entry);
|
|
195
196
|
parent.mtime = Date.now();
|
|
196
197
|
parent.size += 1;
|
|
@@ -331,32 +332,32 @@ let FileService = class FileService extends Disposable {
|
|
|
331
332
|
super();
|
|
332
333
|
this.logService = logService;
|
|
333
334
|
this.BUFFER_SIZE = 256 * 1024;
|
|
334
|
-
this._onDidChangeFileSystemProviderRegistrations = this._register((
|
|
335
|
+
this._onDidChangeFileSystemProviderRegistrations = this._register(( new Emitter()));
|
|
335
336
|
this.onDidChangeFileSystemProviderRegistrations = this._onDidChangeFileSystemProviderRegistrations.event;
|
|
336
|
-
this._onWillActivateFileSystemProvider = this._register((
|
|
337
|
+
this._onWillActivateFileSystemProvider = this._register(( new Emitter()));
|
|
337
338
|
this.onWillActivateFileSystemProvider = this._onWillActivateFileSystemProvider.event;
|
|
338
|
-
this._onDidChangeFileSystemProviderCapabilities = this._register((
|
|
339
|
+
this._onDidChangeFileSystemProviderCapabilities = this._register(( new Emitter()));
|
|
339
340
|
this.onDidChangeFileSystemProviderCapabilities = this._onDidChangeFileSystemProviderCapabilities.event;
|
|
340
|
-
this.provider = (
|
|
341
|
-
this._onDidRunOperation = this._register((
|
|
341
|
+
this.provider = ( new Map());
|
|
342
|
+
this._onDidRunOperation = this._register(( new Emitter()));
|
|
342
343
|
this.onDidRunOperation = this._onDidRunOperation.event;
|
|
343
|
-
this._onDidFilesChange = this._register((
|
|
344
|
+
this._onDidFilesChange = this._register(( new Emitter()));
|
|
344
345
|
this.onDidFilesChange = this._onDidFilesChange.event;
|
|
345
|
-
this._onDidWatchError = this._register((
|
|
346
|
+
this._onDidWatchError = this._register(( new Emitter()));
|
|
346
347
|
this.onDidWatchError = this._onDidWatchError.event;
|
|
347
|
-
this.activeWatchers = (
|
|
348
|
-
this.writeQueue = this._register((
|
|
348
|
+
this.activeWatchers = ( new Map());
|
|
349
|
+
this.writeQueue = this._register(( new ResourceQueue()));
|
|
349
350
|
}
|
|
350
351
|
registerProvider(scheme, provider) {
|
|
351
352
|
if (this.provider.has(scheme)) {
|
|
352
353
|
throw new Error(`A filesystem provider for the scheme '${scheme}' is already registered.`);
|
|
353
354
|
}
|
|
354
|
-
const providerDisposables = (
|
|
355
|
+
const providerDisposables = ( new DisposableStore());
|
|
355
356
|
this.provider.set(scheme, provider);
|
|
356
357
|
this._onDidChangeFileSystemProviderRegistrations.fire({ added: true, scheme, provider });
|
|
357
|
-
providerDisposables.add(provider.onDidChangeFile(changes => this._onDidFilesChange.fire((
|
|
358
|
+
providerDisposables.add(provider.onDidChangeFile(changes => this._onDidFilesChange.fire(( new FileChangesEvent(changes, !this.isPathCaseSensitive(provider))))));
|
|
358
359
|
if (typeof provider.onDidWatchError === 'function') {
|
|
359
|
-
providerDisposables.add(provider.onDidWatchError(error => this._onDidWatchError.fire((
|
|
360
|
+
providerDisposables.add(provider.onDidWatchError(error => this._onDidWatchError.fire(( new Error(error)))));
|
|
360
361
|
}
|
|
361
362
|
providerDisposables.add(provider.onDidChangeCapabilities(() => this._onDidChangeFileSystemProviderCapabilities.fire({ provider, scheme })));
|
|
362
363
|
return toDisposable(() => {
|
|
@@ -402,13 +403,13 @@ let FileService = class FileService extends Disposable {
|
|
|
402
403
|
await this.activateProvider(resource.scheme);
|
|
403
404
|
const provider = this.provider.get(resource.scheme);
|
|
404
405
|
if (!provider) {
|
|
405
|
-
const error = (
|
|
406
|
+
const error = ( new Error());
|
|
406
407
|
error.name = 'ENOPRO';
|
|
407
|
-
error.message = (
|
|
408
|
+
error.message = ( localize(
|
|
408
409
|
'noProviderFound',
|
|
409
410
|
"No file system provider found for resource '{0}'",
|
|
410
|
-
|
|
411
|
-
))
|
|
411
|
+
( resource.toString())
|
|
412
|
+
));
|
|
412
413
|
throw error;
|
|
413
414
|
}
|
|
414
415
|
return provider;
|
|
@@ -545,7 +546,7 @@ let FileService = class FileService extends Disposable {
|
|
|
545
546
|
async createFile(resource, bufferOrReadableOrStream = VSBuffer.fromString(''), options) {
|
|
546
547
|
await this.doValidateCreateFile(resource, options);
|
|
547
548
|
const fileStat = await this.writeFile(resource, bufferOrReadableOrStream);
|
|
548
|
-
this._onDidRunOperation.fire((
|
|
549
|
+
this._onDidRunOperation.fire(( new FileOperationEvent(resource, 0 , fileStat)));
|
|
549
550
|
return fileStat;
|
|
550
551
|
}
|
|
551
552
|
async writeFile(resource, bufferOrReadableOrStream, options) {
|
|
@@ -580,7 +581,7 @@ let FileService = class FileService extends Disposable {
|
|
|
580
581
|
else {
|
|
581
582
|
await this.doWriteBuffered(provider, resource, options, bufferOrReadableOrStreamOrBufferedStream instanceof VSBuffer ? bufferToReadable(bufferOrReadableOrStreamOrBufferedStream) : bufferOrReadableOrStreamOrBufferedStream);
|
|
582
583
|
}
|
|
583
|
-
this._onDidRunOperation.fire((
|
|
584
|
+
this._onDidRunOperation.fire(( new FileOperationEvent(resource, 4 )));
|
|
584
585
|
}
|
|
585
586
|
catch (error) {
|
|
586
587
|
throw new FileOperationError(localize('err.write', "Unable to write file '{0}' ({1})", this.resourceForError(resource), ensureFileSystemProviderError(error).toString()), toFileOperationResult(error), options);
|
|
@@ -618,19 +619,17 @@ let FileService = class FileService extends Disposable {
|
|
|
618
619
|
return this.doReadFile(provider, resource, options, token);
|
|
619
620
|
}
|
|
620
621
|
async doReadFileAtomic(provider, resource, options, token) {
|
|
621
|
-
return (
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
}))
|
|
633
|
-
);
|
|
622
|
+
return ( new Promise((resolve, reject) => {
|
|
623
|
+
this.writeQueue.queueFor(resource, this.getExtUri(provider).providerExtUri).queue(async () => {
|
|
624
|
+
try {
|
|
625
|
+
const content = await this.doReadFile(provider, resource, options, token);
|
|
626
|
+
resolve(content);
|
|
627
|
+
}
|
|
628
|
+
catch (error) {
|
|
629
|
+
reject(error);
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
}));
|
|
634
633
|
}
|
|
635
634
|
async doReadFile(provider, resource, options, token) {
|
|
636
635
|
const stream = await this.doReadFileStream(provider, resource, {
|
|
@@ -647,7 +646,7 @@ let FileService = class FileService extends Disposable {
|
|
|
647
646
|
return this.doReadFileStream(provider, resource, options, token);
|
|
648
647
|
}
|
|
649
648
|
async doReadFileStream(provider, resource, options, token) {
|
|
650
|
-
const cancellableSource = (
|
|
649
|
+
const cancellableSource = ( new CancellationTokenSource(token));
|
|
651
650
|
const statPromise = this.validateReadFile(resource, options).then(stat => stat, error => {
|
|
652
651
|
cancellableSource.cancel();
|
|
653
652
|
throw error;
|
|
@@ -679,12 +678,12 @@ let FileService = class FileService extends Disposable {
|
|
|
679
678
|
if (fileStream) {
|
|
680
679
|
await consumeStream(fileStream);
|
|
681
680
|
}
|
|
682
|
-
const message = (
|
|
681
|
+
const message = ( localize(
|
|
683
682
|
'err.read',
|
|
684
683
|
"Unable to read file '{0}' ({1})",
|
|
685
684
|
this.resourceForError(resource),
|
|
686
|
-
|
|
687
|
-
))
|
|
685
|
+
( ensureFileSystemProviderError(error).toString())
|
|
686
|
+
));
|
|
688
687
|
if (error instanceof NotModifiedSinceFileOperationError) {
|
|
689
688
|
throw new NotModifiedSinceFileOperationError(message, error.stat, options);
|
|
690
689
|
}
|
|
@@ -697,12 +696,12 @@ let FileService = class FileService extends Disposable {
|
|
|
697
696
|
const fileStream = provider.readFileStream(resource, options, token);
|
|
698
697
|
return transform(fileStream, {
|
|
699
698
|
data: data => data instanceof VSBuffer ? data : VSBuffer.wrap(data),
|
|
700
|
-
error: error => (
|
|
699
|
+
error: error => ( new FileOperationError(( localize(
|
|
701
700
|
'err.read',
|
|
702
701
|
"Unable to read file '{0}' ({1})",
|
|
703
702
|
this.resourceForError(resource),
|
|
704
|
-
|
|
705
|
-
)), toFileOperationResult(error), options))
|
|
703
|
+
( ensureFileSystemProviderError(error).toString())
|
|
704
|
+
)), toFileOperationResult(error), options))
|
|
706
705
|
}, data => VSBuffer.concat(data));
|
|
707
706
|
}
|
|
708
707
|
readFileBuffered(provider, resource, token, options = Object.create(null)) {
|
|
@@ -710,12 +709,12 @@ let FileService = class FileService extends Disposable {
|
|
|
710
709
|
readFileIntoStream(provider, resource, stream, data => data, {
|
|
711
710
|
...options,
|
|
712
711
|
bufferSize: this.BUFFER_SIZE,
|
|
713
|
-
errorTransformer: error => (
|
|
712
|
+
errorTransformer: error => ( new FileOperationError(( localize(
|
|
714
713
|
'err.read',
|
|
715
714
|
"Unable to read file '{0}' ({1})",
|
|
716
715
|
this.resourceForError(resource),
|
|
717
|
-
|
|
718
|
-
)), toFileOperationResult(error), options))
|
|
716
|
+
( ensureFileSystemProviderError(error).toString())
|
|
717
|
+
)), toFileOperationResult(error), options))
|
|
719
718
|
}, token);
|
|
720
719
|
return stream;
|
|
721
720
|
}
|
|
@@ -778,7 +777,7 @@ let FileService = class FileService extends Disposable {
|
|
|
778
777
|
return this.doCanMoveCopy(source, target, 'copy', overwrite);
|
|
779
778
|
}
|
|
780
779
|
async doCanMoveCopy(source, target, mode, overwrite) {
|
|
781
|
-
if ((
|
|
780
|
+
if (( source.toString()) !== ( target.toString())) {
|
|
782
781
|
try {
|
|
783
782
|
const sourceProvider = mode === 'move' ? this.throwIfFileSystemIsReadonly(await this.withWriteProvider(source), source) : await this.withReadProvider(source);
|
|
784
783
|
const targetProvider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(target), target);
|
|
@@ -795,11 +794,11 @@ let FileService = class FileService extends Disposable {
|
|
|
795
794
|
const targetProvider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(target), target);
|
|
796
795
|
const mode = await this.doMoveCopy(sourceProvider, source, targetProvider, target, 'move', !!overwrite);
|
|
797
796
|
const fileStat = await this.resolve(target, { resolveMetadata: true });
|
|
798
|
-
this._onDidRunOperation.fire((
|
|
797
|
+
this._onDidRunOperation.fire(( new FileOperationEvent(
|
|
799
798
|
source,
|
|
800
799
|
mode === 'move' ? 2 : 3 ,
|
|
801
800
|
fileStat
|
|
802
|
-
)))
|
|
801
|
+
)));
|
|
803
802
|
return fileStat;
|
|
804
803
|
}
|
|
805
804
|
async copy(source, target, overwrite) {
|
|
@@ -807,15 +806,15 @@ let FileService = class FileService extends Disposable {
|
|
|
807
806
|
const targetProvider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(target), target);
|
|
808
807
|
const mode = await this.doMoveCopy(sourceProvider, source, targetProvider, target, 'copy', !!overwrite);
|
|
809
808
|
const fileStat = await this.resolve(target, { resolveMetadata: true });
|
|
810
|
-
this._onDidRunOperation.fire((
|
|
809
|
+
this._onDidRunOperation.fire(( new FileOperationEvent(
|
|
811
810
|
source,
|
|
812
811
|
mode === 'copy' ? 3 : 2 ,
|
|
813
812
|
fileStat
|
|
814
|
-
)))
|
|
813
|
+
)));
|
|
815
814
|
return fileStat;
|
|
816
815
|
}
|
|
817
816
|
async doMoveCopy(sourceProvider, source, targetProvider, target, mode, overwrite) {
|
|
818
|
-
if ((
|
|
817
|
+
if (( source.toString()) === ( target.toString())) {
|
|
819
818
|
return mode;
|
|
820
819
|
}
|
|
821
820
|
const { exists, isSameResourceWithDifferentPathCase } = await this.doValidateMoveCopy(sourceProvider, source, targetProvider, target, mode, overwrite);
|
|
@@ -920,7 +919,7 @@ let FileService = class FileService extends Disposable {
|
|
|
920
919
|
const provider = this.throwIfFileSystemIsReadonly(await this.withProvider(resource), resource);
|
|
921
920
|
await this.mkdirp(provider, resource);
|
|
922
921
|
const fileStat = await this.resolve(resource, { resolveMetadata: true });
|
|
923
|
-
this._onDidRunOperation.fire((
|
|
922
|
+
this._onDidRunOperation.fire(( new FileOperationEvent(resource, 0 , fileStat)));
|
|
924
923
|
return fileStat;
|
|
925
924
|
}
|
|
926
925
|
async mkdirp(provider, directory) {
|
|
@@ -995,7 +994,7 @@ let FileService = class FileService extends Disposable {
|
|
|
995
994
|
const useTrash = !!options?.useTrash;
|
|
996
995
|
const recursive = !!options?.recursive;
|
|
997
996
|
await provider.delete(resource, { recursive, useTrash });
|
|
998
|
-
this._onDidRunOperation.fire((
|
|
997
|
+
this._onDidRunOperation.fire(( new FileOperationEvent(resource, 1 )));
|
|
999
998
|
}
|
|
1000
999
|
async cloneFile(source, target) {
|
|
1001
1000
|
const sourceProvider = await this.withProvider(source);
|
|
@@ -1014,7 +1013,7 @@ let FileService = class FileService extends Disposable {
|
|
|
1014
1013
|
return sourceWriteQueue.queue(() => this.doCopyFile(sourceProvider, source, targetProvider, target));
|
|
1015
1014
|
}
|
|
1016
1015
|
watch(resource, options = { recursive: false, excludes: [] }) {
|
|
1017
|
-
const disposables = (
|
|
1016
|
+
const disposables = ( new DisposableStore());
|
|
1018
1017
|
let watchDisposed = false;
|
|
1019
1018
|
let disposeWatch = () => { watchDisposed = true; };
|
|
1020
1019
|
disposables.add(toDisposable(() => disposeWatch()));
|
|
@@ -1099,25 +1098,23 @@ let FileService = class FileService extends Disposable {
|
|
|
1099
1098
|
else {
|
|
1100
1099
|
stream = streamOrBufferedStream;
|
|
1101
1100
|
}
|
|
1102
|
-
return (
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
}))
|
|
1120
|
-
);
|
|
1101
|
+
return ( new Promise((resolve, reject) => {
|
|
1102
|
+
listenStream(stream, {
|
|
1103
|
+
onData: async (chunk) => {
|
|
1104
|
+
stream.pause();
|
|
1105
|
+
try {
|
|
1106
|
+
await this.doWriteBuffer(provider, handle, chunk, chunk.byteLength, posInFile, 0);
|
|
1107
|
+
}
|
|
1108
|
+
catch (error) {
|
|
1109
|
+
return reject(error);
|
|
1110
|
+
}
|
|
1111
|
+
posInFile += chunk.byteLength;
|
|
1112
|
+
setTimeout(() => stream.resume());
|
|
1113
|
+
},
|
|
1114
|
+
onError: error => reject(error),
|
|
1115
|
+
onEnd: () => resolve()
|
|
1116
|
+
});
|
|
1117
|
+
}));
|
|
1121
1118
|
}
|
|
1122
1119
|
async doWriteReadableBufferedQueued(provider, handle, readable) {
|
|
1123
1120
|
let posInFile = 0;
|
|
@@ -1227,30 +1224,28 @@ let FileService = class FileService extends Disposable {
|
|
|
1227
1224
|
if (resource.scheme === Schemas.file) {
|
|
1228
1225
|
return resource.fsPath;
|
|
1229
1226
|
}
|
|
1230
|
-
return (
|
|
1231
|
-
(resource.toString(true))
|
|
1232
|
-
);
|
|
1227
|
+
return ( resource.toString(true));
|
|
1233
1228
|
}
|
|
1234
1229
|
};
|
|
1235
|
-
FileService = (
|
|
1236
|
-
(
|
|
1237
|
-
], FileService))
|
|
1230
|
+
FileService = ( __decorate([
|
|
1231
|
+
( __param(0, ILogService))
|
|
1232
|
+
], FileService));
|
|
1238
1233
|
let SimpleExtensionResourceLoaderService = class SimpleExtensionResourceLoaderService extends AbstractExtensionResourceLoaderService {
|
|
1239
1234
|
constructor(fileService, storageService, productService, environmentService, configurationService) {
|
|
1240
1235
|
super(fileService, storageService, productService, environmentService, configurationService);
|
|
1241
1236
|
}
|
|
1242
1237
|
async readExtensionResource(uri) {
|
|
1243
1238
|
const result = await this._fileService.readFile(uri);
|
|
1244
|
-
return
|
|
1239
|
+
return result.value.toString();
|
|
1245
1240
|
}
|
|
1246
1241
|
};
|
|
1247
|
-
SimpleExtensionResourceLoaderService =
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
], SimpleExtensionResourceLoaderService)
|
|
1242
|
+
SimpleExtensionResourceLoaderService = __decorate([
|
|
1243
|
+
__param(0, IFileService),
|
|
1244
|
+
__param(1, IStorageService),
|
|
1245
|
+
__param(2, IProductService),
|
|
1246
|
+
__param(3, IEnvironmentService),
|
|
1247
|
+
__param(4, IConfigurationService)
|
|
1248
|
+
], SimpleExtensionResourceLoaderService);
|
|
1254
1249
|
registerSingleton(IExtensionResourceLoaderService, SimpleExtensionResourceLoaderService);
|
|
1255
1250
|
class File {
|
|
1256
1251
|
constructor(getContent) {
|
|
@@ -1276,14 +1271,14 @@ class ExtensionFileSystemProviderWithFileReadWriteCapability {
|
|
|
1276
1271
|
this.files = new Map();
|
|
1277
1272
|
}
|
|
1278
1273
|
async stat(resource) {
|
|
1279
|
-
const file = this.files.get(
|
|
1274
|
+
const file = this.files.get(resource.toString());
|
|
1280
1275
|
if (file != null) {
|
|
1281
1276
|
return file;
|
|
1282
1277
|
}
|
|
1283
1278
|
throw new FileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
1284
1279
|
}
|
|
1285
1280
|
async readFile(resource) {
|
|
1286
|
-
const file = this.files.get(
|
|
1281
|
+
const file = this.files.get(resource.toString());
|
|
1287
1282
|
if (file != null) {
|
|
1288
1283
|
return encoder.encode(await file.getContent());
|
|
1289
1284
|
}
|
|
@@ -1295,9 +1290,9 @@ class ExtensionFileSystemProviderWithFileReadWriteCapability {
|
|
|
1295
1290
|
};
|
|
1296
1291
|
}
|
|
1297
1292
|
registerFile(resource, getContent) {
|
|
1298
|
-
this.files.set(
|
|
1293
|
+
this.files.set(resource.toString(), new File(getContent));
|
|
1299
1294
|
return new Disposable$1(() => {
|
|
1300
|
-
this.files.delete(
|
|
1295
|
+
this.files.delete(resource.toString());
|
|
1301
1296
|
});
|
|
1302
1297
|
}
|
|
1303
1298
|
}
|
|
@@ -1310,16 +1305,16 @@ let MemoryFileService = class MemoryFileService extends FileService {
|
|
|
1310
1305
|
this.registerProvider(extension.extensionLocation.scheme, extensionFileSystemProvider);
|
|
1311
1306
|
}
|
|
1312
1307
|
};
|
|
1313
|
-
MemoryFileService =
|
|
1314
|
-
|
|
1315
|
-
], MemoryFileService)
|
|
1308
|
+
MemoryFileService = __decorate([
|
|
1309
|
+
__param(0, ILogService)
|
|
1310
|
+
], MemoryFileService);
|
|
1316
1311
|
function registerExtensionFile(resource, getContent) {
|
|
1317
1312
|
return extensionFileSystemProvider.registerFile(resource, getContent);
|
|
1318
1313
|
}
|
|
1319
1314
|
function getServiceOverride() {
|
|
1320
1315
|
return {
|
|
1321
|
-
[
|
|
1322
|
-
[
|
|
1316
|
+
[IFileService.toString()]: new SyncDescriptor(MemoryFileService),
|
|
1317
|
+
[IExtensionResourceLoaderService.toString()]: new SyncDescriptor(SimpleExtensionResourceLoaderService)
|
|
1323
1318
|
};
|
|
1324
1319
|
}
|
|
1325
1320
|
export { IExtensionResourceLoaderService as I, getRemoteAuthority as a, getServiceOverride as g, registerExtensionFile as r };
|