@codingame/monaco-vscode-api 1.79.6 → 1.79.7-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/files.d.ts +1 -1
- package/dist/monaco.d.ts +4 -2
- package/dist/monaco.js +1 -0
- package/dist/service-override/files.d.ts +60 -16
- package/dist/service-override/files.js +72 -108
- package/dist/service-override/output.js +1 -1
- package/dist/services.d.ts +1 -1
- package/dist/typescript.js +27 -0
- package/monaco-editor-treemending.patch +780 -780
- package/package.json +1 -1
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 };
|
package/dist/monaco.d.ts
CHANGED
|
@@ -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 {
|
|
2
|
+
import { D as Disposable, E as Event, a as IDisposable, C as CancellationToken } 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,24 @@ 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;
|
|
106
|
+
constructor();
|
|
62
107
|
capabilities: number;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
108
|
+
onDidChangeCapabilities: Event<any>;
|
|
109
|
+
onDidChangeFile: Event<any>;
|
|
110
|
+
registerFile(resource: URI, getContent: () => Promise<string | Uint8Array>): IDisposable;
|
|
111
|
+
stat(resource: URI): Promise<IStat>;
|
|
112
|
+
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
66
113
|
readFile(resource: URI): Promise<Uint8Array>;
|
|
67
|
-
writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
|
|
68
114
|
watch(): IDisposable;
|
|
69
|
-
|
|
70
|
-
mkdir(): Promise<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
rename(): Promise<void>;
|
|
74
|
-
onDidWatchError: Event<any>;
|
|
115
|
+
writeFile(): Promise<never>;
|
|
116
|
+
mkdir(): Promise<never>;
|
|
117
|
+
delete(): Promise<never>;
|
|
118
|
+
rename(): Promise<never>;
|
|
75
119
|
}
|
|
76
120
|
declare function getServiceOverride(): IEditorOverrideServices;
|
|
77
121
|
declare function registerExtensionFile(extensionLocation: URI, path: string, getContent: () => Promise<string | Uint8Array>): IDisposable;
|
|
78
|
-
declare function registerFileSystemOverlay(provider:
|
|
122
|
+
declare function registerFileSystemOverlay(priority: number, provider: StaticFileSystemProvider): IDisposable;
|
|
79
123
|
|
|
80
|
-
export { FileSystemProviderCapabilities, FileType, HTMLFileSystemProvider, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions,
|
|
124
|
+
export { FileSystemProviderCapabilities, FileType, HTMLFileSystemProvider, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions, InMemoryFileSystemProvider, StaticFileSystemProvider, getServiceOverride as default, registerExtensionFile, registerFileSystemOverlay };
|
|
@@ -1,20 +1,22 @@
|
|
|
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
|
|
19
|
+
class StaticFile {
|
|
18
20
|
constructor(getContent) {
|
|
19
21
|
this.getContent = getContent;
|
|
20
22
|
this.ctime = Date.now();
|
|
@@ -24,90 +26,62 @@ class File {
|
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
const encoder = new TextEncoder();
|
|
27
|
-
|
|
28
|
-
class SimpleTextFileSystemProvider {
|
|
29
|
+
class StaticFileSystemProvider extends Disposable {
|
|
29
30
|
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.capabilities = 2 | 1024 | 2048 ;
|
|
30
33
|
this.onDidChangeCapabilities = Event.None;
|
|
31
|
-
this.capabilities = 2 | 1024 ;
|
|
32
34
|
this.onDidChangeFile = Event.None;
|
|
33
|
-
this.
|
|
35
|
+
this.files = new Map();
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
registerFile(resource, getContent) {
|
|
38
|
+
this.files.set(( resource.toString()), new StaticFile(getContent));
|
|
39
|
+
return {
|
|
40
|
+
dispose: () => {
|
|
41
|
+
this.files.delete(( resource.toString()));
|
|
40
42
|
}
|
|
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);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
watch() {
|
|
56
|
-
return Disposable.None;
|
|
43
|
+
};
|
|
57
44
|
}
|
|
58
45
|
async stat(resource) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
const resourceUri = ( resource.toString(true));
|
|
47
|
+
const handledUris = Array.from(( this.files.keys()));
|
|
48
|
+
for (const handledUri of handledUris) {
|
|
49
|
+
if (handledUri === resourceUri) {
|
|
62
50
|
return {
|
|
51
|
+
ctime: Date.now(),
|
|
52
|
+
mtime: Date.now(),
|
|
53
|
+
size: 0,
|
|
63
54
|
type: FileType.File,
|
|
64
|
-
|
|
55
|
+
permissions: FilePermission.Readonly
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
else if (handledUri.startsWith(resourceUri + '/')) {
|
|
59
|
+
return {
|
|
65
60
|
ctime: Date.now(),
|
|
66
|
-
mtime: Date.now()
|
|
61
|
+
mtime: Date.now(),
|
|
62
|
+
size: 0,
|
|
63
|
+
type: FileType.Directory
|
|
67
64
|
};
|
|
68
65
|
}
|
|
69
66
|
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
throw createFileSystemProviderError(err, FileSystemProviderErrorCode.Unknown);
|
|
72
|
-
}
|
|
73
67
|
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
74
68
|
}
|
|
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);
|
|
69
|
+
async readdir(resource) {
|
|
70
|
+
const includedPaths = ( Array.from(( this.files.keys()))
|
|
71
|
+
.map(uri => path.relative(resource.path, ( URI.parse(uri)).path)))
|
|
72
|
+
.filter(path => !path.startsWith('..'));
|
|
73
|
+
const files = includedPaths.filter(path => !path.includes('/'));
|
|
74
|
+
const directories = ( includedPaths.filter(path => path.includes('/')).map(path => path.slice(0, path.indexOf('/'))));
|
|
75
|
+
return [
|
|
76
|
+
...( files.map(path => [
|
|
77
|
+
path,
|
|
78
|
+
FileType.File
|
|
79
|
+
])),
|
|
80
|
+
...( directories.map(path => [
|
|
81
|
+
path,
|
|
82
|
+
FileType.Directory
|
|
83
|
+
]))
|
|
84
|
+
];
|
|
111
85
|
}
|
|
112
86
|
async readFile(resource) {
|
|
113
87
|
const file = this.files.get(( resource.toString()));
|
|
@@ -125,23 +99,12 @@ class ExtensionFileSystemProviderWithFileReadWriteCapability {
|
|
|
125
99
|
watch() {
|
|
126
100
|
return Disposable.None;
|
|
127
101
|
}
|
|
128
|
-
registerFile(resource, getContent) {
|
|
129
|
-
this.files.set(( resource.toString()), new File(getContent));
|
|
130
|
-
return {
|
|
131
|
-
dispose: () => {
|
|
132
|
-
this.files.delete(( resource.toString()));
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
102
|
async writeFile() {
|
|
137
103
|
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
138
104
|
}
|
|
139
105
|
async mkdir() {
|
|
140
106
|
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
141
107
|
}
|
|
142
|
-
readdir() {
|
|
143
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
144
|
-
}
|
|
145
108
|
async delete() {
|
|
146
109
|
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
147
110
|
}
|
|
@@ -149,32 +112,33 @@ class ExtensionFileSystemProviderWithFileReadWriteCapability {
|
|
|
149
112
|
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
150
113
|
}
|
|
151
114
|
}
|
|
152
|
-
const extensionFileSystemProvider = new ExtensionFileSystemProviderWithFileReadWriteCapability();
|
|
153
115
|
function isFullfiled(result) {
|
|
154
116
|
return result.status === 'fulfilled';
|
|
155
117
|
}
|
|
156
118
|
class OverlayFileSystemProvider {
|
|
157
119
|
constructor(_default) {
|
|
158
120
|
this._default = _default;
|
|
159
|
-
this.
|
|
160
|
-
this.onDidChangeCapabilities = Event.
|
|
121
|
+
this.providers = [];
|
|
122
|
+
this.onDidChangeCapabilities = Event.None;
|
|
161
123
|
this._onDidChangeFile = new Emitter();
|
|
162
124
|
this.onDidChangeFile = Event.any(this._default.onDidChangeFile, this._onDidChangeFile.event);
|
|
163
125
|
this._onDidChangeOverlays = new Emitter();
|
|
164
126
|
this.onDidChangeOverlays = this._onDidChangeOverlays.event;
|
|
165
127
|
this.capabilities = 2 | 1024 ;
|
|
166
128
|
}
|
|
167
|
-
register(
|
|
168
|
-
|
|
129
|
+
register(priority, provider) {
|
|
130
|
+
const item = { priority, provider };
|
|
131
|
+
this.providers.push(item);
|
|
132
|
+
this.providers.sort((a, b) => b.priority - a.priority);
|
|
169
133
|
const disposableStore = new DisposableStore();
|
|
170
|
-
disposableStore.add(
|
|
134
|
+
disposableStore.add(provider.onDidChangeFile(e => {
|
|
171
135
|
this._onDidChangeFile.fire(e);
|
|
172
136
|
}));
|
|
173
137
|
disposableStore.add({
|
|
174
138
|
dispose: () => {
|
|
175
|
-
const index = this.
|
|
139
|
+
const index = this.providers.indexOf(item);
|
|
176
140
|
if (index >= 0) {
|
|
177
|
-
this.
|
|
141
|
+
this.providers.splice(index, 1);
|
|
178
142
|
this._onDidChangeOverlays.fire();
|
|
179
143
|
}
|
|
180
144
|
}
|
|
@@ -183,7 +147,7 @@ class OverlayFileSystemProvider {
|
|
|
183
147
|
return disposableStore;
|
|
184
148
|
}
|
|
185
149
|
get delegates() {
|
|
186
|
-
return [this.
|
|
150
|
+
return [...( this.providers.map(({ provider }) => provider)), this._default];
|
|
187
151
|
}
|
|
188
152
|
async readFromDelegates(caller) {
|
|
189
153
|
let firstError;
|
|
@@ -202,14 +166,8 @@ class OverlayFileSystemProvider {
|
|
|
202
166
|
throw firstError;
|
|
203
167
|
}
|
|
204
168
|
async writeToDelegates(caller) {
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
await caller(delegate);
|
|
208
|
-
}
|
|
209
|
-
})));
|
|
210
|
-
if (!( results.some(result => result.status === 'fulfilled'))) {
|
|
211
|
-
throw results[0].reason;
|
|
212
|
-
}
|
|
169
|
+
const firstWritableProvider = this.delegates.find(provider => ((provider.capabilities & 2048) ) === 0);
|
|
170
|
+
return caller(firstWritableProvider);
|
|
213
171
|
}
|
|
214
172
|
async stat(resource) {
|
|
215
173
|
return this.readFromDelegates(delegate => delegate.stat(resource));
|
|
@@ -219,7 +177,7 @@ class OverlayFileSystemProvider {
|
|
|
219
177
|
}
|
|
220
178
|
async readdir(resource) {
|
|
221
179
|
const results = await Promise.allSettled(( this.delegates.map(delegate => delegate.readdir(resource))));
|
|
222
|
-
if (!( results.some(
|
|
180
|
+
if (!( results.some(isFullfiled))) {
|
|
223
181
|
throw results[0].reason;
|
|
224
182
|
}
|
|
225
183
|
return Object.entries(Object.fromEntries(( results.filter(isFullfiled).map(result => result.value)).flat()));
|
|
@@ -244,7 +202,14 @@ class OverlayFileSystemProvider {
|
|
|
244
202
|
await this.writeToDelegates(delegate => delegate.rename(from, to, opts));
|
|
245
203
|
}
|
|
246
204
|
}
|
|
247
|
-
|
|
205
|
+
class MkdirpOnWriteInMemoryFileSystemProvider extends InMemoryFileSystemProvider {
|
|
206
|
+
async writeFile(resource, content, opts) {
|
|
207
|
+
await StandaloneServices.get(IFileService)['mkdirp'](this, extUri.dirname(resource));
|
|
208
|
+
return super.writeFile(resource, content, opts);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const fileSystemProvider = new OverlayFileSystemProvider(new MkdirpOnWriteInMemoryFileSystemProvider());
|
|
212
|
+
const extensionFileSystemProvider = new StaticFileSystemProvider();
|
|
248
213
|
let MemoryFileService = class MemoryFileService extends FileService {
|
|
249
214
|
constructor(logService) {
|
|
250
215
|
super(logService);
|
|
@@ -271,8 +236,7 @@ function getServiceOverride() {
|
|
|
271
236
|
function registerExtensionFile(extensionLocation, path, getContent) {
|
|
272
237
|
return extensionFileSystemProvider.registerFile(joinPath(extensionLocation, path), getContent);
|
|
273
238
|
}
|
|
274
|
-
function registerFileSystemOverlay(provider) {
|
|
275
|
-
return fileSystemProvider.register(provider);
|
|
239
|
+
function registerFileSystemOverlay(priority, provider) {
|
|
240
|
+
return fileSystemProvider.register(priority, provider);
|
|
276
241
|
}
|
|
277
|
-
registerFileSystemOverlay
|
|
278
|
-
export { FileType, SimpleTextFileSystemProvider, getServiceOverride as default, registerExtensionFile, registerFileSystemOverlay };
|
|
242
|
+
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
|
@@ -7,7 +7,7 @@ import { S as ServiceIdentifier, c as IConstructorSignature, I as IInstantiation
|
|
|
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();
|
|
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 };
|