@codingame/monaco-vscode-api 1.79.6 → 1.79.7-next.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/dist/event.d.ts +1 -1
- package/dist/files.d.ts +1 -1
- package/dist/languageFeatures.d.ts +1 -1
- package/dist/monaco.d.ts +5 -3
- package/dist/monaco.js +1 -0
- package/dist/service-override/files.d.ts +60 -15
- package/dist/service-override/files.js +124 -114
- package/dist/service-override/output.js +1 -1
- package/dist/services.d.ts +2 -2
- package/dist/typescript.js +27 -0
- package/monaco-editor-treemending.patch +780 -780
- package/package.json +1 -1
package/dist/event.d.ts
CHANGED
|
@@ -583,4 +583,4 @@ interface IWaitUntil {
|
|
|
583
583
|
waitUntil(thenable: Promise<unknown>): void;
|
|
584
584
|
}
|
|
585
585
|
|
|
586
|
-
export { CancellationToken as C, Disposable as D, Event as E, IReference as I, IDisposable as a,
|
|
586
|
+
export { CancellationToken as C, Disposable as D, Event as E, IReference as I, IDisposable as a, Emitter as b, DisposableStore as c, IWaitUntil as d };
|
package/dist/files.d.ts
CHANGED
|
@@ -914,4 +914,4 @@ interface ICreateFileOptions {
|
|
|
914
914
|
readonly overwrite?: boolean;
|
|
915
915
|
}
|
|
916
916
|
|
|
917
|
-
export { FileSystemProviderCapabilities as F, IFileSystemProviderWithFileReadWriteCapability as I, ReadableStreamEvents as R, VSBuffer as V,
|
|
917
|
+
export { FileSystemProviderCapabilities as F, IFileSystemProviderWithFileReadWriteCapability as I, ReadableStreamEvents as R, VSBuffer as V, IStat as a, FileType as b, IFileWriteOptions as c, IFileOverwriteOptions as d, IFileDeleteOptions as e, IFileChange as f, IWatchOptions as g, IFileSystemProviderWithFileReadStreamCapability as h, IFileReadStreamOptions as i, FileSystemProviderError as j, FileSystemProviderErrorCode as k, FileChangeType as l, FilePermission as m, VSBufferReadable as n, VSBufferReadableStream as o, IFileStatWithMetadata as p, FileOperation as q, ReadableStream as r, IReadFileStreamOptions as s, IWriteFileOptions as t, IBaseFileStatWithMetadata as u, IFileReadLimits as v, IRelativePattern as w, IFileService as x };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as ServiceIdentifier, a as ServicesAccessor, I as IInstantiationService } from './instantiation.js';
|
|
2
|
-
import { E as Event, a as IDisposable, C as CancellationToken,
|
|
2
|
+
import { E as Event, a as IDisposable, C as CancellationToken, b as Emitter, d as IWaitUntil, D as Disposable } from './event.js';
|
|
3
3
|
import { I as IJSONSchema } from './jsonSchema.js';
|
|
4
4
|
import { c as ITextModel, P as Position, R as Range, S as Selection, h as IRange, E as EndOfLineSequence, g as IPosition, i as IMarkdownString, j as ISingleEditOperation, k as EditorAutoIndentStrategy, I as IEditorOptions, l as IEditorModel, m as IDimension, n as ITextEditorModel, o as ITextSnapshot, p as ITextBufferFactory, q as IDiffEditor, r as IBaseTextResourceEditorInput, s as IBaseUntypedEditorInput, t as IResourceEditorInput, u as ITextResourceEditorInput } from './editorBrowser.js';
|
|
5
5
|
import { S as Severity$1 } from './severity.js';
|
package/dist/monaco.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as monaco from 'monaco-editor';
|
|
2
2
|
import { I as IEditorOverrideServices } from './standaloneServices.js';
|
|
3
3
|
import { E as Event, D as Disposable, a as IDisposable, I as IReference } from './event.js';
|
|
4
|
-
export {
|
|
4
|
+
export { c as DisposableStore } from './event.js';
|
|
5
5
|
import { c as ITextModel, d as IModelDecorationOptions, e as IModelDecorationsChangeAccessor, f as IEditorContribution, b as ICodeEditor, g as IPosition } from './editorBrowser.js';
|
|
6
6
|
import { L as LanguageFeatureRegistry, I as ILanguageFeaturesService, F as FoldingRangeProvider, a as ILanguageConfigurationService, b as INotificationService, c as ITextFileEditorModel } from './languageFeatures.js';
|
|
7
7
|
export { C as CommandsRegistry, r as registerColor } from './languageFeatures.js';
|
|
@@ -9,7 +9,7 @@ import { a as IContextKeyService } from './contextkey.js';
|
|
|
9
9
|
import { S as ServiceIdentifier } from './instantiation.js';
|
|
10
10
|
import { I as IJSONSchema } from './jsonSchema.js';
|
|
11
11
|
import { U as URI } from './uri.js';
|
|
12
|
-
import {
|
|
12
|
+
import { e as IFileDeleteOptions } from './files.js';
|
|
13
13
|
import 'vscode';
|
|
14
14
|
import './themables.js';
|
|
15
15
|
import './severity.js';
|
|
@@ -332,6 +332,8 @@ declare function registerJsonSchema(schema: JsonSchema): monaco.IDisposable;
|
|
|
332
332
|
*/
|
|
333
333
|
declare function synchronizeJsonSchemas(): monaco.IDisposable;
|
|
334
334
|
|
|
335
|
+
declare function registerTypescriptWorkerFileProvider(): IDisposable;
|
|
336
|
+
|
|
335
337
|
declare function writeFile(uri: URI, content: string): Promise<void>;
|
|
336
338
|
declare function deleteFile(uri: URI, options?: Partial<IFileDeleteOptions>): Promise<void>;
|
|
337
339
|
declare function createModelReference(resource: URI, content?: string): Promise<IReference<ITextFileEditorModel>>;
|
|
@@ -342,4 +344,4 @@ declare const Extensions: {
|
|
|
342
344
|
JSONContribution: string;
|
|
343
345
|
};
|
|
344
346
|
|
|
345
|
-
export { Extensions, FoldingController, FoldingModel, IJSONContributionRegistry, IJSONSchema, IReference, ITextFileEditorModel, JsonSchema, Registry, createConfiguredDiffEditor, createConfiguredEditor, createModelReference, deleteFile, errorHandler, registerJsonSchema, setCollapseStateForMatchingLines, synchronizeJsonSchemas, writeFile };
|
|
347
|
+
export { Extensions, FoldingController, FoldingModel, IJSONContributionRegistry, IJSONSchema, IReference, ITextFileEditorModel, JsonSchema, Registry, createConfiguredDiffEditor, createConfiguredEditor, createModelReference, deleteFile, errorHandler, registerJsonSchema, registerTypescriptWorkerFileProvider, setCollapseStateForMatchingLines, synchronizeJsonSchemas, writeFile };
|
package/dist/monaco.js
CHANGED
|
@@ -38,6 +38,7 @@ import { WorkbenchKeybindingService } from './vscode/vs/workbench/services/keybi
|
|
|
38
38
|
export { registerJsonSchema, synchronizeJsonSchemas } from './json.js';
|
|
39
39
|
import { createInjectedClass } from './tools/injection.js';
|
|
40
40
|
import './vscode/vs/workbench/contrib/codeEditor/browser/workbenchReferenceSearch.js';
|
|
41
|
+
export { registerTypescriptWorkerFileProvider } from './typescript.js';
|
|
41
42
|
let ExtensionPoints = class ExtensionPoints {
|
|
42
43
|
constructor(instantiationService) {
|
|
43
44
|
this.instantiationService = instantiationService;
|
|
@@ -1,13 +1,57 @@
|
|
|
1
1
|
import { U as URI } from '../uri.js';
|
|
2
|
-
import { E as Event, C as CancellationToken,
|
|
2
|
+
import { D as Disposable, E as Event, a as IDisposable, C as CancellationToken, b as Emitter } from '../event.js';
|
|
3
3
|
import { I as IEditorOverrideServices } from '../standaloneServices.js';
|
|
4
|
-
import { I as IFileSystemProviderWithFileReadWriteCapability,
|
|
4
|
+
import { I as IFileSystemProviderWithFileReadWriteCapability, F as FileSystemProviderCapabilities, a as IStat, b as FileType, c as IFileWriteOptions, d as IFileOverwriteOptions, e as IFileDeleteOptions, f as IFileChange, g as IWatchOptions, h as IFileSystemProviderWithFileReadStreamCapability, i as IFileReadStreamOptions, R as ReadableStreamEvents } from '../files.js';
|
|
5
5
|
export { l as FileChangeType, m as FilePermission, j as FileSystemProviderError, k as FileSystemProviderErrorCode } from '../files.js';
|
|
6
6
|
import { I as ILogService } from '../log.js';
|
|
7
7
|
import 'vscode';
|
|
8
8
|
import '../instantiation.js';
|
|
9
9
|
import 'monaco-editor';
|
|
10
10
|
|
|
11
|
+
declare class File implements IStat {
|
|
12
|
+
type: FileType.File;
|
|
13
|
+
ctime: number;
|
|
14
|
+
mtime: number;
|
|
15
|
+
size: number;
|
|
16
|
+
name: string;
|
|
17
|
+
data?: Uint8Array;
|
|
18
|
+
constructor(name: string);
|
|
19
|
+
}
|
|
20
|
+
declare class Directory implements IStat {
|
|
21
|
+
type: FileType.Directory;
|
|
22
|
+
ctime: number;
|
|
23
|
+
mtime: number;
|
|
24
|
+
size: number;
|
|
25
|
+
name: string;
|
|
26
|
+
entries: Map<string, File | Directory>;
|
|
27
|
+
constructor(name: string);
|
|
28
|
+
}
|
|
29
|
+
declare class InMemoryFileSystemProvider extends Disposable implements IFileSystemProviderWithFileReadWriteCapability {
|
|
30
|
+
private _onDidChangeCapabilities;
|
|
31
|
+
readonly onDidChangeCapabilities: Event<void>;
|
|
32
|
+
private _capabilities;
|
|
33
|
+
get capabilities(): FileSystemProviderCapabilities;
|
|
34
|
+
setReadOnly(readonly: boolean): void;
|
|
35
|
+
root: Directory;
|
|
36
|
+
stat(resource: URI): Promise<IStat>;
|
|
37
|
+
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
38
|
+
readFile(resource: URI): Promise<Uint8Array>;
|
|
39
|
+
writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
|
|
40
|
+
rename(from: URI, to: URI, opts: IFileOverwriteOptions): Promise<void>;
|
|
41
|
+
delete(resource: URI, opts: IFileDeleteOptions): Promise<void>;
|
|
42
|
+
mkdir(resource: URI): Promise<void>;
|
|
43
|
+
private _lookup;
|
|
44
|
+
private _lookupAsDirectory;
|
|
45
|
+
private _lookupAsFile;
|
|
46
|
+
private _lookupParentDirectory;
|
|
47
|
+
private readonly _onDidChangeFile;
|
|
48
|
+
readonly onDidChangeFile: Event<readonly IFileChange[]>;
|
|
49
|
+
private _bufferedChanges;
|
|
50
|
+
private _fireSoonHandle?;
|
|
51
|
+
watch(resource: URI, opts: IWatchOptions): IDisposable;
|
|
52
|
+
private _fireSoon;
|
|
53
|
+
}
|
|
54
|
+
|
|
11
55
|
declare class IndexedDB {
|
|
12
56
|
private readonly name;
|
|
13
57
|
static create(name: string, version: number | undefined, stores: string[]): Promise<IndexedDB>;
|
|
@@ -57,24 +101,25 @@ declare class HTMLFileSystemProvider implements IFileSystemProviderWithFileReadW
|
|
|
57
101
|
private createFileSystemProviderError;
|
|
58
102
|
}
|
|
59
103
|
|
|
60
|
-
declare
|
|
61
|
-
|
|
104
|
+
declare class StaticFileSystemProvider extends Disposable implements IFileSystemProviderWithFileReadWriteCapability {
|
|
105
|
+
private files;
|
|
62
106
|
capabilities: number;
|
|
63
|
-
|
|
64
|
-
|
|
107
|
+
constructor(readonly: boolean);
|
|
108
|
+
onDidChangeCapabilities: Event<any>;
|
|
109
|
+
_onDidChangeFile: Emitter<readonly IFileChange[]>;
|
|
65
110
|
onDidChangeFile: Event<readonly IFileChange[]>;
|
|
111
|
+
registerFile(resource: URI, getContent: () => Promise<string | Uint8Array>, setContent?: (content: string) => Promise<void>): IDisposable;
|
|
112
|
+
stat(resource: URI): Promise<IStat>;
|
|
113
|
+
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
66
114
|
readFile(resource: URI): Promise<Uint8Array>;
|
|
67
|
-
writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
|
|
68
115
|
watch(): IDisposable;
|
|
69
|
-
|
|
70
|
-
mkdir(): Promise<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
rename(): Promise<void>;
|
|
74
|
-
onDidWatchError: Event<any>;
|
|
116
|
+
writeFile(resource: URI, content: Uint8Array): Promise<void>;
|
|
117
|
+
mkdir(): Promise<never>;
|
|
118
|
+
delete(): Promise<never>;
|
|
119
|
+
rename(): Promise<never>;
|
|
75
120
|
}
|
|
76
121
|
declare function getServiceOverride(): IEditorOverrideServices;
|
|
77
122
|
declare function registerExtensionFile(extensionLocation: URI, path: string, getContent: () => Promise<string | Uint8Array>): IDisposable;
|
|
78
|
-
declare function registerFileSystemOverlay(provider:
|
|
123
|
+
declare function registerFileSystemOverlay(priority: number, provider: StaticFileSystemProvider): IDisposable;
|
|
79
124
|
|
|
80
|
-
export { FileSystemProviderCapabilities, FileType, HTMLFileSystemProvider, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions,
|
|
125
|
+
export { FileSystemProviderCapabilities, FileType, HTMLFileSystemProvider, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions, InMemoryFileSystemProvider, StaticFileSystemProvider, getServiceOverride as default, registerExtensionFile, registerFileSystemOverlay };
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { __decorate, __param } from '../node_modules/tslib/tslib.es6.js';
|
|
2
2
|
import '../vscode-services/missing-services.js';
|
|
3
|
+
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
3
4
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
4
5
|
import { FileService } from '../vscode/vs/platform/files/common/fileService.js';
|
|
5
6
|
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
6
7
|
import { InMemoryFileSystemProvider } from '../vscode/vs/platform/files/common/inMemoryFilesystemProvider.js';
|
|
7
|
-
import {
|
|
8
|
-
|
|
8
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
9
|
+
import { FileType, FilePermission } from '../vscode/vs/platform/files/common/files.js';
|
|
10
|
+
export { FileChangeType, FileSystemProviderCapabilities } from '../vscode/vs/platform/files/common/files.js';
|
|
9
11
|
import { createFileSystemProviderError, FileSystemProviderErrorCode, FileSystemProviderError, IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
10
12
|
export { FileSystemProviderError, FileSystemProviderErrorCode } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
11
13
|
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
12
|
-
import { joinPath } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
14
|
+
import { extUri, joinPath } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
13
15
|
import { Event, Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
14
16
|
export { HTMLFileSystemProvider } from 'monaco-editor/esm/vs/platform/files/browser/htmlFileSystemProvider.js';
|
|
15
|
-
import * as
|
|
17
|
+
import * as path from 'monaco-editor/esm/vs/base/common/path.js';
|
|
16
18
|
import '../vscode/vs/workbench/contrib/files/browser/files.contribution.js';
|
|
17
|
-
class
|
|
18
|
-
constructor(getContent) {
|
|
19
|
+
class StaticFile {
|
|
20
|
+
constructor(getContent, setContent) {
|
|
19
21
|
this.getContent = getContent;
|
|
22
|
+
this.setContent = setContent;
|
|
20
23
|
this.ctime = Date.now();
|
|
21
24
|
this.mtime = Date.now();
|
|
22
25
|
this.size = 0;
|
|
@@ -25,89 +28,76 @@ class File {
|
|
|
25
28
|
}
|
|
26
29
|
const encoder = new TextEncoder();
|
|
27
30
|
const decoder = new TextDecoder();
|
|
28
|
-
class
|
|
29
|
-
constructor() {
|
|
31
|
+
class StaticFileSystemProvider extends Disposable {
|
|
32
|
+
constructor(readonly) {
|
|
33
|
+
super();
|
|
34
|
+
this.readonly = readonly;
|
|
30
35
|
this.onDidChangeCapabilities = Event.None;
|
|
36
|
+
this._onDidChangeFile = new Emitter();
|
|
37
|
+
this.onDidChangeFile = this._onDidChangeFile.event;
|
|
38
|
+
this.files = new Map();
|
|
31
39
|
this.capabilities = 2 | 1024 ;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
async readFile(resource) {
|
|
36
|
-
try {
|
|
37
|
-
const content = await this.getFileContent(resource);
|
|
38
|
-
if (content != null) {
|
|
39
|
-
return encoder.encode(content);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
catch (err) {
|
|
43
|
-
throw createFileSystemProviderError(err, FileSystemProviderErrorCode.Unknown);
|
|
44
|
-
}
|
|
45
|
-
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
46
|
-
}
|
|
47
|
-
async writeFile(resource, content, opts) {
|
|
48
|
-
try {
|
|
49
|
-
await this.setFileContent(resource, decoder.decode(content), opts);
|
|
50
|
-
}
|
|
51
|
-
catch (err) {
|
|
52
|
-
throw createFileSystemProviderError(err, FileSystemProviderErrorCode.Unknown);
|
|
40
|
+
if (readonly) {
|
|
41
|
+
this.capabilities |= 2048 ;
|
|
53
42
|
}
|
|
54
43
|
}
|
|
55
|
-
|
|
56
|
-
|
|
44
|
+
registerFile(resource, getContent, setContent) {
|
|
45
|
+
this.files.set(( resource.toString()), new StaticFile(getContent, setContent));
|
|
46
|
+
this._onDidChangeFile.fire([{
|
|
47
|
+
resource,
|
|
48
|
+
type: 1
|
|
49
|
+
}]);
|
|
50
|
+
return {
|
|
51
|
+
dispose: () => {
|
|
52
|
+
this.files.delete(( resource.toString()));
|
|
53
|
+
this._onDidChangeFile.fire([{
|
|
54
|
+
resource,
|
|
55
|
+
type: 2
|
|
56
|
+
}]);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
57
59
|
}
|
|
58
60
|
async stat(resource) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
const resourceUri = ( resource.toString(true));
|
|
62
|
+
const file = this.files.get(resourceUri);
|
|
63
|
+
if (file != null) {
|
|
64
|
+
return {
|
|
65
|
+
ctime: Date.now(),
|
|
66
|
+
mtime: Date.now(),
|
|
67
|
+
size: 0,
|
|
68
|
+
type: FileType.File,
|
|
69
|
+
permissions: file.setContent == null || this.readonly ? FilePermission.Readonly : undefined
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const handledUris = Array.from(( this.files.keys()));
|
|
73
|
+
for (const handledUri of handledUris) {
|
|
74
|
+
if (handledUri.startsWith(resourceUri + '/')) {
|
|
62
75
|
return {
|
|
63
|
-
type: FileType.File,
|
|
64
|
-
size: encoder.encode(content).length,
|
|
65
76
|
ctime: Date.now(),
|
|
66
|
-
mtime: Date.now()
|
|
77
|
+
mtime: Date.now(),
|
|
78
|
+
size: 0,
|
|
79
|
+
type: FileType.Directory
|
|
67
80
|
};
|
|
68
81
|
}
|
|
69
82
|
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
throw createFileSystemProviderError(err, FileSystemProviderErrorCode.Unknown);
|
|
72
|
-
}
|
|
73
83
|
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
74
84
|
}
|
|
75
|
-
async
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
const path = resource.path.slice(1);
|
|
94
|
-
return typescript.typescriptDefaults.getExtraLibs()[path]?.content ?? typescript.javascriptDefaults.getExtraLibs()[path]?.content;
|
|
95
|
-
}
|
|
96
|
-
async setFileContent() { }
|
|
97
|
-
}
|
|
98
|
-
class ExtensionFileSystemProviderWithFileReadWriteCapability {
|
|
99
|
-
constructor() {
|
|
100
|
-
this.capabilities = 2 | 1024 | 2048 ;
|
|
101
|
-
this.onDidChangeFile = Event.None;
|
|
102
|
-
this.onDidChangeCapabilities = Event.None;
|
|
103
|
-
this.files = new Map();
|
|
104
|
-
}
|
|
105
|
-
async stat(resource) {
|
|
106
|
-
const file = this.files.get(( resource.toString()));
|
|
107
|
-
if (file != null) {
|
|
108
|
-
return file;
|
|
109
|
-
}
|
|
110
|
-
throw FileSystemProviderError.create('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
85
|
+
async readdir(resource) {
|
|
86
|
+
const includedPaths = ( Array.from(( this.files.keys()))
|
|
87
|
+
.map(uri => path.relative(resource.path, ( URI.parse(uri)).path)))
|
|
88
|
+
.filter(path => !path.startsWith('..'));
|
|
89
|
+
const files = includedPaths.filter(path => !path.includes('/'));
|
|
90
|
+
const directories = ( includedPaths.filter(path => path.includes('/')).map(path => path.slice(0, path.indexOf('/'))));
|
|
91
|
+
return [
|
|
92
|
+
...( files.map(path => [
|
|
93
|
+
path,
|
|
94
|
+
FileType.File
|
|
95
|
+
])),
|
|
96
|
+
...( directories.map(path => [
|
|
97
|
+
path,
|
|
98
|
+
FileType.Directory
|
|
99
|
+
]))
|
|
100
|
+
];
|
|
111
101
|
}
|
|
112
102
|
async readFile(resource) {
|
|
113
103
|
const file = this.files.get(( resource.toString()));
|
|
@@ -125,23 +115,21 @@ class ExtensionFileSystemProviderWithFileReadWriteCapability {
|
|
|
125
115
|
watch() {
|
|
126
116
|
return Disposable.None;
|
|
127
117
|
}
|
|
128
|
-
|
|
129
|
-
this.files.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
118
|
+
async writeFile(resource, content) {
|
|
119
|
+
const file = this.files.get(( resource.toString()));
|
|
120
|
+
if (file?.setContent != null) {
|
|
121
|
+
await file.setContent(decoder.decode(content));
|
|
122
|
+
this._onDidChangeFile.fire([{
|
|
123
|
+
resource,
|
|
124
|
+
type: 0
|
|
125
|
+
}]);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
137
128
|
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
138
129
|
}
|
|
139
130
|
async mkdir() {
|
|
140
131
|
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
141
132
|
}
|
|
142
|
-
readdir() {
|
|
143
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
144
|
-
}
|
|
145
133
|
async delete() {
|
|
146
134
|
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
147
135
|
}
|
|
@@ -149,32 +137,33 @@ class ExtensionFileSystemProviderWithFileReadWriteCapability {
|
|
|
149
137
|
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
150
138
|
}
|
|
151
139
|
}
|
|
152
|
-
const extensionFileSystemProvider = new ExtensionFileSystemProviderWithFileReadWriteCapability();
|
|
153
140
|
function isFullfiled(result) {
|
|
154
141
|
return result.status === 'fulfilled';
|
|
155
142
|
}
|
|
156
143
|
class OverlayFileSystemProvider {
|
|
157
144
|
constructor(_default) {
|
|
158
145
|
this._default = _default;
|
|
159
|
-
this.
|
|
160
|
-
this.onDidChangeCapabilities = Event.
|
|
146
|
+
this.providers = [];
|
|
147
|
+
this.onDidChangeCapabilities = Event.None;
|
|
161
148
|
this._onDidChangeFile = new Emitter();
|
|
162
149
|
this.onDidChangeFile = Event.any(this._default.onDidChangeFile, this._onDidChangeFile.event);
|
|
163
150
|
this._onDidChangeOverlays = new Emitter();
|
|
164
151
|
this.onDidChangeOverlays = this._onDidChangeOverlays.event;
|
|
165
152
|
this.capabilities = 2 | 1024 ;
|
|
166
153
|
}
|
|
167
|
-
register(
|
|
168
|
-
|
|
154
|
+
register(priority, provider) {
|
|
155
|
+
const item = { priority, provider };
|
|
156
|
+
this.providers.push(item);
|
|
157
|
+
this.providers.sort((a, b) => b.priority - a.priority);
|
|
169
158
|
const disposableStore = new DisposableStore();
|
|
170
|
-
disposableStore.add(
|
|
159
|
+
disposableStore.add(provider.onDidChangeFile(e => {
|
|
171
160
|
this._onDidChangeFile.fire(e);
|
|
172
161
|
}));
|
|
173
162
|
disposableStore.add({
|
|
174
163
|
dispose: () => {
|
|
175
|
-
const index = this.
|
|
164
|
+
const index = this.providers.indexOf(item);
|
|
176
165
|
if (index >= 0) {
|
|
177
|
-
this.
|
|
166
|
+
this.providers.splice(index, 1);
|
|
178
167
|
this._onDidChangeOverlays.fire();
|
|
179
168
|
}
|
|
180
169
|
}
|
|
@@ -183,7 +172,7 @@ class OverlayFileSystemProvider {
|
|
|
183
172
|
return disposableStore;
|
|
184
173
|
}
|
|
185
174
|
get delegates() {
|
|
186
|
-
return [this.
|
|
175
|
+
return [...( this.providers.map(({ provider }) => provider)), this._default];
|
|
187
176
|
}
|
|
188
177
|
async readFromDelegates(caller) {
|
|
189
178
|
let firstError;
|
|
@@ -201,15 +190,30 @@ class OverlayFileSystemProvider {
|
|
|
201
190
|
}
|
|
202
191
|
throw firstError;
|
|
203
192
|
}
|
|
204
|
-
async writeToDelegates(caller) {
|
|
205
|
-
const
|
|
206
|
-
if (((
|
|
207
|
-
|
|
193
|
+
async writeToDelegates(resource, caller) {
|
|
194
|
+
for (const provider of this.delegates) {
|
|
195
|
+
if (((provider.capabilities & 2048) ) > 0) {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
const stats = await provider.stat(resource);
|
|
200
|
+
if (((stats.permissions ?? 0) & FilePermission.Readonly) > 0) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
return await caller(provider);
|
|
208
|
+
}
|
|
209
|
+
catch (err) {
|
|
210
|
+
if (err instanceof FileSystemProviderError && err.code === FileSystemProviderErrorCode.NoPermissions) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
throw err;
|
|
208
214
|
}
|
|
209
|
-
})));
|
|
210
|
-
if (!( results.some(result => result.status === 'fulfilled'))) {
|
|
211
|
-
throw results[0].reason;
|
|
212
215
|
}
|
|
216
|
+
throw createFileSystemProviderError('File not writable', FileSystemProviderErrorCode.NoPermissions);
|
|
213
217
|
}
|
|
214
218
|
async stat(resource) {
|
|
215
219
|
return this.readFromDelegates(delegate => delegate.stat(resource));
|
|
@@ -219,7 +223,7 @@ class OverlayFileSystemProvider {
|
|
|
219
223
|
}
|
|
220
224
|
async readdir(resource) {
|
|
221
225
|
const results = await Promise.allSettled(( this.delegates.map(delegate => delegate.readdir(resource))));
|
|
222
|
-
if (!( results.some(
|
|
226
|
+
if (!( results.some(isFullfiled))) {
|
|
223
227
|
throw results[0].reason;
|
|
224
228
|
}
|
|
225
229
|
return Object.entries(Object.fromEntries(( results.filter(isFullfiled).map(result => result.value)).flat()));
|
|
@@ -232,19 +236,26 @@ class OverlayFileSystemProvider {
|
|
|
232
236
|
return store;
|
|
233
237
|
}
|
|
234
238
|
async writeFile(resource, content, opts) {
|
|
235
|
-
await this.writeToDelegates(delegate => delegate.writeFile(resource, content, opts));
|
|
239
|
+
await this.writeToDelegates(resource, delegate => delegate.writeFile(resource, content, opts));
|
|
236
240
|
}
|
|
237
241
|
async mkdir(resource) {
|
|
238
|
-
await this.writeToDelegates(delegate => delegate.mkdir(resource));
|
|
242
|
+
await this.writeToDelegates(resource, delegate => delegate.mkdir(resource));
|
|
239
243
|
}
|
|
240
244
|
async delete(resource, opts) {
|
|
241
|
-
await this.writeToDelegates(delegate => delegate.delete(resource, opts));
|
|
245
|
+
await this.writeToDelegates(resource, delegate => delegate.delete(resource, opts));
|
|
242
246
|
}
|
|
243
247
|
async rename(from, to, opts) {
|
|
244
|
-
await this.writeToDelegates(delegate => delegate.rename(from, to, opts));
|
|
248
|
+
await this.writeToDelegates(from, delegate => delegate.rename(from, to, opts));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
class MkdirpOnWriteInMemoryFileSystemProvider extends InMemoryFileSystemProvider {
|
|
252
|
+
async writeFile(resource, content, opts) {
|
|
253
|
+
await StandaloneServices.get(IFileService)['mkdirp'](this, extUri.dirname(resource));
|
|
254
|
+
return super.writeFile(resource, content, opts);
|
|
245
255
|
}
|
|
246
256
|
}
|
|
247
|
-
const fileSystemProvider = new OverlayFileSystemProvider(new
|
|
257
|
+
const fileSystemProvider = new OverlayFileSystemProvider(new MkdirpOnWriteInMemoryFileSystemProvider());
|
|
258
|
+
const extensionFileSystemProvider = new StaticFileSystemProvider(true);
|
|
248
259
|
let MemoryFileService = class MemoryFileService extends FileService {
|
|
249
260
|
constructor(logService) {
|
|
250
261
|
super(logService);
|
|
@@ -271,8 +282,7 @@ function getServiceOverride() {
|
|
|
271
282
|
function registerExtensionFile(extensionLocation, path, getContent) {
|
|
272
283
|
return extensionFileSystemProvider.registerFile(joinPath(extensionLocation, path), getContent);
|
|
273
284
|
}
|
|
274
|
-
function registerFileSystemOverlay(provider) {
|
|
275
|
-
return fileSystemProvider.register(provider);
|
|
285
|
+
function registerFileSystemOverlay(priority, provider) {
|
|
286
|
+
return fileSystemProvider.register(priority, provider);
|
|
276
287
|
}
|
|
277
|
-
registerFileSystemOverlay
|
|
278
|
-
export { FileType, SimpleTextFileSystemProvider, getServiceOverride as default, registerExtensionFile, registerFileSystemOverlay };
|
|
288
|
+
export { FilePermission, FileType, InMemoryFileSystemProvider, StaticFileSystemProvider, getServiceOverride as default, registerExtensionFile, registerFileSystemOverlay };
|
|
@@ -8,7 +8,7 @@ import { FileLoggerService } from '../vscode/vs/platform/log/common/fileLog.js';
|
|
|
8
8
|
import '../vscode/vs/workbench/contrib/output/browser/output.contribution.js';
|
|
9
9
|
let _FileLoggerService = class _FileLoggerService extends FileLoggerService {
|
|
10
10
|
constructor(fileService) {
|
|
11
|
-
super(LogLevel.Info, URI.
|
|
11
|
+
super(LogLevel.Info, ( URI.from({ scheme: 'logs', path: '/' })), fileService);
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
_FileLoggerService = __decorate([
|
package/dist/services.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference path="./debugProtocol.d.ts" />
|
|
2
2
|
|
|
3
|
-
import { E as Event$1, a as IDisposable, C as CancellationToken, D as Disposable,
|
|
3
|
+
import { E as Event$1, a as IDisposable, C as CancellationToken, D as Disposable, b as Emitter } from './event.js';
|
|
4
4
|
import { i as IMarkdownString, l as IEditorModel, p as ITextBufferFactory, c as ITextModel, v as ITextModelCreationOptions, w as IEditor, q as IDiffEditor, t as IResourceEditorInput, u as ITextResourceEditorInput, I as IEditorOptions, x as IResourceEditorInputIdentifier, h as IRange, g as IPosition, P as Position$1, y as IDocumentDiffProviderOptions, z as IDocumentDiff, A as IChange, b as ICodeEditor, B as IBoundarySashes, O as Orientation, C as IDiffEditor$1, D as IDecorationRenderOptions, d as IModelDecorationOptions } from './editorBrowser.js';
|
|
5
5
|
export { F as ITextModelContentProvider, G as ITextModelService, M as MarkdownStringTrustedOptions } from './editorBrowser.js';
|
|
6
6
|
import { S as ServiceIdentifier, c as IConstructorSignature, I as IInstantiationService, B as BrandedService, a as ServicesAccessor } from './instantiation.js';
|
|
7
7
|
import { d as ILanguageIdCodec, S as SubmenuAction, e as IAction, f as ICommandService, g as IEditorCloseEvent, h as IVisibleEditorPane, E as EditorInput, i as EditorsOrder, j as IEditorIdentifier, k as IEditorGroup, G as GroupIdentifier, l as IEditorPane, m as IUntitledTextResourceEditorInput, n as IResourceDiffEditorInput, o as ITextDiffEditorPane, p as IUntypedEditorInput, q as ICloseEditorOptions, s as IFindEditorOptions, t as IRevertOptions, u as ISaveOptions, v as IGroupModelChangeEvent, w as ColorIdentifier, x as Color, y as LanguageSelector, z as Command, T as TextEdit, A as IInplaceReplaceSupportResult, W as WorkspaceEdit, B as WorkspaceEditMetadata, D as IActionRunner } from './languageFeatures.js';
|
|
8
8
|
export { a7 as DialogType, ad as IBaseDialogOptions, ae as ICheckbox, af as ICheckboxResult, aa as IConfirmDialogArgs, ai as IConfirmation, aj as IConfirmationResult, ah as ICustomDialogMarkdown, ag as ICustomDialogOptions, a6 as IDialogArgs, a9 as IDialogHandler, a8 as IDialogResult, H as IDialogService, K as IEditorGroupsService, ak as IInput, ab as IInputDialogArgs, am as IInputElement, al as IInputResult, a as ILanguageConfigurationService, I as ILanguageFeaturesService, J as IMarkerService, V as INeverShowAgainOptions, X as INotification, Y as INotificationActions, $ as INotificationHandle, Z as INotificationProgress, _ as INotificationProgressProperties, R as INotificationProperties, b as INotificationService, an as IPrompt, ap as IPromptBaseButton, aq as IPromptButton, ar as IPromptCancelButton, a0 as IPromptChoice, a1 as IPromptChoiceWithMenu, ac as IPromptDialogArgs, a2 as IPromptOptions, ao as IPromptResult, as as IPromptResultWithCancel, at as IPromptWithCustomCancel, au as IPromptWithDefaultCancel, a3 as IStatusMessageOptions, M as ITextFileService, N as IWorkingCopyFileService, U as NeverShowAgainScope, a4 as NoOpNotification, a5 as NoOpProgress, P as NotificationMessage, Q as NotificationPriority, O as NotificationsFilter } from './languageFeatures.js';
|
|
9
9
|
import { S as Severity } from './severity.js';
|
|
10
|
-
import {
|
|
10
|
+
import { b as FileType, V as VSBuffer, x as IFileService } from './files.js';
|
|
11
11
|
import { a as UriComponents, U as URI } from './uri.js';
|
|
12
12
|
import { b as IWorkspaceFolder, I as IAnyWorkspaceIdentifier, c as IWorkspaceContextService } from './workspace.js';
|
|
13
13
|
import { c as IStringDictionary, d as IExtensionInfo, C as ConfigurationScope, E as EditPresentationTypes } from './configurationRegistry.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api.js';
|
|
2
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
4
|
+
import { registerFileSystemOverlay, StaticFileSystemProvider } from './service-override/files.js';
|
|
5
|
+
class TypescriptWorkerFileSystemProvider extends StaticFileSystemProvider {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(true);
|
|
8
|
+
this.updateLibs = () => {
|
|
9
|
+
this.libDisposable?.dispose();
|
|
10
|
+
const disposable = new DisposableStore();
|
|
11
|
+
for (const [path, lib] of Object.entries(monaco.languages.typescript.typescriptDefaults.getExtraLibs())) {
|
|
12
|
+
disposable.add(this.registerFile(URI.file(path), async () => lib.content));
|
|
13
|
+
}
|
|
14
|
+
for (const [path, lib] of Object.entries(monaco.languages.typescript.javascriptDefaults.getExtraLibs())) {
|
|
15
|
+
disposable.add(this.registerFile(URI.file(path), async () => lib.content));
|
|
16
|
+
}
|
|
17
|
+
this.libDisposable = disposable;
|
|
18
|
+
};
|
|
19
|
+
this._register(monaco.languages.typescript.typescriptDefaults.onDidExtraLibsChange(this.updateLibs));
|
|
20
|
+
this._register(monaco.languages.typescript.javascriptDefaults.onDidExtraLibsChange(this.updateLibs));
|
|
21
|
+
this.updateLibs();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function registerTypescriptWorkerFileProvider() {
|
|
25
|
+
return registerFileSystemOverlay(0, new TypescriptWorkerFileSystemProvider());
|
|
26
|
+
}
|
|
27
|
+
export { registerTypescriptWorkerFileProvider };
|