@codingame/monaco-vscode-files-service-override 11.1.2 → 12.0.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/index.d.ts +230 -2
- package/index.js +860 -4
- package/package.json +31 -7
- package/vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.d.ts +68 -0
- package/vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js +43 -44
- package/vscode/src/vs/platform/files/common/fileService.d.ts +113 -0
- package/vscode/src/vs/platform/files/common/fileService.js +157 -176
- package/vscode/src/vs/platform/files/common/io.d.ts +10 -0
- package/vscode/src/vs/platform/files/common/io.js +2 -1
- package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.d.ts +9 -0
- package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +2 -0
- package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.d.ts +24 -0
- package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +5 -2
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.d.ts +111 -0
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +55 -57
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.d.ts +76 -0
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +45 -45
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.d.ts +15 -0
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +13 -11
- package/files.js +0 -859
package/index.js
CHANGED
|
@@ -1,6 +1,862 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
3
|
+
import { StandaloneServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
4
|
+
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
5
|
+
import { mkdirp, FileService } from './vscode/src/vs/platform/files/common/fileService.js';
|
|
6
|
+
import 'vscode/vscode/vs/platform/log/common/log';
|
|
7
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
8
|
+
import { InMemoryFileSystemProvider } from '@codingame/monaco-vscode-2f06fe84-148e-5e6b-a7ca-c7989c5f128a-common/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
9
|
+
export { InMemoryFileSystemProvider } from '@codingame/monaco-vscode-2f06fe84-148e-5e6b-a7ca-c7989c5f128a-common/vscode/vs/platform/files/common/inMemoryFilesystemProvider';
|
|
10
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
11
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
12
|
+
import { FileType, FilePermission, createFileSystemProviderError, FileSystemProviderErrorCode, FileSystemProviderCapabilities, FileChangeType, FileSystemProviderError, hasFileReadStreamCapability } from 'vscode/vscode/vs/platform/files/common/files';
|
|
2
13
|
export { FileChangeType, FilePermission, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType } from 'vscode/vscode/vs/platform/files/common/files';
|
|
14
|
+
import { Disposable, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
15
|
+
import { extUri, basename, dirname } from 'vscode/vscode/vs/base/common/resources';
|
|
16
|
+
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
17
|
+
import { HTMLFileSystemProvider } from 'vscode/vscode/vs/platform/files/browser/htmlFileSystemProvider';
|
|
3
18
|
export { HTMLFileSystemProvider } from 'vscode/vscode/vs/platform/files/browser/htmlFileSystemProvider';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
19
|
+
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
20
|
+
import { IndexedDBFileSystemProvider } from './vscode/src/vs/platform/files/browser/indexedDBFileSystemProvider.js';
|
|
21
|
+
import { IndexedDB } from '@codingame/monaco-vscode-2f06fe84-148e-5e6b-a7ca-c7989c5f128a-common/vscode/vs/base/browser/indexedDB';
|
|
22
|
+
export { IndexedDB } from '@codingame/monaco-vscode-2f06fe84-148e-5e6b-a7ca-c7989c5f128a-common/vscode/vs/base/browser/indexedDB';
|
|
23
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
24
|
+
import { BufferLogger } from '@codingame/monaco-vscode-cea4d01f-6526-5c2f-8b09-b168fead499f-common/vscode/vs/platform/log/common/bufferLog';
|
|
25
|
+
import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
|
|
26
|
+
import { BrowserTextFileService } from './vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js';
|
|
27
|
+
import { FilesConfigurationService } from '@codingame/monaco-vscode-a4683c2b-a0d2-5112-96ba-eedc605346d2-common/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
|
28
|
+
import { IFilesConfigurationService } from 'vscode/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service';
|
|
29
|
+
import { BrowserElevatedFileService } from './vscode/src/vs/workbench/services/files/browser/elevatedFileService.js';
|
|
30
|
+
import { IElevatedFileService } from 'vscode/vscode/vs/workbench/services/files/common/elevatedFileService.service';
|
|
31
|
+
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
|
|
32
|
+
import { newWriteableStream, listenStream } from 'vscode/vscode/vs/base/common/stream';
|
|
33
|
+
import 'vscode/vscode/vs/base/common/cancellation';
|
|
34
|
+
import { registerServiceInitializePreParticipant, checkServicesNotInitialized } from 'vscode/lifecycle';
|
|
35
|
+
import { logsPath } from 'vscode/workbench';
|
|
36
|
+
import '@codingame/monaco-vscode-15626ec7-b165-51e1-8caf-7bcc2ae9b95a-common/vscode/vs/workbench/contrib/files/browser/files.contribution._configuration';
|
|
37
|
+
|
|
38
|
+
class RegisteredDirectory {
|
|
39
|
+
constructor() {
|
|
40
|
+
this.type = FileType.Directory;
|
|
41
|
+
this._onDidChange = new Emitter();
|
|
42
|
+
this.onDidChange = this._onDidChange.event;
|
|
43
|
+
this._onDidDelete = new Emitter();
|
|
44
|
+
this.onDidDelete = this._onDidDelete.event;
|
|
45
|
+
this.ctime = Date.now();
|
|
46
|
+
this.mtime = Date.now();
|
|
47
|
+
this.type = FileType.Directory;
|
|
48
|
+
this.entries = new Map();
|
|
49
|
+
}
|
|
50
|
+
async stats() {
|
|
51
|
+
return {
|
|
52
|
+
ctime: this.ctime,
|
|
53
|
+
mtime: this.mtime,
|
|
54
|
+
size: 0,
|
|
55
|
+
type: FileType.Directory
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
delete() {
|
|
59
|
+
this._onDidDelete.fire();
|
|
60
|
+
}
|
|
61
|
+
addChild(name, node) {
|
|
62
|
+
this.entries.set(name, node);
|
|
63
|
+
this._onDidChange.fire();
|
|
64
|
+
const disposable = {
|
|
65
|
+
dispose: () => {
|
|
66
|
+
this.deleteChild(name);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
node.onDidDelete(() => {
|
|
70
|
+
disposable.dispose();
|
|
71
|
+
});
|
|
72
|
+
return disposable;
|
|
73
|
+
}
|
|
74
|
+
deleteChild(name) {
|
|
75
|
+
if (this.entries.delete(name)) {
|
|
76
|
+
this.mtime = Date.now();
|
|
77
|
+
this._onDidChange.fire();
|
|
78
|
+
if (this.entries.size === 0) {
|
|
79
|
+
this.delete();
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
getChildren(name) {
|
|
86
|
+
return this.entries.get(name);
|
|
87
|
+
}
|
|
88
|
+
read() {
|
|
89
|
+
return Array.from(this.entries.entries()).map(([name, child]) => [name, child.type]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
class RegisteredFile {
|
|
93
|
+
constructor(uri, readonly) {
|
|
94
|
+
this.uri = uri;
|
|
95
|
+
this.readonly = readonly;
|
|
96
|
+
this.type = FileType.File;
|
|
97
|
+
this._onDidChange = new Emitter();
|
|
98
|
+
this.onDidChange = this._onDidChange.event;
|
|
99
|
+
this._onDidDelete = new Emitter();
|
|
100
|
+
this.onDidDelete = this._onDidDelete.event;
|
|
101
|
+
this.ctime = Date.now();
|
|
102
|
+
this.mtime = Date.now();
|
|
103
|
+
this.onDidChange(() => {
|
|
104
|
+
this.mtime = Date.now();
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
async stats() {
|
|
108
|
+
return {
|
|
109
|
+
ctime: this.ctime,
|
|
110
|
+
mtime: this.mtime,
|
|
111
|
+
size: await this.getSize(),
|
|
112
|
+
type: FileType.File,
|
|
113
|
+
permissions: this.readonly ? FilePermission.Readonly : undefined
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
async delete() {
|
|
117
|
+
if (this.readonly) {
|
|
118
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked);
|
|
119
|
+
}
|
|
120
|
+
this._onDidDelete.fire();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
class RegisteredReadOnlyFile extends RegisteredFile {
|
|
124
|
+
constructor(uri, read, size) {
|
|
125
|
+
super(uri, true);
|
|
126
|
+
this.read = read;
|
|
127
|
+
this.size = size;
|
|
128
|
+
}
|
|
129
|
+
async getSize() {
|
|
130
|
+
return this.size;
|
|
131
|
+
}
|
|
132
|
+
write() {
|
|
133
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked);
|
|
134
|
+
}
|
|
135
|
+
async delete() {
|
|
136
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
class RegisteredUriFile extends RegisteredFile {
|
|
140
|
+
constructor(location, url, metadata) {
|
|
141
|
+
super(location, true);
|
|
142
|
+
this.url = url;
|
|
143
|
+
this.metadata = metadata;
|
|
144
|
+
}
|
|
145
|
+
async fetch() {
|
|
146
|
+
const response = await fetch(this.url, {
|
|
147
|
+
headers: this.metadata?.mimeType != null
|
|
148
|
+
? {
|
|
149
|
+
Accept: this.metadata.mimeType
|
|
150
|
+
}
|
|
151
|
+
: {}
|
|
152
|
+
});
|
|
153
|
+
if (response.status !== 200) {
|
|
154
|
+
throw new Error(response.statusText);
|
|
155
|
+
}
|
|
156
|
+
return response;
|
|
157
|
+
}
|
|
158
|
+
async getSize() {
|
|
159
|
+
return this.metadata?.size ?? 0;
|
|
160
|
+
}
|
|
161
|
+
async read() {
|
|
162
|
+
const response = await this.fetch();
|
|
163
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
164
|
+
}
|
|
165
|
+
async readStream() {
|
|
166
|
+
const response = await this.fetch();
|
|
167
|
+
return response.body;
|
|
168
|
+
}
|
|
169
|
+
write() {
|
|
170
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked);
|
|
171
|
+
}
|
|
172
|
+
async delete() {
|
|
173
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const encoder = new TextEncoder();
|
|
177
|
+
function encode(data) {
|
|
178
|
+
if (data instanceof Uint8Array) {
|
|
179
|
+
return data;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
return encoder.encode(data);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
class RegisteredMemoryFile extends RegisteredFile {
|
|
186
|
+
constructor(uri, content) {
|
|
187
|
+
super(uri, false);
|
|
188
|
+
this.content = encode(content);
|
|
189
|
+
}
|
|
190
|
+
async getSize() {
|
|
191
|
+
return this.content.length;
|
|
192
|
+
}
|
|
193
|
+
async read() {
|
|
194
|
+
return this.content;
|
|
195
|
+
}
|
|
196
|
+
async write(content) {
|
|
197
|
+
this.content = content;
|
|
198
|
+
this._onDidChange.fire();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
class RegisteredFileSystemProvider extends Disposable {
|
|
202
|
+
constructor(readonly) {
|
|
203
|
+
super();
|
|
204
|
+
this.memoryFdCounter = 0;
|
|
205
|
+
this.fdMemory = new Map();
|
|
206
|
+
this.onDidChangeCapabilities = Event.None;
|
|
207
|
+
this._onDidChangeFile = new Emitter();
|
|
208
|
+
this.onDidChangeFile = this._onDidChangeFile.event;
|
|
209
|
+
this._bufferedChanges = [];
|
|
210
|
+
this.rootByAuthority = new Map();
|
|
211
|
+
this.capabilities =
|
|
212
|
+
FileSystemProviderCapabilities.FileReadWrite |
|
|
213
|
+
FileSystemProviderCapabilities.PathCaseSensitive |
|
|
214
|
+
FileSystemProviderCapabilities.FileReadStream;
|
|
215
|
+
if (readonly) {
|
|
216
|
+
this.capabilities |= FileSystemProviderCapabilities.Readonly;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
async open(resource) {
|
|
220
|
+
const data = await this.readFile(resource);
|
|
221
|
+
const fd = this.memoryFdCounter++;
|
|
222
|
+
this.fdMemory.set(fd, data);
|
|
223
|
+
return fd;
|
|
224
|
+
}
|
|
225
|
+
async close(fd) {
|
|
226
|
+
this.fdMemory.delete(fd);
|
|
227
|
+
}
|
|
228
|
+
async read(fd, pos, data, offset, length) {
|
|
229
|
+
const memory = this.fdMemory.get(fd);
|
|
230
|
+
if (memory == null) {
|
|
231
|
+
throw createFileSystemProviderError('No file with that descriptor open', FileSystemProviderErrorCode.Unavailable);
|
|
232
|
+
}
|
|
233
|
+
const toWrite = VSBuffer.wrap(memory).slice(pos, pos + length);
|
|
234
|
+
data.set(toWrite.buffer, offset);
|
|
235
|
+
return toWrite.byteLength;
|
|
236
|
+
}
|
|
237
|
+
write(fd, pos, data, offset, length) {
|
|
238
|
+
const memory = this.fdMemory.get(fd);
|
|
239
|
+
if (memory == null) {
|
|
240
|
+
throw createFileSystemProviderError('No file with that descriptor open', FileSystemProviderErrorCode.Unavailable);
|
|
241
|
+
}
|
|
242
|
+
const toWrite = VSBuffer.wrap(data).slice(offset, offset + length);
|
|
243
|
+
memory.set(toWrite.buffer, pos);
|
|
244
|
+
return Promise.resolve(toWrite.byteLength);
|
|
245
|
+
}
|
|
246
|
+
_lookupRoot(authority) {
|
|
247
|
+
const _authority = authority.toLowerCase();
|
|
248
|
+
let root = this.rootByAuthority.get(_authority);
|
|
249
|
+
if (root == null) {
|
|
250
|
+
root = new RegisteredDirectory();
|
|
251
|
+
this.rootByAuthority.set(_authority, root);
|
|
252
|
+
}
|
|
253
|
+
return root;
|
|
254
|
+
}
|
|
255
|
+
_lookup(uri, silent) {
|
|
256
|
+
const parts = uri.path.split('/');
|
|
257
|
+
const root = this._lookupRoot(uri.authority);
|
|
258
|
+
let entry = root;
|
|
259
|
+
for (const part of parts) {
|
|
260
|
+
if (part.length === 0) {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
let child;
|
|
264
|
+
if (entry instanceof RegisteredDirectory) {
|
|
265
|
+
child = entry.getChildren(part);
|
|
266
|
+
}
|
|
267
|
+
if (child == null) {
|
|
268
|
+
if (!silent) {
|
|
269
|
+
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
return undefined;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
entry = child;
|
|
276
|
+
}
|
|
277
|
+
return entry;
|
|
278
|
+
}
|
|
279
|
+
_lookupAsDirectory(uri, silent) {
|
|
280
|
+
const entry = this._lookup(uri, silent);
|
|
281
|
+
if (entry instanceof RegisteredDirectory) {
|
|
282
|
+
return entry;
|
|
283
|
+
}
|
|
284
|
+
throw createFileSystemProviderError('file not a directory', FileSystemProviderErrorCode.FileNotADirectory);
|
|
285
|
+
}
|
|
286
|
+
_lookupAsFile(uri, silent) {
|
|
287
|
+
const entry = this._lookup(uri, silent);
|
|
288
|
+
if (entry != null && entry.type === FileType.File) {
|
|
289
|
+
return entry;
|
|
290
|
+
}
|
|
291
|
+
throw createFileSystemProviderError('file is a directory', FileSystemProviderErrorCode.FileIsADirectory);
|
|
292
|
+
}
|
|
293
|
+
registerFile(file) {
|
|
294
|
+
const parts = file.uri.path.split('/');
|
|
295
|
+
let directory = this._lookupRoot(file.uri.authority);
|
|
296
|
+
let uri = file.uri.with({ path: '/' });
|
|
297
|
+
for (const part of parts.slice(0, -1)) {
|
|
298
|
+
if (part === '') {
|
|
299
|
+
continue;
|
|
300
|
+
}
|
|
301
|
+
uri = extUri.joinPath(uri, part);
|
|
302
|
+
let children = directory.getChildren(part);
|
|
303
|
+
if (children == null) {
|
|
304
|
+
const newDirectory = this.mkdirSync(uri);
|
|
305
|
+
children = newDirectory;
|
|
306
|
+
}
|
|
307
|
+
if (!(children instanceof RegisteredDirectory)) {
|
|
308
|
+
throw new Error(`file '${uri.toString()}' is not a directory`);
|
|
309
|
+
}
|
|
310
|
+
directory = children;
|
|
311
|
+
}
|
|
312
|
+
const name = parts[parts.length - 1];
|
|
313
|
+
if (directory.getChildren(name) != null) {
|
|
314
|
+
throw new Error(`file '${extUri.joinPath(uri, name).toString()}/' already exists`);
|
|
315
|
+
}
|
|
316
|
+
const disposableStore = new DisposableStore();
|
|
317
|
+
disposableStore.add(toDisposable(() => {
|
|
318
|
+
this._fireSoon({
|
|
319
|
+
resource: file.uri,
|
|
320
|
+
type: FileChangeType.DELETED
|
|
321
|
+
});
|
|
322
|
+
}));
|
|
323
|
+
disposableStore.add(file.onDidDelete(() => {
|
|
324
|
+
disposableStore.dispose();
|
|
325
|
+
}));
|
|
326
|
+
disposableStore.add(file.onDidChange(() => {
|
|
327
|
+
this._fireSoon({
|
|
328
|
+
resource: file.uri,
|
|
329
|
+
type: FileChangeType.UPDATED
|
|
330
|
+
});
|
|
331
|
+
}));
|
|
332
|
+
disposableStore.add(directory.addChild(name, file));
|
|
333
|
+
this._fireSoon({
|
|
334
|
+
resource: file.uri,
|
|
335
|
+
type: FileChangeType.ADDED
|
|
336
|
+
});
|
|
337
|
+
return disposableStore;
|
|
338
|
+
}
|
|
339
|
+
async stat(resource) {
|
|
340
|
+
const node = this._lookup(resource, false);
|
|
341
|
+
return await node.stats();
|
|
342
|
+
}
|
|
343
|
+
readdirSync(resource) {
|
|
344
|
+
const directory = this._lookupAsDirectory(resource, false);
|
|
345
|
+
return directory.read();
|
|
346
|
+
}
|
|
347
|
+
async readdir(resource) {
|
|
348
|
+
return this.readdirSync(resource);
|
|
349
|
+
}
|
|
350
|
+
async readFile(resource) {
|
|
351
|
+
const file = this._lookupAsFile(resource, false);
|
|
352
|
+
return await file.read();
|
|
353
|
+
}
|
|
354
|
+
readFileStream(resource, opts, token) {
|
|
355
|
+
const file = this._lookupAsFile(resource, false);
|
|
356
|
+
const stream = newWriteableStream((data) => VSBuffer.concat(data.map((data) => VSBuffer.wrap(data))).buffer, {
|
|
357
|
+
highWaterMark: 10
|
|
358
|
+
});
|
|
359
|
+
void (async () => {
|
|
360
|
+
try {
|
|
361
|
+
if (file.readStream == null ||
|
|
362
|
+
typeof opts.length === 'number' ||
|
|
363
|
+
typeof opts.position === 'number') {
|
|
364
|
+
let buffer = await file.read();
|
|
365
|
+
if (typeof opts.position === 'number' || typeof opts.length === 'number') {
|
|
366
|
+
buffer = buffer.slice(opts.position ?? 0, opts.length);
|
|
367
|
+
}
|
|
368
|
+
stream.end(buffer);
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
const reader = (await file.readStream()).getReader();
|
|
372
|
+
let res = await reader.read();
|
|
373
|
+
while (!res.done) {
|
|
374
|
+
if (token.isCancellationRequested) {
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
await stream.write(res.value);
|
|
378
|
+
if (token.isCancellationRequested) {
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
res = await reader.read();
|
|
382
|
+
}
|
|
383
|
+
stream.end(undefined);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
catch (error) {
|
|
387
|
+
stream.error(createFileSystemProviderError(error, FileSystemProviderErrorCode.Unknown));
|
|
388
|
+
stream.end();
|
|
389
|
+
}
|
|
390
|
+
})();
|
|
391
|
+
return stream;
|
|
392
|
+
}
|
|
393
|
+
watch() {
|
|
394
|
+
return Disposable.None;
|
|
395
|
+
}
|
|
396
|
+
async writeFile(resource, content, opts) {
|
|
397
|
+
const node = this._lookup(resource, true);
|
|
398
|
+
if (node != null && !(node instanceof RegisteredFile)) {
|
|
399
|
+
throw createFileSystemProviderError('file is directory', FileSystemProviderErrorCode.FileIsADirectory);
|
|
400
|
+
}
|
|
401
|
+
if (node == null) {
|
|
402
|
+
throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound);
|
|
403
|
+
}
|
|
404
|
+
if (!opts.overwrite) {
|
|
405
|
+
throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
|
|
406
|
+
}
|
|
407
|
+
await node.write(content);
|
|
408
|
+
}
|
|
409
|
+
async rename() {
|
|
410
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
411
|
+
}
|
|
412
|
+
mkdirSync(resource) {
|
|
413
|
+
if (this._lookup(resource, true) != null) {
|
|
414
|
+
throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists);
|
|
415
|
+
}
|
|
416
|
+
const basename$1 = basename(resource);
|
|
417
|
+
const dirname$1 = dirname(resource);
|
|
418
|
+
const parent = this._lookupAsDirectory(dirname$1, false);
|
|
419
|
+
const directory = new RegisteredDirectory();
|
|
420
|
+
const disposable = new DisposableStore();
|
|
421
|
+
disposable.add(directory.onDidDelete(() => {
|
|
422
|
+
disposable.dispose();
|
|
423
|
+
this._fireSoon({
|
|
424
|
+
resource,
|
|
425
|
+
type: FileChangeType.DELETED
|
|
426
|
+
});
|
|
427
|
+
}));
|
|
428
|
+
disposable.add(directory.onDidChange(() => {
|
|
429
|
+
this._fireSoon({
|
|
430
|
+
resource,
|
|
431
|
+
type: FileChangeType.UPDATED
|
|
432
|
+
});
|
|
433
|
+
}));
|
|
434
|
+
parent.addChild(basename$1, directory);
|
|
435
|
+
this._fireSoon({ type: FileChangeType.ADDED, resource });
|
|
436
|
+
return directory;
|
|
437
|
+
}
|
|
438
|
+
async mkdir() {
|
|
439
|
+
throw createFileSystemProviderError("Can' create a directory", FileSystemProviderErrorCode.NoPermissions);
|
|
440
|
+
}
|
|
441
|
+
deleteSync(resource) {
|
|
442
|
+
const node = this._lookup(resource, true);
|
|
443
|
+
if (node == null) {
|
|
444
|
+
throw createFileSystemProviderError('Not found', FileSystemProviderErrorCode.FileNotFound);
|
|
445
|
+
}
|
|
446
|
+
else if (node.type === FileType.Directory) {
|
|
447
|
+
throw createFileSystemProviderError("Can't delete a directory", FileSystemProviderErrorCode.NoPermissions);
|
|
448
|
+
}
|
|
449
|
+
node.delete();
|
|
450
|
+
}
|
|
451
|
+
async delete(resource) {
|
|
452
|
+
this.deleteSync(resource);
|
|
453
|
+
}
|
|
454
|
+
_fireSoon(...changes) {
|
|
455
|
+
this._bufferedChanges.push(...changes);
|
|
456
|
+
if (this._fireSoonHandle != null) {
|
|
457
|
+
clearTimeout(this._fireSoonHandle);
|
|
458
|
+
this._fireSoonHandle = undefined;
|
|
459
|
+
}
|
|
460
|
+
this._fireSoonHandle = window.setTimeout(() => {
|
|
461
|
+
this._onDidChangeFile.fire(this._bufferedChanges);
|
|
462
|
+
this._bufferedChanges.length = 0;
|
|
463
|
+
}, 5);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
function isFullfiled(result) {
|
|
467
|
+
return result.status === 'fulfilled';
|
|
468
|
+
}
|
|
469
|
+
class OverlayFileSystemProvider {
|
|
470
|
+
constructor() {
|
|
471
|
+
this.providers = [];
|
|
472
|
+
this.onDidChangeCapabilities = Event.None;
|
|
473
|
+
this._onDidChangeFile = new Emitter();
|
|
474
|
+
this.onDidChangeFile = this._onDidChangeFile.event;
|
|
475
|
+
this._onDidChangeOverlays = new Emitter();
|
|
476
|
+
this.onDidChangeOverlays = this._onDidChangeOverlays.event;
|
|
477
|
+
this.capabilities = FileSystemProviderCapabilities.FileReadWrite |
|
|
478
|
+
FileSystemProviderCapabilities.PathCaseSensitive |
|
|
479
|
+
FileSystemProviderCapabilities.FileReadStream;
|
|
480
|
+
}
|
|
481
|
+
register(priority, provider) {
|
|
482
|
+
const item = { priority, provider };
|
|
483
|
+
this.providers.push(item);
|
|
484
|
+
this.providers.sort((a, b) => b.priority - a.priority);
|
|
485
|
+
const disposableStore = new DisposableStore();
|
|
486
|
+
disposableStore.add(provider.onDidChangeFile((e) => {
|
|
487
|
+
this._onDidChangeFile.fire(e);
|
|
488
|
+
}));
|
|
489
|
+
disposableStore.add({
|
|
490
|
+
dispose: () => {
|
|
491
|
+
const index = this.providers.indexOf(item);
|
|
492
|
+
if (index >= 0) {
|
|
493
|
+
this.providers.splice(index, 1);
|
|
494
|
+
this._onDidChangeOverlays.fire();
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
this._onDidChangeOverlays.fire();
|
|
499
|
+
return disposableStore;
|
|
500
|
+
}
|
|
501
|
+
get delegates() {
|
|
502
|
+
return this.providers.map(({ provider }) => provider);
|
|
503
|
+
}
|
|
504
|
+
async readFromDelegates(caller, token) {
|
|
505
|
+
if (this.delegates.length === 0) {
|
|
506
|
+
throw createFileSystemProviderError('No delegate', FileSystemProviderErrorCode.Unavailable);
|
|
507
|
+
}
|
|
508
|
+
let firstError;
|
|
509
|
+
for (const delegate of this.delegates) {
|
|
510
|
+
if (token != null && token.isCancellationRequested) {
|
|
511
|
+
throw new Error('Cancelled');
|
|
512
|
+
}
|
|
513
|
+
try {
|
|
514
|
+
return await caller(delegate);
|
|
515
|
+
}
|
|
516
|
+
catch (err) {
|
|
517
|
+
firstError ?? (firstError = err);
|
|
518
|
+
if (err instanceof FileSystemProviderError &&
|
|
519
|
+
[
|
|
520
|
+
FileSystemProviderErrorCode.NoPermissions,
|
|
521
|
+
FileSystemProviderErrorCode.FileNotFound,
|
|
522
|
+
FileSystemProviderErrorCode.Unavailable
|
|
523
|
+
].includes(err.code)) {
|
|
524
|
+
continue;
|
|
525
|
+
}
|
|
526
|
+
throw err;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
throw firstError;
|
|
530
|
+
}
|
|
531
|
+
async writeToDelegates(caller) {
|
|
532
|
+
if (this.delegates.length === 0) {
|
|
533
|
+
throw createFileSystemProviderError('No delegate', FileSystemProviderErrorCode.Unavailable);
|
|
534
|
+
}
|
|
535
|
+
for (const provider of this.delegates) {
|
|
536
|
+
if ((provider.capabilities & FileSystemProviderCapabilities.Readonly) > 0) {
|
|
537
|
+
continue;
|
|
538
|
+
}
|
|
539
|
+
try {
|
|
540
|
+
return await caller(provider);
|
|
541
|
+
}
|
|
542
|
+
catch (err) {
|
|
543
|
+
if (err instanceof FileSystemProviderError &&
|
|
544
|
+
[
|
|
545
|
+
FileSystemProviderErrorCode.NoPermissions,
|
|
546
|
+
FileSystemProviderErrorCode.FileNotFound,
|
|
547
|
+
FileSystemProviderErrorCode.Unavailable
|
|
548
|
+
].includes(err.code)) {
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
throw err;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
555
|
+
}
|
|
556
|
+
async stat(resource) {
|
|
557
|
+
return await this.readFromDelegates(async (delegate) => {
|
|
558
|
+
const result = await delegate.stat(resource);
|
|
559
|
+
const readOnly = (delegate.capabilities & FileSystemProviderCapabilities.Readonly) > 0;
|
|
560
|
+
return {
|
|
561
|
+
...result,
|
|
562
|
+
permissions: result.permissions ?? (readOnly ? FilePermission.Readonly : undefined)
|
|
563
|
+
};
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
async readFile(resource) {
|
|
567
|
+
return await this.readFromDelegates((delegate) => delegate.readFile(resource));
|
|
568
|
+
}
|
|
569
|
+
readFileStream(resource, opts, token) {
|
|
570
|
+
const writableStream = newWriteableStream((data) => VSBuffer.concat(data.map((data) => VSBuffer.wrap(data))).buffer);
|
|
571
|
+
this.readFromDelegates(async (delegate) => {
|
|
572
|
+
if (hasFileReadStreamCapability(delegate)) {
|
|
573
|
+
const stream = delegate.readFileStream(resource, opts, token);
|
|
574
|
+
await new Promise((resolve, reject) => {
|
|
575
|
+
let dataReceived = false;
|
|
576
|
+
listenStream(stream, {
|
|
577
|
+
onData(data) {
|
|
578
|
+
dataReceived = true;
|
|
579
|
+
void writableStream.write(data);
|
|
580
|
+
},
|
|
581
|
+
onEnd() {
|
|
582
|
+
writableStream.end();
|
|
583
|
+
resolve();
|
|
584
|
+
},
|
|
585
|
+
onError(err) {
|
|
586
|
+
if (!dataReceived) {
|
|
587
|
+
reject(err);
|
|
588
|
+
}
|
|
589
|
+
else {
|
|
590
|
+
writableStream.error(err);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
}, token);
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
let data = await this.readFile(resource);
|
|
598
|
+
if (typeof opts.position === 'number' || typeof opts.length === 'number') {
|
|
599
|
+
data = data.slice(opts.position ?? 0, opts.length);
|
|
600
|
+
}
|
|
601
|
+
return writableStream.end(data);
|
|
602
|
+
}
|
|
603
|
+
}, token).catch((err) => {
|
|
604
|
+
writableStream.error(err);
|
|
605
|
+
});
|
|
606
|
+
return writableStream;
|
|
607
|
+
}
|
|
608
|
+
async readdir(resource) {
|
|
609
|
+
const results = await Promise.allSettled(this.delegates.map(async (delegate) => await delegate.readdir(resource)));
|
|
610
|
+
if (!results.some(isFullfiled)) {
|
|
611
|
+
throw results[0].reason;
|
|
612
|
+
}
|
|
613
|
+
return Object.entries(Object.fromEntries(results
|
|
614
|
+
.filter(isFullfiled)
|
|
615
|
+
.map((result) => result.value)
|
|
616
|
+
.flat()));
|
|
617
|
+
}
|
|
618
|
+
watch(resource, opts) {
|
|
619
|
+
const store = new DisposableStore();
|
|
620
|
+
for (const delegate of this.delegates) {
|
|
621
|
+
store.add(delegate.watch(resource, opts));
|
|
622
|
+
}
|
|
623
|
+
return store;
|
|
624
|
+
}
|
|
625
|
+
async writeFile(resource, content, opts) {
|
|
626
|
+
await this.writeToDelegates(async (delegate) => {
|
|
627
|
+
let stats;
|
|
628
|
+
try {
|
|
629
|
+
stats = await delegate.stat(resource);
|
|
630
|
+
}
|
|
631
|
+
catch {
|
|
632
|
+
}
|
|
633
|
+
if (stats != null && ((stats.permissions ?? 0) & FilePermission.Readonly) > 0) {
|
|
634
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
635
|
+
}
|
|
636
|
+
return await delegate.writeFile(resource, content, opts);
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
async mkdir(resource) {
|
|
640
|
+
await this.writeToDelegates((delegate) => delegate.mkdir(resource));
|
|
641
|
+
}
|
|
642
|
+
async delete(resource, opts) {
|
|
643
|
+
await this.writeToDelegates((delegate) => delegate.delete(resource, opts));
|
|
644
|
+
}
|
|
645
|
+
async rename(from, to, opts) {
|
|
646
|
+
await this.writeToDelegates((delegate) => delegate.rename(from, to, opts));
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
class MkdirpOnWriteInMemoryFileSystemProvider extends InMemoryFileSystemProvider {
|
|
650
|
+
async writeFile(resource, content, opts) {
|
|
651
|
+
await mkdirp(extUri, this, extUri.dirname(resource));
|
|
652
|
+
return await super.writeFile(resource, content, opts);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
class DelegateFileSystemProvider {
|
|
656
|
+
constructor(options) {
|
|
657
|
+
this.options = options;
|
|
658
|
+
this.onDidChangeCapabilities = this.options.delegate.onDidChangeCapabilities;
|
|
659
|
+
this.onDidChangeFile = Event.map(this.options.delegate.onDidChangeFile, (changes) => changes.map((change) => ({
|
|
660
|
+
type: change.type,
|
|
661
|
+
resource: this.options.fromDeletate(change.resource)
|
|
662
|
+
})));
|
|
663
|
+
this.readFile = this.options.delegate.readFile != null
|
|
664
|
+
? (resource) => {
|
|
665
|
+
return this.options.delegate.readFile(this.options.toDelegate(resource));
|
|
666
|
+
}
|
|
667
|
+
: undefined;
|
|
668
|
+
this.writeFile = this.options.delegate.writeFile != null
|
|
669
|
+
? (resource, content, opts) => {
|
|
670
|
+
return this.options.delegate.writeFile(this.options.toDelegate(resource), content, opts);
|
|
671
|
+
}
|
|
672
|
+
: undefined;
|
|
673
|
+
}
|
|
674
|
+
get capabilities() {
|
|
675
|
+
return this.options.delegate.capabilities;
|
|
676
|
+
}
|
|
677
|
+
watch(resource, opts) {
|
|
678
|
+
return this.options.delegate.watch(this.options.toDelegate(resource), opts);
|
|
679
|
+
}
|
|
680
|
+
stat(resource) {
|
|
681
|
+
return this.options.delegate.stat(this.options.toDelegate(resource));
|
|
682
|
+
}
|
|
683
|
+
mkdir(resource) {
|
|
684
|
+
return this.options.delegate.mkdir(this.options.toDelegate(resource));
|
|
685
|
+
}
|
|
686
|
+
readdir(resource) {
|
|
687
|
+
return this.options.delegate.readdir(this.options.toDelegate(resource));
|
|
688
|
+
}
|
|
689
|
+
delete(resource, opts) {
|
|
690
|
+
return this.options.delegate.delete(this.options.toDelegate(resource), opts);
|
|
691
|
+
}
|
|
692
|
+
rename(from, to, opts) {
|
|
693
|
+
return this.options.delegate.rename(this.options.toDelegate(from), this.options.toDelegate(to), opts);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
class EmptyFileSystemProvider {
|
|
697
|
+
constructor() {
|
|
698
|
+
this.capabilities = FileSystemProviderCapabilities.FileReadWrite | FileSystemProviderCapabilities.PathCaseSensitive;
|
|
699
|
+
this.onDidChangeCapabilities = Event.None;
|
|
700
|
+
this.onDidChangeFile = Event.None;
|
|
701
|
+
}
|
|
702
|
+
async readFile() {
|
|
703
|
+
throw createFileSystemProviderError('Not found', FileSystemProviderErrorCode.FileNotFound);
|
|
704
|
+
}
|
|
705
|
+
async writeFile() {
|
|
706
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
707
|
+
}
|
|
708
|
+
watch() {
|
|
709
|
+
return Disposable.None;
|
|
710
|
+
}
|
|
711
|
+
async stat() {
|
|
712
|
+
throw createFileSystemProviderError('Not found', FileSystemProviderErrorCode.FileNotFound);
|
|
713
|
+
}
|
|
714
|
+
async mkdir() {
|
|
715
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
716
|
+
}
|
|
717
|
+
async readdir() {
|
|
718
|
+
throw createFileSystemProviderError('Not found', FileSystemProviderErrorCode.FileNotFound);
|
|
719
|
+
}
|
|
720
|
+
async delete() {
|
|
721
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
722
|
+
}
|
|
723
|
+
async rename() {
|
|
724
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
const overlayFileSystemProvider = new OverlayFileSystemProvider();
|
|
728
|
+
overlayFileSystemProvider.register(0, new MkdirpOnWriteInMemoryFileSystemProvider());
|
|
729
|
+
const extensionFileSystemProvider = new RegisteredFileSystemProvider(true);
|
|
730
|
+
const userDataFileSystemProvider = new InMemoryFileSystemProvider();
|
|
731
|
+
void userDataFileSystemProvider.mkdir(URI.from({ scheme: Schemas.vscodeUserData, path: '/User/' }));
|
|
732
|
+
var CustomSchemas;
|
|
733
|
+
(function (CustomSchemas) {
|
|
734
|
+
CustomSchemas.extensionFile = 'extension-file';
|
|
735
|
+
})(CustomSchemas || (CustomSchemas = {}));
|
|
736
|
+
const providers = {
|
|
737
|
+
[CustomSchemas.extensionFile]: extensionFileSystemProvider,
|
|
738
|
+
[logsPath.scheme]: new InMemoryFileSystemProvider(),
|
|
739
|
+
[Schemas.vscodeUserData]: userDataFileSystemProvider,
|
|
740
|
+
[Schemas.tmp]: new InMemoryFileSystemProvider(),
|
|
741
|
+
[Schemas.file]: overlayFileSystemProvider
|
|
742
|
+
};
|
|
743
|
+
let FileServiceOverride = class FileServiceOverride extends FileService {
|
|
744
|
+
constructor(logService, telemetryService) {
|
|
745
|
+
super(logService);
|
|
746
|
+
for (const [scheme, provider] of Object.entries(providers)) {
|
|
747
|
+
let disposable = this.registerProvider(scheme, provider);
|
|
748
|
+
if (provider instanceof OverlayFileSystemProvider) {
|
|
749
|
+
provider.onDidChangeOverlays(() => {
|
|
750
|
+
disposable.dispose();
|
|
751
|
+
disposable = this.registerProvider(scheme, provider);
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
if (provider instanceof IndexedDBFileSystemProvider) {
|
|
755
|
+
this._register(provider.onReportError((e) => telemetryService.publicLog2('indexedDBFileSystemProviderError', e)));
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
FileServiceOverride = __decorate([
|
|
761
|
+
__param(1, ITelemetryService)
|
|
762
|
+
], FileServiceOverride);
|
|
763
|
+
const fileLogger = new BufferLogger();
|
|
764
|
+
registerServiceInitializePreParticipant(async (accessor) => {
|
|
765
|
+
fileLogger.logger = accessor.get(ILogService);
|
|
766
|
+
});
|
|
767
|
+
function getServiceOverride() {
|
|
768
|
+
return {
|
|
769
|
+
[IFileService.toString()]: new SyncDescriptor(FileServiceOverride, [fileLogger], true),
|
|
770
|
+
[ITextFileService.toString()]: new SyncDescriptor(BrowserTextFileService, [], true),
|
|
771
|
+
[IFilesConfigurationService.toString()]: new SyncDescriptor(FilesConfigurationService, [], true),
|
|
772
|
+
[IElevatedFileService.toString()]: new SyncDescriptor(BrowserElevatedFileService, [], true)
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
function registerCustomProvider(scheme, provider) {
|
|
776
|
+
checkServicesNotInitialized();
|
|
777
|
+
providers[scheme] = provider;
|
|
778
|
+
}
|
|
779
|
+
function registerExtensionFile(file) {
|
|
780
|
+
return extensionFileSystemProvider.registerFile(file);
|
|
781
|
+
}
|
|
782
|
+
async function initFile(file, content, options) {
|
|
783
|
+
checkServicesNotInitialized();
|
|
784
|
+
const provider = providers[file.scheme];
|
|
785
|
+
if (provider == null || provider.writeFile == null) {
|
|
786
|
+
throw new Error(`${file.scheme} provider doesn't exist or doesn't support writing files`);
|
|
787
|
+
}
|
|
788
|
+
if (!(options?.overwrite ?? false)) {
|
|
789
|
+
try {
|
|
790
|
+
await provider.stat(file);
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
catch (error) {
|
|
794
|
+
if (!(error instanceof FileSystemProviderError) ||
|
|
795
|
+
error.code !== FileSystemProviderErrorCode.FileNotFound) {
|
|
796
|
+
console.error('Unable to check if file exists', error);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
await provider.writeFile(file, encode(content), {
|
|
801
|
+
atomic: false,
|
|
802
|
+
create: true,
|
|
803
|
+
overwrite: false,
|
|
804
|
+
unlock: false,
|
|
805
|
+
...options
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
let indexedDB;
|
|
809
|
+
const userDataStore = 'vscode-userdata-store';
|
|
810
|
+
const logsStore = 'vscode-logs-store';
|
|
811
|
+
const handlesStore = 'vscode-filehandles-store';
|
|
812
|
+
async function createIndexedDBProviders() {
|
|
813
|
+
indexedDB = await IndexedDB.create('vscode-web-db', 3, [userDataStore, logsStore, handlesStore]);
|
|
814
|
+
registerCustomProvider(logsPath.scheme, new IndexedDBFileSystemProvider(logsPath.scheme, indexedDB, logsStore, false));
|
|
815
|
+
const userDataProvider = new IndexedDBFileSystemProvider(Schemas.vscodeUserData, indexedDB, userDataStore, true);
|
|
816
|
+
registerCustomProvider(Schemas.vscodeUserData, userDataProvider);
|
|
817
|
+
return userDataProvider;
|
|
818
|
+
}
|
|
819
|
+
function registerHTMLFileSystemProvider() {
|
|
820
|
+
class LazyLogService {
|
|
821
|
+
get onDidChangeLogLevel() {
|
|
822
|
+
return StandaloneServices.get(ILogService).onDidChangeLogLevel;
|
|
823
|
+
}
|
|
824
|
+
getLevel() {
|
|
825
|
+
return StandaloneServices.get(ILogService).getLevel();
|
|
826
|
+
}
|
|
827
|
+
setLevel(level) {
|
|
828
|
+
StandaloneServices.get(ILogService).setLevel(level);
|
|
829
|
+
}
|
|
830
|
+
trace(message, ...args) {
|
|
831
|
+
StandaloneServices.get(ILogService).trace(message, ...args);
|
|
832
|
+
}
|
|
833
|
+
debug(message, ...args) {
|
|
834
|
+
StandaloneServices.get(ILogService).debug(message, ...args);
|
|
835
|
+
}
|
|
836
|
+
info(message, ...args) {
|
|
837
|
+
StandaloneServices.get(ILogService).info(message, ...args);
|
|
838
|
+
}
|
|
839
|
+
warn(message, ...args) {
|
|
840
|
+
StandaloneServices.get(ILogService).warn(message, ...args);
|
|
841
|
+
}
|
|
842
|
+
error(message, ...args) {
|
|
843
|
+
StandaloneServices.get(ILogService).error(message, ...args);
|
|
844
|
+
}
|
|
845
|
+
flush() {
|
|
846
|
+
StandaloneServices.get(ILogService).flush();
|
|
847
|
+
}
|
|
848
|
+
dispose() {
|
|
849
|
+
StandaloneServices.get(ILogService).dispose();
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
registerCustomProvider(Schemas.file, new HTMLFileSystemProvider(indexedDB, handlesStore, new LazyLogService()));
|
|
853
|
+
}
|
|
854
|
+
function registerFileSystemOverlay(priority, provider) {
|
|
855
|
+
const overlayProvider = providers.file;
|
|
856
|
+
if (!(overlayProvider instanceof OverlayFileSystemProvider)) {
|
|
857
|
+
throw new Error('The overlay filesystem provider was replaced');
|
|
858
|
+
}
|
|
859
|
+
return overlayProvider.register(priority, provider);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
export { CustomSchemas, DelegateFileSystemProvider, EmptyFileSystemProvider, IndexedDBFileSystemProvider, OverlayFileSystemProvider, RegisteredFile, RegisteredFileSystemProvider, RegisteredMemoryFile, RegisteredReadOnlyFile, RegisteredUriFile, createIndexedDBProviders, getServiceOverride as default, initFile, registerCustomProvider, registerExtensionFile, registerFileSystemOverlay, registerHTMLFileSystemProvider };
|