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