@hydranium/core 1.0.0-next.155 → 1.0.0-next.157
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/lib/documents/ast-document-manager.d.ts +3 -2
- package/lib/documents/ast-document-manager.d.ts.map +1 -1
- package/lib/documents/ast-document-manager.js.map +1 -1
- package/lib/documents/hydranium-text-documents.d.ts +3 -2
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
- package/lib/documents/hydranium-text-documents.js +3 -2
- package/lib/documents/hydranium-text-documents.js.map +1 -1
- package/lib/langium/module.d.ts +38 -12
- package/lib/langium/module.d.ts.map +1 -1
- package/lib/langium/module.js +15 -22
- package/lib/langium/module.js.map +1 -1
- package/lib/langium/workspace/document-uri-policy.d.ts +7 -5
- package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -1
- package/lib/langium/workspace/document-uri-policy.js +7 -5
- package/lib/langium/workspace/document-uri-policy.js.map +1 -1
- package/lib/langium/workspace/file-not-found.d.ts +17 -0
- package/lib/langium/workspace/file-not-found.d.ts.map +1 -0
- package/lib/langium/workspace/file-not-found.js +20 -0
- package/lib/langium/workspace/file-not-found.js.map +1 -0
- package/lib/langium/workspace/file-system-provider.d.ts +81 -13
- package/lib/langium/workspace/file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/file-system-provider.js +81 -35
- package/lib/langium/workspace/file-system-provider.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts +51 -2
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.js +82 -4
- package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts +2 -2
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.js +3 -23
- package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
- package/lib/langium/workspace/persistent-file-system-provider.d.ts +0 -7
- package/lib/langium/workspace/persistent-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/persistent-file-system-provider.js +0 -7
- package/lib/langium/workspace/persistent-file-system-provider.js.map +1 -1
- package/lib/langium/workspace/virtual-document.d.ts +44 -26
- package/lib/langium/workspace/virtual-document.d.ts.map +1 -1
- package/lib/langium/workspace/virtual-document.js +76 -33
- package/lib/langium/workspace/virtual-document.js.map +1 -1
- package/lib/node/node-file-system-provider.d.ts +10 -9
- package/lib/node/node-file-system-provider.d.ts.map +1 -1
- package/lib/node/node-file-system-provider.js +12 -47
- package/lib/node/node-file-system-provider.js.map +1 -1
- package/package.json +5 -5
- package/src/documents/ast-document-manager.ts +3 -2
- package/src/documents/hydranium-text-documents.ts +3 -2
- package/src/langium/module.ts +56 -34
- package/src/langium/workspace/document-uri-policy.ts +7 -5
- package/src/langium/workspace/file-not-found.ts +23 -0
- package/src/langium/workspace/file-system-provider.ts +136 -39
- package/src/langium/workspace/hydranium-workspace-manager.ts +98 -6
- package/src/langium/workspace/in-memory-file-system-provider.ts +3 -24
- package/src/langium/workspace/persistent-file-system-provider.ts +0 -7
- package/src/langium/workspace/virtual-document.ts +92 -33
- package/src/node/node-file-system-provider.ts +12 -48
|
@@ -88,11 +88,13 @@ export class DefaultDocumentUriPolicy {
|
|
|
88
88
|
* `loadUri` returns `undefined` for an absent path (honest about existence, so a
|
|
89
89
|
* caller about to read the filesystem skips it).
|
|
90
90
|
*
|
|
91
|
-
* If the
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* `
|
|
91
|
+
* If the provider for a URI's scheme has no `realpath` (in-memory / browser /
|
|
92
|
+
* empty), the framework's `FileSystemProviderRegistry` returns the URI
|
|
93
|
+
* unchanged and both methods answer as {@link DefaultDocumentUriPolicy} does. A
|
|
94
|
+
* slot bound to a provider without `realpath` degrades the same way: the
|
|
95
|
+
* `loadUri` ternary tests the *method's presence*, not its return, so
|
|
96
|
+
* `loadUri` returns `undefined` only when `realpath` is present and reports the
|
|
97
|
+
* path absent.
|
|
96
98
|
*/
|
|
97
99
|
export class RealpathDocumentUriPolicy extends DefaultDocumentUriPolicy {
|
|
98
100
|
fs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-uri-policy.js","sourceRoot":"","sources":["../../../src/langium/workspace/document-uri-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAqB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAY,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAexD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAiB,EAAE,EAA6B;IACpF,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,MAAM,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC;IAC7C,OAAO,IAAI,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1F,CAAC;AAoDD;;;;;GAKG;AACH,MAAM,OAAO,wBAAwB;IAClC,YAAY,CAAC,GAAiB;QAC3B,yEAAyE;QACzE,6EAA6E;QAC7E,OAAO,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,GAAiB;QACtB,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;CACH;AAED
|
|
1
|
+
{"version":3,"file":"document-uri-policy.js","sourceRoot":"","sources":["../../../src/langium/workspace/document-uri-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAqB,cAAc,EAAE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E;QACzE,uEAAuE;QACvE,OAAO,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACpF,CAAC;IAEQ,OAAO,CAAC,GAAiB;QAC/B,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;QACD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,kEAAkE;QAClE,yEAAyE;QACzE,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACrD,CAAC;CACH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { type URI } from '@hydranium/langium';
|
|
10
|
+
/**
|
|
11
|
+
* A missing-file error shaped as a Node file system raises it, with code
|
|
12
|
+
* `ENOENT` and the path: callers tell a missing file from any other failure by
|
|
13
|
+
* those two fields, whichever provider is bound. The last close relies on it to
|
|
14
|
+
* tell a document gone meanwhile from any other failed rebuild.
|
|
15
|
+
*/
|
|
16
|
+
export declare function notFound(message: string, uri: URI): Error;
|
|
17
|
+
//# sourceMappingURL=file-not-found.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-not-found.d.ts","sourceRoot":"","sources":["../../../src/langium/workspace/file-not-found.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAK9C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,KAAK,CAEzD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
// Not re-exported from the workspace barrel: the framework's providers share
|
|
10
|
+
// it, and it is no API of theirs.
|
|
11
|
+
/**
|
|
12
|
+
* A missing-file error shaped as a Node file system raises it, with code
|
|
13
|
+
* `ENOENT` and the path: callers tell a missing file from any other failure by
|
|
14
|
+
* those two fields, whichever provider is bound. The last close relies on it to
|
|
15
|
+
* tell a document gone meanwhile from any other failed rebuild.
|
|
16
|
+
*/
|
|
17
|
+
export function notFound(message, uri) {
|
|
18
|
+
return Object.assign(new Error(message), { code: 'ENOENT', path: uri.fsPath });
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=file-not-found.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-not-found.js","sourceRoot":"","sources":["../../../src/langium/workspace/file-not-found.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,6EAA6E;AAC7E,kCAAkC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,GAAQ;IAC/C,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -13,26 +13,94 @@ import { type WritableFileSystemProvider } from '../../documents/ast-document-ma
|
|
|
13
13
|
import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
14
14
|
import { type ServerSharedServicesMinimal } from '../shared-services.js';
|
|
15
15
|
/**
|
|
16
|
-
* Empty-filesystem
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* Node-backed
|
|
20
|
-
* lives in `@hydranium/core/node` (it pulls
|
|
16
|
+
* Empty-filesystem {@link WritableFileSystemProvider}. For browser / test / CLI
|
|
17
|
+
* hosts that don't have a real filesystem. All writes are no-ops. On the
|
|
18
|
+
* portable `.` entry it is the {@link FileSystemProviderRegistry.host} when
|
|
19
|
+
* `context.fileSystemProvider` gives no writable provider; the Node-backed
|
|
20
|
+
* `DefaultFileSystemProvider` lives in `@hydranium/core/node` (it pulls
|
|
21
|
+
* `node:fs`).
|
|
21
22
|
*/
|
|
22
23
|
export declare class DefaultEmptyFileSystemProvider extends EmptyFileSystemProvider implements WritableFileSystemProvider {
|
|
23
24
|
protected readonly services: ServerSharedServicesMinimal;
|
|
24
25
|
protected readonly tracer: Tracer;
|
|
25
26
|
constructor(services: ServerSharedServicesMinimal, options?: LogNameOptions);
|
|
26
27
|
writeFile(_uri: URI, _content: string): Promise<void>;
|
|
27
|
-
readFile(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
readFile(_uri?: URI): Promise<string>;
|
|
29
|
+
readBinary(_uri?: URI): Promise<Uint8Array>;
|
|
30
|
+
stat(uri: URI): Promise<FileSystemNode>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The provider bound on `workspace.FileSystemProvider`: it dispatches each call
|
|
34
|
+
* by the URI's scheme to the provider registered for it in the shared
|
|
35
|
+
* `fileSystemProviders` group, and to the {@link host} for any scheme without
|
|
36
|
+
* one.
|
|
37
|
+
*
|
|
38
|
+
* So one provider answers for each scheme, and a host's provider needs to know
|
|
39
|
+
* only its own: the framework registers `virtual:` there, and an adopter adds a
|
|
40
|
+
* scheme by contributing to the group. The host takes every unclaimed scheme
|
|
41
|
+
* rather than `file:` alone, which keeps an in-memory workspace under `memory:`
|
|
42
|
+
* or any other scheme on the host's provider.
|
|
43
|
+
*
|
|
44
|
+
* `THost` types the host, so an adopter whose own provider has more members
|
|
45
|
+
* than the base declares the slot as `FileSystemProviderRegistry<MyProvider>`,
|
|
46
|
+
* binds a {@link DefaultFileSystemProviderRegistry} with that host, and reads
|
|
47
|
+
* those members through `services.workspace.FileSystemProvider.host`.
|
|
48
|
+
*/
|
|
49
|
+
export interface FileSystemProviderRegistry<THost extends WritableFileSystemProvider = WritableFileSystemProvider> extends WritableFileSystemProvider {
|
|
50
|
+
/** The provider for every scheme no entry of `fileSystemProviders` claims. */
|
|
51
|
+
readonly host: THost;
|
|
52
|
+
/** The provider that answers for `uri`. */
|
|
53
|
+
providerFor(uri: URI): WritableFileSystemProvider;
|
|
54
|
+
}
|
|
55
|
+
/** Options for {@link DefaultFileSystemProviderRegistry}. */
|
|
56
|
+
export interface FileSystemProviderRegistryOptions<THost extends WritableFileSystemProvider = WritableFileSystemProvider> extends LogNameOptions {
|
|
57
|
+
/**
|
|
58
|
+
* The provider for every scheme no entry of `fileSystemProviders` claims.
|
|
59
|
+
* The framework passes the provider `context.fileSystemProvider` returns,
|
|
60
|
+
* or a {@link DefaultEmptyFileSystemProvider} when that is not writable.
|
|
61
|
+
*/
|
|
62
|
+
host: THost;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The framework's {@link FileSystemProviderRegistry}.
|
|
66
|
+
*
|
|
67
|
+
* A directory is listed by the provider of its own scheme, so a workspace
|
|
68
|
+
* root's tree comes from that provider alone.
|
|
69
|
+
*
|
|
70
|
+
* `realpath` and `mtimeMs` are always present and forward to the scheme's
|
|
71
|
+
* provider. Where that provider lacks one, `realpath` returns the URI unchanged
|
|
72
|
+
* and `mtimeMs` returns `undefined`: the answers `RealpathDocumentUriPolicy`
|
|
73
|
+
* and the self-save filter already give a provider without them.
|
|
74
|
+
*/
|
|
75
|
+
export declare class DefaultFileSystemProviderRegistry<THost extends WritableFileSystemProvider = WritableFileSystemProvider> implements FileSystemProviderRegistry<THost> {
|
|
76
|
+
protected readonly services: ServerSharedServicesMinimal & {
|
|
77
|
+
fileSystemProviders: Record<string, WritableFileSystemProvider>;
|
|
78
|
+
};
|
|
79
|
+
readonly host: THost;
|
|
80
|
+
protected readonly tracer: Tracer;
|
|
81
|
+
constructor(services: ServerSharedServicesMinimal & {
|
|
82
|
+
fileSystemProviders: Record<string, WritableFileSystemProvider>;
|
|
83
|
+
}, options: FileSystemProviderRegistryOptions<THost>);
|
|
84
|
+
/**
|
|
85
|
+
* The group is read per call, not in the constructor, so a registered
|
|
86
|
+
* provider is built on first use and may read slots that reach back to this
|
|
87
|
+
* one. Only an OWN key of the group counts: the DI container resolves any
|
|
88
|
+
* key found on the prototype chain, so a scheme such as `constructor` would
|
|
89
|
+
* otherwise dispatch to a function.
|
|
90
|
+
*/
|
|
91
|
+
providerFor(uri: URI): WritableFileSystemProvider;
|
|
92
|
+
writeFile(uri: URI, content: string): Promise<void>;
|
|
93
|
+
mtimeMs(uri: URI): Promise<number | undefined>;
|
|
94
|
+
realpath(uri: URI): URI | undefined;
|
|
31
95
|
stat(uri: URI): Promise<FileSystemNode>;
|
|
32
96
|
statSync(uri: URI): FileSystemNode;
|
|
33
|
-
exists(uri
|
|
34
|
-
existsSync(uri
|
|
35
|
-
|
|
36
|
-
|
|
97
|
+
exists(uri: URI): Promise<boolean>;
|
|
98
|
+
existsSync(uri: URI): boolean;
|
|
99
|
+
readBinary(uri: URI): Promise<Uint8Array>;
|
|
100
|
+
readBinarySync(uri: URI): Uint8Array;
|
|
101
|
+
readFile(uri: URI): Promise<string>;
|
|
102
|
+
readFileSync(uri: URI): string;
|
|
103
|
+
readDirectory(uri: URI): Promise<FileSystemNode[]>;
|
|
104
|
+
readDirectorySync(uri: URI): FileSystemNode[];
|
|
37
105
|
}
|
|
38
106
|
//# sourceMappingURL=file-system-provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-system-provider.d.ts","sourceRoot":"","sources":["../../../src/langium/workspace/file-system-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"file-system-provider.d.ts","sourceRoot":"","sources":["../../../src/langium/workspace/file-system-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEzE;;;;;;;GAOG;AACH,qBAAa,8BAA+B,SAAQ,uBAAwB,YAAW,0BAA0B;IAI3G,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,2BAA2B;IAH3D,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAGZ,QAAQ,EAAE,2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E,iCAAiC,CAAC,KAAK,CAAC;IAMpD;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,0BAA0B;IAO3C,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIpD,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS;IAK7B,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC;IAI7C,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc;IAI5B,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxC,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO;IAIvB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC;IAI/C,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU;IAI9B,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzC,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM;IAIxB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAIxD,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,EAAE;CAG/C"}
|
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
import { EmptyFileSystemProvider } from '@hydranium/langium';
|
|
10
|
-
import { serveVirtualDocument, serveVirtualNode } from './virtual-document.js';
|
|
11
10
|
/**
|
|
12
|
-
* Empty-filesystem
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* Node-backed
|
|
16
|
-
* lives in `@hydranium/core/node` (it pulls
|
|
11
|
+
* Empty-filesystem {@link WritableFileSystemProvider}. For browser / test / CLI
|
|
12
|
+
* hosts that don't have a real filesystem. All writes are no-ops. On the
|
|
13
|
+
* portable `.` entry it is the {@link FileSystemProviderRegistry.host} when
|
|
14
|
+
* `context.fileSystemProvider` gives no writable provider; the Node-backed
|
|
15
|
+
* `DefaultFileSystemProvider` lives in `@hydranium/core/node` (it pulls
|
|
16
|
+
* `node:fs`).
|
|
17
17
|
*/
|
|
18
18
|
export class DefaultEmptyFileSystemProvider extends EmptyFileSystemProvider {
|
|
19
19
|
services;
|
|
@@ -26,49 +26,95 @@ export class DefaultEmptyFileSystemProvider extends EmptyFileSystemProvider {
|
|
|
26
26
|
async writeFile(_uri, _content) {
|
|
27
27
|
// no-op
|
|
28
28
|
}
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
// answers "absent"). The base declares these param-less, so the param is
|
|
32
|
-
// optional here.
|
|
33
|
-
//
|
|
34
|
-
// The async reads are `async` so the base's refusal becomes a rejection: it
|
|
35
|
-
// throws SYNCHRONOUSLY from a method declared to return a promise, and a
|
|
29
|
+
// `async` so the base's refusal becomes a rejection: it throws
|
|
30
|
+
// SYNCHRONOUSLY from a method declared to return a promise, and a
|
|
36
31
|
// synchronous throw escapes the promise chain — `.catch()` never attaches
|
|
37
32
|
// and `Promise.all` dies while its argument array is still being built, so
|
|
38
|
-
// a caller reading several URIs cannot handle the miss it asked about.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
// a caller reading several URIs cannot handle the miss it asked about. The
|
|
34
|
+
// base declares `readFile` and `readBinary` param-less, so the param is
|
|
35
|
+
// optional there.
|
|
36
|
+
async readFile(_uri) {
|
|
37
|
+
return super.readFile();
|
|
42
38
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return served !== undefined ? served : super.readFileSync();
|
|
39
|
+
async readBinary(_uri) {
|
|
40
|
+
return super.readBinary();
|
|
46
41
|
}
|
|
47
|
-
async
|
|
48
|
-
|
|
49
|
-
return served !== undefined ? new TextEncoder().encode(served) : super.readBinary();
|
|
42
|
+
async stat(uri) {
|
|
43
|
+
return super.stat(uri);
|
|
50
44
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The framework's {@link FileSystemProviderRegistry}.
|
|
48
|
+
*
|
|
49
|
+
* A directory is listed by the provider of its own scheme, so a workspace
|
|
50
|
+
* root's tree comes from that provider alone.
|
|
51
|
+
*
|
|
52
|
+
* `realpath` and `mtimeMs` are always present and forward to the scheme's
|
|
53
|
+
* provider. Where that provider lacks one, `realpath` returns the URI unchanged
|
|
54
|
+
* and `mtimeMs` returns `undefined`: the answers `RealpathDocumentUriPolicy`
|
|
55
|
+
* and the self-save filter already give a provider without them.
|
|
56
|
+
*/
|
|
57
|
+
export class DefaultFileSystemProviderRegistry {
|
|
58
|
+
services;
|
|
59
|
+
host;
|
|
60
|
+
tracer;
|
|
61
|
+
constructor(services, options) {
|
|
62
|
+
this.services = services;
|
|
63
|
+
this.host = options.host;
|
|
64
|
+
this.tracer = services.Tracer.for(options.logName ?? this.constructor.name).trace('instantiated');
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The group is read per call, not in the constructor, so a registered
|
|
68
|
+
* provider is built on first use and may read slots that reach back to this
|
|
69
|
+
* one. Only an OWN key of the group counts: the DI container resolves any
|
|
70
|
+
* key found on the prototype chain, so a scheme such as `constructor` would
|
|
71
|
+
* otherwise dispatch to a function.
|
|
72
|
+
*/
|
|
73
|
+
providerFor(uri) {
|
|
74
|
+
const providers = this.services.fileSystemProviders;
|
|
75
|
+
return Object.hasOwn(providers, uri.scheme) ? providers[uri.scheme] : this.host;
|
|
76
|
+
}
|
|
77
|
+
// The async methods are `async` so a provider that throws synchronously from
|
|
78
|
+
// one still rejects, for the reason `DefaultEmptyFileSystemProvider` gives.
|
|
79
|
+
async writeFile(uri, content) {
|
|
80
|
+
return this.providerFor(uri).writeFile(uri, content);
|
|
81
|
+
}
|
|
82
|
+
async mtimeMs(uri) {
|
|
83
|
+
return this.providerFor(uri).mtimeMs?.(uri);
|
|
84
|
+
}
|
|
85
|
+
realpath(uri) {
|
|
86
|
+
const provider = this.providerFor(uri);
|
|
87
|
+
return provider.realpath ? provider.realpath(uri) : uri;
|
|
54
88
|
}
|
|
55
|
-
// The base declares these two WITH a URI parameter, so they stay required.
|
|
56
89
|
async stat(uri) {
|
|
57
|
-
|
|
58
|
-
return served !== undefined ? served : super.stat(uri);
|
|
90
|
+
return this.providerFor(uri).stat(uri);
|
|
59
91
|
}
|
|
60
92
|
statSync(uri) {
|
|
61
|
-
return
|
|
93
|
+
return this.providerFor(uri).statSync(uri);
|
|
62
94
|
}
|
|
63
95
|
async exists(uri) {
|
|
64
|
-
return this.
|
|
96
|
+
return this.providerFor(uri).exists(uri);
|
|
65
97
|
}
|
|
66
98
|
existsSync(uri) {
|
|
67
|
-
return this.
|
|
99
|
+
return this.providerFor(uri).existsSync(uri);
|
|
100
|
+
}
|
|
101
|
+
async readBinary(uri) {
|
|
102
|
+
return this.providerFor(uri).readBinary(uri);
|
|
103
|
+
}
|
|
104
|
+
readBinarySync(uri) {
|
|
105
|
+
return this.providerFor(uri).readBinarySync(uri);
|
|
106
|
+
}
|
|
107
|
+
async readFile(uri) {
|
|
108
|
+
return this.providerFor(uri).readFile(uri);
|
|
109
|
+
}
|
|
110
|
+
readFileSync(uri) {
|
|
111
|
+
return this.providerFor(uri).readFileSync(uri);
|
|
112
|
+
}
|
|
113
|
+
async readDirectory(uri) {
|
|
114
|
+
return this.providerFor(uri).readDirectory(uri);
|
|
68
115
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return uri !== undefined ? serveVirtualDocument(this.services, uri) : undefined;
|
|
116
|
+
readDirectorySync(uri) {
|
|
117
|
+
return this.providerFor(uri).readDirectorySync(uri);
|
|
72
118
|
}
|
|
73
119
|
}
|
|
74
120
|
//# sourceMappingURL=file-system-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-system-provider.js","sourceRoot":"","sources":["../../../src/langium/workspace/file-system-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"file-system-provider.js","sourceRoot":"","sources":["../../../src/langium/workspace/file-system-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAM7D;;;;;;;GAOG;AACH,MAAM,OAAO,8BAA+B,SAAQ,uBAAuB;IAIlD;IAHH,MAAM,CAAS;IAElC,YACsB,QAAqC,EACxD,UAA0B,EAAE;QAE5B,KAAK,EAAE,CAAC;QAHW,aAAQ,GAAR,QAAQ,CAA6B;QAIxD,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACrG,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,IAAS,EAAE,QAAgB;QACxC,QAAQ;IACX,CAAC;IAED,+DAA+D;IAC/D,kEAAkE;IAClE,0EAA0E;IAC1E,2EAA2E;IAC3E,2EAA2E;IAC3E,wEAAwE;IACxE,kBAAkB;IACT,KAAK,CAAC,QAAQ,CAAC,IAAU;QAC/B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAEQ,KAAK,CAAC,UAAU,CAAC,IAAU;QACjC,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;IAC7B,CAAC;IAEQ,KAAK,CAAC,IAAI,CAAC,GAAQ;QACzB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;CACH;AAwCD;;;;;;;;;;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AAC,CAAC;IACvD,CAAC;CACH"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
import { Deferred, type Logger, type Tracer } from '@hydranium/protocol';
|
|
10
|
-
import { DefaultWorkspaceManager, type LangiumDocument, type URI } from '@hydranium/langium';
|
|
10
|
+
import { DefaultWorkspaceManager, type LangiumDocument, type Stream, type URI } from '@hydranium/langium';
|
|
11
11
|
import { type CancellationToken, type InitializeParams } from 'vscode-languageserver';
|
|
12
12
|
import type { WorkspaceFolder } from 'vscode-languageserver-types';
|
|
13
13
|
import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
@@ -54,6 +54,17 @@ export declare function handleProcessUnhandledRejection(reason: unknown, logger:
|
|
|
54
54
|
* Applies to every Langium-based server that experiences concurrent builds.
|
|
55
55
|
*/
|
|
56
56
|
export declare function installOperationCancelledSuppression(logger: Logger): void;
|
|
57
|
+
/** Options for {@link HydraniumWorkspaceManager}. */
|
|
58
|
+
export interface HydraniumWorkspaceManagerOptions extends LogNameOptions {
|
|
59
|
+
/**
|
|
60
|
+
* Whether startup warns about seeded documents the bound
|
|
61
|
+
* `FileSystemProvider` cannot serve (see
|
|
62
|
+
* {@link HydraniumWorkspaceManager.warnIfDocumentsUnserved}). Defaults to
|
|
63
|
+
* `true`; turn it off for a host that drops such documents at their last
|
|
64
|
+
* close on purpose.
|
|
65
|
+
*/
|
|
66
|
+
warnUnservedDocuments?: boolean;
|
|
67
|
+
}
|
|
57
68
|
/**
|
|
58
69
|
* Framework {@link DefaultWorkspaceManager} subclass that integrates the
|
|
59
70
|
* project tier with Langium's workspace startup.
|
|
@@ -121,7 +132,11 @@ export declare class HydraniumWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
121
132
|
protected readonly additionalDocuments: Record<string, AdditionalDocumentContribution>;
|
|
122
133
|
/** Registry consulted by {@link warnIfUnroutable} to check a seeded document routes. */
|
|
123
134
|
protected readonly languageRegistry: ServerSharedServicesMinimal['ServiceRegistry'];
|
|
124
|
-
|
|
135
|
+
/** Whether startup runs {@link warnIfDocumentsUnserved}. */
|
|
136
|
+
protected readonly warnUnservedDocuments: boolean;
|
|
137
|
+
/** URIs of the documents the running startup's file traversal loaded; see {@link loadWorkspaceDocuments}. */
|
|
138
|
+
protected readonly traversedUris: Set<string>;
|
|
139
|
+
constructor(services: ServerSharedServicesMinimal, options?: HydraniumWorkspaceManagerOptions);
|
|
125
140
|
/**
|
|
126
141
|
* Contribution form of Langium's `loadAdditionalDocuments`. Runs the base
|
|
127
142
|
* behaviour first (a no-op unless a further subclass adds documents), then
|
|
@@ -153,6 +168,40 @@ export declare class HydraniumWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
153
168
|
*/
|
|
154
169
|
protected warnIfUnroutable(document: LangiumDocument): void;
|
|
155
170
|
protected performStartup(folders: WorkspaceFolder[]): Promise<LangiumDocument[]>;
|
|
171
|
+
/**
|
|
172
|
+
* Record each document the file traversal loads, so startup can tell them
|
|
173
|
+
* from the documents `loadAdditionalDocuments` seeded, through the
|
|
174
|
+
* `additionalDocuments` group or an override of its own.
|
|
175
|
+
*
|
|
176
|
+
* The traversal found each of its documents through the provider, so asking
|
|
177
|
+
* it again whether they exist costs one call per workspace file and cannot
|
|
178
|
+
* come out false. Telling them apart by scheme does not work either: the
|
|
179
|
+
* registry's host answers every scheme no other provider claims, a seeded
|
|
180
|
+
* scheme nobody serves included. An override that loads documents without
|
|
181
|
+
* delegating here leaves them unrecorded, so startup asks the provider
|
|
182
|
+
* about each of them.
|
|
183
|
+
*/
|
|
184
|
+
protected loadWorkspaceDocuments(uris: Stream<URI>, collector: (document: LangiumDocument) => void): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Warn once when the bound `FileSystemProvider` cannot serve a seeded
|
|
187
|
+
* document, naming each such document's scheme.
|
|
188
|
+
*
|
|
189
|
+
* The last close keeps a document only if the provider says it `exists`, so
|
|
190
|
+
* each such document leaves the workspace the first time an editor closes
|
|
191
|
+
* it, and whatever resolved against it breaks. The framework's registry
|
|
192
|
+
* serves `virtual:` through the `fileSystemProviders` group and every other
|
|
193
|
+
* scheme through its host, which knows nothing of a scheme an adopter
|
|
194
|
+
* invented for its seeded documents, and nothing else reports the loss. A
|
|
195
|
+
* provider that throws counts as not serving the document, since a startup
|
|
196
|
+
* that failed on a diagnostic would be worse than the loss.
|
|
197
|
+
*
|
|
198
|
+
* Runs over every document startup collected outside the file traversal,
|
|
199
|
+
* which is what `loadAdditionalDocuments` seeded, through the
|
|
200
|
+
* `additionalDocuments` group or an override of that method, once startup
|
|
201
|
+
* has added them to the workspace, unless `warnUnservedDocuments` is
|
|
202
|
+
* `false`.
|
|
203
|
+
*/
|
|
204
|
+
protected warnIfDocumentsUnserved(documents: readonly LangiumDocument[]): Promise<void>;
|
|
156
205
|
/**
|
|
157
206
|
* Add back the documents project discovery created that Langium's file
|
|
158
207
|
* traversal then filtered out.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-workspace-manager.d.ts","sourceRoot":"","sources":["../../../src/langium/workspace/hydranium-workspace-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAiB,KAAK,eAAe,EAAY,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"hydranium-workspace-manager.d.ts","sourceRoot":"","sources":["../../../src/langium/workspace/hydranium-workspace-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAiB,KAAK,eAAe,EAAE,KAAK,MAAM,EAAY,KAAK,GAAG,EAAE,MAA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,OAAO,CAAC,IAAI,CAAC;IA2B7F;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,SAAS,CAAC,yBAAyB,CAAC,SAAS,EAAE,eAAe,EAAE,EAAE,UAAU,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE;IAa5H;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI;IAqB/D;;;;;;OAMG;IACH,SAAS,CAAC,yBAAyB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI;IAOrE;;;;;;;;;;;;;;;OAeG;IACM,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI;IASnD;;;;;;;OAOG;IACY,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,WAAW,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAU9G;;;;;;;;;OASG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI;IAS5D;;;;;;;OAOG;IACH,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;CAI/D"}
|
|
@@ -147,6 +147,10 @@ export class HydraniumWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
147
147
|
additionalDocuments;
|
|
148
148
|
/** Registry consulted by {@link warnIfUnroutable} to check a seeded document routes. */
|
|
149
149
|
languageRegistry;
|
|
150
|
+
/** Whether startup runs {@link warnIfDocumentsUnserved}. */
|
|
151
|
+
warnUnservedDocuments;
|
|
152
|
+
/** URIs of the documents the running startup's file traversal loaded; see {@link loadWorkspaceDocuments}. */
|
|
153
|
+
traversedUris = new Set();
|
|
150
154
|
constructor(services, options = {}) {
|
|
151
155
|
super(services);
|
|
152
156
|
this.projectManager = services.workspace.ProjectManager;
|
|
@@ -156,6 +160,7 @@ export class HydraniumWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
156
160
|
this.writableFileSystemProvider = services.workspace.FileSystemProvider;
|
|
157
161
|
this.additionalDocuments = services.additionalDocuments;
|
|
158
162
|
this.languageRegistry = services.ServiceRegistry;
|
|
163
|
+
this.warnUnservedDocuments = options.warnUnservedDocuments ?? true;
|
|
159
164
|
this.tracer = services.Tracer.for(options.logName ?? 'WorkspaceManager').trace('instantiated');
|
|
160
165
|
installOperationCancelledSuppression(this.tracer);
|
|
161
166
|
}
|
|
@@ -180,14 +185,14 @@ export class HydraniumWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
180
185
|
// seeded. `tags` is read at the done-emit, so the document count pushed
|
|
181
186
|
// inside the callback appears in the log line.
|
|
182
187
|
const tags = [`${contributions.length} contributions`];
|
|
183
|
-
|
|
188
|
+
const seeded = [];
|
|
184
189
|
await this.tracer.time('Load additional documents', async () => {
|
|
185
190
|
await collectAdditionalDocuments(this.additionalDocuments, folders, document => {
|
|
186
|
-
|
|
191
|
+
seeded.push(document);
|
|
187
192
|
this.warnIfUnroutable(document);
|
|
188
193
|
collector(document);
|
|
189
194
|
});
|
|
190
|
-
tags.push(`${
|
|
195
|
+
tags.push(`${seeded.length} documents`);
|
|
191
196
|
}, 'info', { logAfterMs: 0, tags });
|
|
192
197
|
}
|
|
193
198
|
/**
|
|
@@ -242,10 +247,83 @@ export class HydraniumWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
242
247
|
discovered.push(document);
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
|
-
|
|
250
|
+
this.traversedUris.clear();
|
|
251
|
+
let documents;
|
|
252
|
+
try {
|
|
253
|
+
documents = await super.performStartup(folders);
|
|
254
|
+
if (this.warnUnservedDocuments) {
|
|
255
|
+
await this.warnIfDocumentsUnserved(documents.filter(document => !this.traversedUris.has(document.uri.toString())));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
finally {
|
|
259
|
+
this.traversedUris.clear();
|
|
260
|
+
}
|
|
246
261
|
this.probePathDivergence(folders);
|
|
247
262
|
return this.withDiscoveredDescriptors(documents, discovered);
|
|
248
263
|
}
|
|
264
|
+
/**
|
|
265
|
+
* Record each document the file traversal loads, so startup can tell them
|
|
266
|
+
* from the documents `loadAdditionalDocuments` seeded, through the
|
|
267
|
+
* `additionalDocuments` group or an override of its own.
|
|
268
|
+
*
|
|
269
|
+
* The traversal found each of its documents through the provider, so asking
|
|
270
|
+
* it again whether they exist costs one call per workspace file and cannot
|
|
271
|
+
* come out false. Telling them apart by scheme does not work either: the
|
|
272
|
+
* registry's host answers every scheme no other provider claims, a seeded
|
|
273
|
+
* scheme nobody serves included. An override that loads documents without
|
|
274
|
+
* delegating here leaves them unrecorded, so startup asks the provider
|
|
275
|
+
* about each of them.
|
|
276
|
+
*/
|
|
277
|
+
async loadWorkspaceDocuments(uris, collector) {
|
|
278
|
+
await super.loadWorkspaceDocuments(uris, document => {
|
|
279
|
+
this.traversedUris.add(document.uri.toString());
|
|
280
|
+
collector(document);
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Warn once when the bound `FileSystemProvider` cannot serve a seeded
|
|
285
|
+
* document, naming each such document's scheme.
|
|
286
|
+
*
|
|
287
|
+
* The last close keeps a document only if the provider says it `exists`, so
|
|
288
|
+
* each such document leaves the workspace the first time an editor closes
|
|
289
|
+
* it, and whatever resolved against it breaks. The framework's registry
|
|
290
|
+
* serves `virtual:` through the `fileSystemProviders` group and every other
|
|
291
|
+
* scheme through its host, which knows nothing of a scheme an adopter
|
|
292
|
+
* invented for its seeded documents, and nothing else reports the loss. A
|
|
293
|
+
* provider that throws counts as not serving the document, since a startup
|
|
294
|
+
* that failed on a diagnostic would be worse than the loss.
|
|
295
|
+
*
|
|
296
|
+
* Runs over every document startup collected outside the file traversal,
|
|
297
|
+
* which is what `loadAdditionalDocuments` seeded, through the
|
|
298
|
+
* `additionalDocuments` group or an override of that method, once startup
|
|
299
|
+
* has added them to the workspace, unless `warnUnservedDocuments` is
|
|
300
|
+
* `false`.
|
|
301
|
+
*/
|
|
302
|
+
async warnIfDocumentsUnserved(documents) {
|
|
303
|
+
const unserved = [];
|
|
304
|
+
for (const document of documents) {
|
|
305
|
+
let served = false;
|
|
306
|
+
try {
|
|
307
|
+
served = await this.writableFileSystemProvider.exists(document.uri);
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
// Counted as unserved, below.
|
|
311
|
+
}
|
|
312
|
+
if (!served) {
|
|
313
|
+
unserved.push(document.uri);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (unserved.length === 0) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const schemes = [...new Set(unserved.map(uri => uri.scheme))];
|
|
320
|
+
const named = unserved.slice(0, 3).map(uri => uri.toString());
|
|
321
|
+
this.tracer.warn(`${unserved.length} seeded document(s) under ${schemes.map(scheme => `${scheme}:`).join(', ')} cannot be served by the bound workspace.FileSystemProvider ` +
|
|
322
|
+
`(${named.join(', ')}${unserved.length > 3 ? ', …' : ''}), so each leaves the workspace at its ` +
|
|
323
|
+
`last close. Register a provider under the key ${schemes.map(scheme => `'${scheme}'`).join(', ')} in the shared ` +
|
|
324
|
+
'fileSystemProviders group, or serve the scheme from the host provider; set warnUnservedDocuments: false ' +
|
|
325
|
+
'to accept the loss.');
|
|
326
|
+
}
|
|
249
327
|
/**
|
|
250
328
|
* Add back the documents project discovery created that Langium's file
|
|
251
329
|
* traversal then filtered out.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-workspace-manager.js","sourceRoot":"","sources":["../../../src/langium/workspace/hydranium-workspace-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,QAAQ,EAA4B,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"hydranium-workspace-manager.js","sourceRoot":"","sources":["../../../src/langium/workspace/hydranium-workspace-manager.ts"],"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