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