@hydranium/core 1.0.0-next.32 → 1.0.0-next.34
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/langium/keys/containment.d.ts +64 -0
- package/lib/langium/keys/containment.d.ts.map +1 -0
- package/lib/langium/keys/containment.js +53 -0
- package/lib/langium/keys/containment.js.map +1 -0
- package/lib/langium/keys/index.d.ts +1 -0
- package/lib/langium/keys/index.d.ts.map +1 -1
- package/lib/langium/keys/index.js +1 -0
- package/lib/langium/keys/index.js.map +1 -1
- package/lib/langium/keys/name-based-key-provider.d.ts +4 -0
- package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -1
- package/lib/langium/keys/name-based-key-provider.js +4 -0
- package/lib/langium/keys/name-based-key-provider.js.map +1 -1
- package/lib/langium/model-service/model-service.d.ts +13 -2
- package/lib/langium/model-service/model-service.d.ts.map +1 -1
- package/lib/langium/model-service/model-service.js +13 -2
- package/lib/langium/model-service/model-service.js.map +1 -1
- package/lib/langium/validation/document-validator.d.ts +62 -1
- package/lib/langium/validation/document-validator.d.ts.map +1 -1
- package/lib/langium/validation/document-validator.js +110 -3
- package/lib/langium/validation/document-validator.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts +10 -0
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.js +13 -0
- package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -1
- package/lib/locale/server-locale.d.ts +10 -0
- package/lib/locale/server-locale.d.ts.map +1 -1
- package/lib/locale/server-locale.js +11 -1
- package/lib/locale/server-locale.js.map +1 -1
- package/lib/messages/carriers.d.ts +8 -1
- package/lib/messages/carriers.d.ts.map +1 -1
- package/lib/messages/carriers.js +11 -1
- package/lib/messages/carriers.js.map +1 -1
- package/lib/messages/index.d.ts +1 -1
- package/lib/messages/index.d.ts.map +1 -1
- package/lib/messages/index.js +1 -1
- package/lib/messages/index.js.map +1 -1
- package/package.json +5 -5
- package/src/langium/keys/containment.ts +87 -0
- package/src/langium/keys/index.ts +1 -0
- package/src/langium/keys/name-based-key-provider.ts +4 -0
- package/src/langium/model-service/model-service.ts +13 -2
- package/src/langium/validation/document-validator.ts +121 -3
- package/src/langium/workspace/hydranium-workspace-manager.ts +12 -0
- package/src/locale/server-locale.ts +11 -1
- package/src/messages/carriers.ts +12 -2
- package/src/messages/index.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-validator.js","sourceRoot":"","sources":["../../../src/langium/validation/document-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,aAAa,EACb,aAAa,EACb,WAAW,EAGX,eAAe,EAEf,kBAAkB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIJ,wBAAwB,
|
|
1
|
+
{"version":3,"file":"document-validator.js","sourceRoot":"","sources":["../../../src/langium/validation/document-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,aAAa,EACb,aAAa,EACb,WAAW,EAGX,eAAe,EAEf,kBAAkB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIJ,wBAAwB,EAExB,iBAAiB,EAMnB,MAAM,oBAAoB,CAAC;AAE5B,kEAAkE;AAClE,0EAA0E;AAC1E,yDAAyD;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAyBhE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAC9C,qCAAqC,EACrC,mEAAmE,CACrE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CACtC,6BAA6B,EAC7B,0FAA0F,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AC;IAChF,CAAC;CACH"}
|
|
@@ -207,6 +207,16 @@ export declare class HydraniumWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
207
207
|
* params. `DefaultWorkspaceManager.initialize` reads `workspaceFolders`
|
|
208
208
|
* alone, so `params.locale` would otherwise be discarded — and this is the
|
|
209
209
|
* only place it arrives, which the headless init seams route through too.
|
|
210
|
+
*
|
|
211
|
+
* **The ABSENT case is reported from here rather than from `ServerLocale`,
|
|
212
|
+
* because this is the only end that can see it.** `accept` is not called
|
|
213
|
+
* when no locale was declared — nor should it be, since `''` is a claim
|
|
214
|
+
* about a language rather than the absence of one — so a log written there
|
|
215
|
+
* covers one of the two outcomes and leaves the other looking like a server
|
|
216
|
+
* that never reached init. Both lines are at `info` for the reason `accept`
|
|
217
|
+
* gives: the framework ships no catalogue, so an undeclared locale and an
|
|
218
|
+
* untranslated code produce the same English and the log is what separates
|
|
219
|
+
* them.
|
|
210
220
|
*/
|
|
211
221
|
initialize(params: InitializeParams): void;
|
|
212
222
|
/**
|
|
@@ -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;AACtH,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,KAAK,cAAc,EAAsD,MAAM,0BAA0B,CAAC;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EA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E,GAAG,GAAG,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM;CAI/D"}
|
|
@@ -333,11 +333,24 @@ export class HydraniumWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
333
333
|
* params. `DefaultWorkspaceManager.initialize` reads `workspaceFolders`
|
|
334
334
|
* alone, so `params.locale` would otherwise be discarded — and this is the
|
|
335
335
|
* only place it arrives, which the headless init seams route through too.
|
|
336
|
+
*
|
|
337
|
+
* **The ABSENT case is reported from here rather than from `ServerLocale`,
|
|
338
|
+
* because this is the only end that can see it.** `accept` is not called
|
|
339
|
+
* when no locale was declared — nor should it be, since `''` is a claim
|
|
340
|
+
* about a language rather than the absence of one — so a log written there
|
|
341
|
+
* covers one of the two outcomes and leaves the other looking like a server
|
|
342
|
+
* that never reached init. Both lines are at `info` for the reason `accept`
|
|
343
|
+
* gives: the framework ships no catalogue, so an undeclared locale and an
|
|
344
|
+
* untranslated code produce the same English and the log is what separates
|
|
345
|
+
* them.
|
|
336
346
|
*/
|
|
337
347
|
initialize(params) {
|
|
338
348
|
if (params.locale) {
|
|
339
349
|
this.serverLocale.accept(params.locale);
|
|
340
350
|
}
|
|
351
|
+
else {
|
|
352
|
+
this.tracer.info("no locale declared at init — rendering messages in the framework's English");
|
|
353
|
+
}
|
|
341
354
|
super.initialize(params);
|
|
342
355
|
}
|
|
343
356
|
/**
|
|
@@ -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,EAAwB,QAAQ,EAAY,MAAM,oBAAoB,CAAC;AAGtH,OAAO,EAAuB,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAMnH,OAAO,EAA0B,sBAAsB,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UAAU,8EAA8E;oBACvG,CAAC,CAAC,aAAa,UAAU,oFAAoF,CAAC,CACtH,CAAC;QACL,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACO,yBAAyB,CAAC,OAA0B;QAC3D,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,KAAK,EAAE,CAAC;YACT,yBAAyB,CAAC,WAAW,EAAE,uBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9E,CAAC;IACJ,CAAC;IAED
|
|
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,EAAwB,QAAQ,EAAY,MAAM,oBAAoB,CAAC;AAGtH,OAAO,EAAuB,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAMnH,OAAO,EAA0B,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,OAAO,EAAuC,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACxH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D;;;;GAIG;AACH,IAAI,sCAAsC,GAAG,KAAK,CAAC;AAEnD;;;;;;GAMG;AACH,IAAI,mCAAuD,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,+BAA+B,CAAC,MAAe,EAAE,MAAc;IAC5E,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,4BAA4B,EAAE,CAAC;QACjF,OAAO;IACV,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,+BAA+B,GAAG,CAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAA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
* Override to ignore the argument, which is how a host pins a locale it
|
|
45
45
|
* already knows but has no LSP client to declare.
|
|
46
|
+
*
|
|
47
|
+
* **The line is at `info`, which is a deliberate exception to the
|
|
48
|
+
* per-service default.** A locale is written once per process and it is the
|
|
49
|
+
* one setting that silently changes every user-facing sentence the server
|
|
50
|
+
* produces, so a reader trying to explain an unexpected language has nothing
|
|
51
|
+
* else to look at: the framework ships no catalogue, so "no entry for this
|
|
52
|
+
* code" and "no locale declared" both render the English and are
|
|
53
|
+
* indistinguishable in the output. At `debug` the line is below the default
|
|
54
|
+
* threshold and therefore absent from exactly the log someone would be
|
|
55
|
+
* reading.
|
|
46
56
|
*/
|
|
47
57
|
accept(locale: string): void;
|
|
48
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-locale.d.ts","sourceRoot":"","sources":["../../src/locale/server-locale.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAEjF,qDAAqD;AACrD,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAEjD;;;;;;;;GAQG;AACH,qBAAa,YAAY;IACtB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE1B,QAAQ,EAAE,2BAA2B,EAAE,OAAO,GAAE,mBAAwB;IAIpF,kGAAkG;IAClG,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAE9B;IAED
|
|
1
|
+
{"version":3,"file":"server-locale.d.ts","sourceRoot":"","sources":["../../src/locale/server-locale.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAEjF,qDAAqD;AACrD,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAEjD;;;;;;;;GAQG;AACH,qBAAa,YAAY;IACtB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAClC,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE1B,QAAQ,EAAE,2BAA2B,EAAE,OAAO,GAAE,mBAAwB;IAIpF,kGAAkG;IAClG,IAAI,KAAK,IAAI,MAAM,GAAG,SAAS,CAE9B;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAI9B"}
|
|
@@ -42,10 +42,20 @@ export class ServerLocale {
|
|
|
42
42
|
*
|
|
43
43
|
* Override to ignore the argument, which is how a host pins a locale it
|
|
44
44
|
* already knows but has no LSP client to declare.
|
|
45
|
+
*
|
|
46
|
+
* **The line is at `info`, which is a deliberate exception to the
|
|
47
|
+
* per-service default.** A locale is written once per process and it is the
|
|
48
|
+
* one setting that silently changes every user-facing sentence the server
|
|
49
|
+
* produces, so a reader trying to explain an unexpected language has nothing
|
|
50
|
+
* else to look at: the framework ships no catalogue, so "no entry for this
|
|
51
|
+
* code" and "no locale declared" both render the English and are
|
|
52
|
+
* indistinguishable in the output. At `debug` the line is below the default
|
|
53
|
+
* threshold and therefore absent from exactly the log someone would be
|
|
54
|
+
* reading.
|
|
45
55
|
*/
|
|
46
56
|
accept(locale) {
|
|
47
57
|
this.current = locale;
|
|
48
|
-
this.tracer.
|
|
58
|
+
this.tracer.info(`rendering messages in locale '${locale}'`);
|
|
49
59
|
}
|
|
50
60
|
}
|
|
51
61
|
//# sourceMappingURL=server-locale.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-locale.js","sourceRoot":"","sources":["../../src/locale/server-locale.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AASlF;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAY;IACH,MAAM,CAAS;IACxB,OAAO,CAAqB;IAEtC,YAAY,QAAqC,EAAE,UAA+B,EAAE;QACjF,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9F,CAAC;IAED,kGAAkG;IAClG,IAAI,KAAK;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACvB,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"server-locale.js","sourceRoot":"","sources":["../../src/locale/server-locale.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AASlF;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAY;IACH,MAAM,CAAS;IACxB,OAAO,CAAqB;IAEtC,YAAY,QAAqC,EAAE,UAA+B,EAAE;QACjF,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9F,CAAC;IAED,kGAAkG;IAClG,IAAI,KAAK;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,MAAM,CAAC,MAAc;QAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iCAAiC,MAAM,GAAG,CAAC,CAAC;IAChE,CAAC;CACH"}
|
|
@@ -20,6 +20,13 @@ import { Diagnostic } from 'vscode-languageserver-protocol';
|
|
|
20
20
|
* be able to request a quick fix. The identity is merged OVER whatever they
|
|
21
21
|
* pass, which makes the two conventions co-exist rather than compete.
|
|
22
22
|
*
|
|
23
|
+
* `data` admits adopter-owned keys beside Langium's, which is why the index
|
|
24
|
+
* signature is there rather than a bare `Partial<DiagnosticData>`. Langium's
|
|
25
|
+
* shape is closed, and a diagnostic that carries a COMPANION payload for its own
|
|
26
|
+
* surface to read — the field a form must highlight, say — has nowhere else to
|
|
27
|
+
* put it: an encoder projecting that payload reads `diagnostic.data`, so the
|
|
28
|
+
* narrower type made the identity and the companion mutually exclusive.
|
|
29
|
+
*
|
|
23
30
|
* The identity lands in both `code` and `data.hydranium` on purpose. `code` is
|
|
24
31
|
* what survives to the editor surface; Theia's converter drops `data` before the
|
|
25
32
|
* squiggle, so a parameterised diagnostic falls back to the server's English
|
|
@@ -32,7 +39,7 @@ import { Diagnostic } from 'vscode-languageserver-protocol';
|
|
|
32
39
|
* declares `data?: unknown` and an `unknown` cannot be spread.
|
|
33
40
|
*/
|
|
34
41
|
export declare function acceptMessage<S extends string, N extends AstNode, P extends Properties<N> = Properties<N>>(accept: ValidationAcceptor, severity: 'error' | 'warning' | 'info' | 'hint', message: MessageDefinition<S>, info: Omit<DiagnosticInfo<N, P>, 'code' | 'data'> & {
|
|
35
|
-
data?: Partial<DiagnosticData>;
|
|
42
|
+
data?: Partial<DiagnosticData> & Record<string, unknown>;
|
|
36
43
|
}, ...params: ParamsArg<S>): void;
|
|
37
44
|
/**
|
|
38
45
|
* Recover the identity from a published diagnostic, for a surface that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carriers.d.ts","sourceRoot":"","sources":["../../src/messages/carriers.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAIJ,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,eAAe,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D
|
|
1
|
+
{"version":3,"file":"carriers.d.ts","sourceRoot":"","sources":["../../src/messages/carriers.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAIJ,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,eAAe,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAClH,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EACvG,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,EAC/C,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC7B,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EAChH,GAAG,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GACvB,IAAI,CAMN;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS,CAK1F"}
|
package/lib/messages/carriers.js
CHANGED
|
@@ -19,6 +19,13 @@ import { Diagnostic } from 'vscode-languageserver-protocol';
|
|
|
19
19
|
* be able to request a quick fix. The identity is merged OVER whatever they
|
|
20
20
|
* pass, which makes the two conventions co-exist rather than compete.
|
|
21
21
|
*
|
|
22
|
+
* `data` admits adopter-owned keys beside Langium's, which is why the index
|
|
23
|
+
* signature is there rather than a bare `Partial<DiagnosticData>`. Langium's
|
|
24
|
+
* shape is closed, and a diagnostic that carries a COMPANION payload for its own
|
|
25
|
+
* surface to read — the field a form must highlight, say — has nowhere else to
|
|
26
|
+
* put it: an encoder projecting that payload reads `diagnostic.data`, so the
|
|
27
|
+
* narrower type made the identity and the companion mutually exclusive.
|
|
28
|
+
*
|
|
22
29
|
* The identity lands in both `code` and `data.hydranium` on purpose. `code` is
|
|
23
30
|
* what survives to the editor surface; Theia's converter drops `data` before the
|
|
24
31
|
* squiggle, so a parameterised diagnostic falls back to the server's English
|
|
@@ -31,7 +38,10 @@ import { Diagnostic } from 'vscode-languageserver-protocol';
|
|
|
31
38
|
* declares `data?: unknown` and an `unknown` cannot be spread.
|
|
32
39
|
*/
|
|
33
40
|
export function acceptMessage(accept, severity, message, info, ...params) {
|
|
34
|
-
const data = {
|
|
41
|
+
const data = {
|
|
42
|
+
...info.data,
|
|
43
|
+
...messageData(message, ...params)
|
|
44
|
+
};
|
|
35
45
|
accept(severity, message.format(...params), { ...info, code: message.code, data });
|
|
36
46
|
}
|
|
37
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carriers.js","sourceRoot":"","sources":["../../src/messages/carriers.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,kBAAkB,EAClB,WAAW,EAKb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D
|
|
1
|
+
{"version":3,"file":"carriers.js","sourceRoot":"","sources":["../../src/messages/carriers.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,kBAAkB,EAClB,WAAW,EAKb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,aAAa,CAC1B,MAA0B,EAC1B,QAA+C,EAC/C,OAA6B,EAC7B,IAAgH,EAChH,GAAG,MAAoB;IAEvB,MAAM,IAAI,GAA6E;QACpF,GAAG,IAAI,CAAC,IAAI;QACZ,GAAG,WAAW,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC;KACpC,CAAC;IACF,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACtF,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,UAAsB;IAC1D,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC;IACpB,CAAC;IACD,OAAO,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC;AAC1F,CAAC"}
|
package/lib/messages/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export * from './carriers.js';
|
|
|
19
19
|
export * from './renderer.js';
|
|
20
20
|
export { MODEL_UPDATE_EDIT } from '../langium/model-service/model-service.js';
|
|
21
21
|
export { SEPARATOR_IN_NAME } from '../langium/naming/name-separator-validation.js';
|
|
22
|
-
export { UNRESOLVED_REFERENCE } from '../langium/validation/document-validator.js';
|
|
22
|
+
export { LEXING_ERROR, UNRESOLVED_REFERENCE } from '../langium/validation/document-validator.js';
|
|
23
23
|
export { NO_LOADABLE_CONTENT } from '../langium/workspace/langium-documents.js';
|
|
24
24
|
export { NO_SUCH_FILE, NO_SUCH_PATH } from '../langium/workspace/in-memory-file-system-provider.js';
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;GAQG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;GAQG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wDAAwD,CAAC"}
|
package/lib/messages/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export * from './carriers.js';
|
|
|
19
19
|
export * from './renderer.js';
|
|
20
20
|
export { MODEL_UPDATE_EDIT } from '../langium/model-service/model-service.js';
|
|
21
21
|
export { SEPARATOR_IN_NAME } from '../langium/naming/name-separator-validation.js';
|
|
22
|
-
export { UNRESOLVED_REFERENCE } from '../langium/validation/document-validator.js';
|
|
22
|
+
export { LEXING_ERROR, UNRESOLVED_REFERENCE } from '../langium/validation/document-validator.js';
|
|
23
23
|
export { NO_LOADABLE_CONTENT } from '../langium/workspace/langium-documents.js';
|
|
24
24
|
export { NO_SUCH_FILE, NO_SUCH_PATH } from '../langium/workspace/in-memory-file-system-provider.js';
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;GAQG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;GAQG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wDAAwD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/core",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.34",
|
|
4
4
|
"description": "Foundational runtime of the hydranium framework: AST coordination layer (services, integrity, AST extension, serialization, multi-client documents) plus the LSP textual head at the /lsp subpath. Consumed by protocol-head packages (@hydranium/data-server, @hydranium/glsp-server).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hydranium",
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"diff": "^5.2.0"
|
|
105
105
|
},
|
|
106
106
|
"devDependencies": {
|
|
107
|
-
"@hydranium/langium": "1.0.0-next.
|
|
108
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
107
|
+
"@hydranium/langium": "1.0.0-next.34",
|
|
108
|
+
"@hydranium/protocol": "1.0.0-next.34",
|
|
109
109
|
"@playwright/test": "^1.40.0",
|
|
110
110
|
"@types/diff": "^5.2.0",
|
|
111
111
|
"rimraf": "^5.0.0",
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"vscode-languageserver-types": "^3.17.5"
|
|
118
118
|
},
|
|
119
119
|
"peerDependencies": {
|
|
120
|
-
"@hydranium/langium": "1.0.0-next.
|
|
121
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
120
|
+
"@hydranium/langium": "1.0.0-next.34",
|
|
121
|
+
"@hydranium/protocol": "1.0.0-next.34",
|
|
122
122
|
"@playwright/test": "^1.40.0",
|
|
123
123
|
"vscode-jsonrpc": "9.0.1",
|
|
124
124
|
"vscode-languageserver": "~10.0.1",
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Containment-array maintenance for callers that build or delete AST nodes
|
|
12
|
+
* programmatically — a GLSP operation handler being the usual one.
|
|
13
|
+
*
|
|
14
|
+
* **These live beside the key provider because the constraint is the key
|
|
15
|
+
* provider's.** `NameBasedKeyProvider` keys a node the `NameProvider` gives no
|
|
16
|
+
* name from its position, as `` `${$containerProperty}@${$containerIndex}` ``,
|
|
17
|
+
* so a node appended with a bare `array.push` carries neither and
|
|
18
|
+
* `getElementKey` answers `undefined` — the element has no key at all, and the
|
|
19
|
+
* GLSP index cannot address it. Deleting from the middle of such a list must
|
|
20
|
+
* renumber the survivors, or an id derived later in the same command names the
|
|
21
|
+
* wrong node. Shipping the constraint's statement without the code that
|
|
22
|
+
* discharges it leaves every adopter in that position re-deriving thirty lines
|
|
23
|
+
* from prose, and both failures are silent.
|
|
24
|
+
*
|
|
25
|
+
* The population is narrower than "anyone creating elements from a diagram": it
|
|
26
|
+
* takes a grammar with UNNAMED element types, programmatic creation or deletion
|
|
27
|
+
* of them, and this key provider. A grammar whose diagram elements are all
|
|
28
|
+
* named never reaches it, and the two ways out are named on the provider —
|
|
29
|
+
* give the type a name, or bind a provider whose fallback is content-derived.
|
|
30
|
+
*
|
|
31
|
+
* **Free functions, and deliberately not a step on the AST builder.** Building a
|
|
32
|
+
* node detached and appending it later is legitimate, so a containment step
|
|
33
|
+
* cannot be mandatory; and an optional fluent step could not check the index
|
|
34
|
+
* against the array unless it were handed the array, at which point it is these
|
|
35
|
+
* signatures with more ceremony. `AstNodeInit` already accepts the three fields
|
|
36
|
+
* for a caller who has them, which is the case these cover: it is the INDEX that
|
|
37
|
+
* cannot be known without reading the array.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
import type { AstNode } from '@hydranium/langium';
|
|
41
|
+
import type { Mutable } from '@hydranium/protocol';
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Append `child` to `children`, stamping the Langium containment plumbing
|
|
45
|
+
* (`$container`, `$containerProperty`, `$containerIndex`) so a positional key
|
|
46
|
+
* can address it.
|
|
47
|
+
*
|
|
48
|
+
* `property` and `children` are separate parameters rather than one property
|
|
49
|
+
* name the function dereferences: the array is what the index is derived from,
|
|
50
|
+
* so taking it directly is what makes the two agree by construction instead of
|
|
51
|
+
* by a lookup that a typo could point elsewhere.
|
|
52
|
+
*
|
|
53
|
+
* @returns `child`, so a caller can append and use it in one expression.
|
|
54
|
+
*/
|
|
55
|
+
export function appendChild<TChild extends AstNode>(container: AstNode, property: string, children: TChild[], child: TChild): TChild {
|
|
56
|
+
const mutable = child as Mutable<TChild>;
|
|
57
|
+
mutable.$container = container;
|
|
58
|
+
mutable.$containerProperty = property;
|
|
59
|
+
mutable.$containerIndex = children.length;
|
|
60
|
+
children.push(child);
|
|
61
|
+
return child;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Remove every entry of `children` that is in `toRemove`, then renumber the
|
|
66
|
+
* survivors' `$containerIndex`.
|
|
67
|
+
*
|
|
68
|
+
* Mutates `children` in place rather than returning a new array, because the
|
|
69
|
+
* caller's array IS the AST's containment list — replacing the reference would
|
|
70
|
+
* leave the parent pointing at the old one.
|
|
71
|
+
*
|
|
72
|
+
* @returns how many entries were removed, so a caller can tell a no-op delete
|
|
73
|
+
* from one that changed the model without comparing lengths itself.
|
|
74
|
+
*/
|
|
75
|
+
export function removeChildren<TChild extends AstNode>(children: TChild[], toRemove: ReadonlySet<TChild>): number {
|
|
76
|
+
if (toRemove.size === 0) {
|
|
77
|
+
return 0;
|
|
78
|
+
}
|
|
79
|
+
const survivors = children.filter(child => !toRemove.has(child));
|
|
80
|
+
const removed = children.length - survivors.length;
|
|
81
|
+
children.length = 0;
|
|
82
|
+
for (const [index, child] of survivors.entries()) {
|
|
83
|
+
(child as Mutable<TChild>).$containerIndex = index;
|
|
84
|
+
children.push(child);
|
|
85
|
+
}
|
|
86
|
+
return removed;
|
|
87
|
+
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
+
export * from './containment.js';
|
|
10
11
|
export * from './element-key-provider.js';
|
|
11
12
|
export * from './name-based-key-provider.js';
|
|
12
13
|
export * from './positional-key-provider.js';
|
|
@@ -55,6 +55,10 @@ import { type NameProvider } from '../naming/name-provider.js';
|
|
|
55
55
|
* - After a removal, surviving siblings need their `$containerIndex`
|
|
56
56
|
* renumbered, or a key derived afterwards addresses the wrong node.
|
|
57
57
|
*
|
|
58
|
+
* {@link appendChild} and {@link removeChildren} discharge both, and ship
|
|
59
|
+
* beside this provider because the constraint is this provider's rather than
|
|
60
|
+
* any caller's.
|
|
61
|
+
*
|
|
58
62
|
* Adopters that need insert / delete stability for unnamed types should
|
|
59
63
|
* give those types a name in the grammar, or bind a key provider whose
|
|
60
64
|
* fallback is content-derived rather than positional.
|
|
@@ -502,11 +502,22 @@ export class ModelService<
|
|
|
502
502
|
*
|
|
503
503
|
* Phase invariants encoded in the return type:
|
|
504
504
|
* - `parsed` / `linked` / `settled` / `indexed` return
|
|
505
|
-
* `AstDocument<TAst, never>` — diagnostics
|
|
506
|
-
*
|
|
505
|
+
* `AstDocument<TAst, never>` — no diagnostics have been computed at
|
|
506
|
+
* those phases.
|
|
507
507
|
* - `validated` returns `AstDocument<TAst, TDiagnostic>` — diagnostics
|
|
508
508
|
* are populated.
|
|
509
509
|
*
|
|
510
|
+
* **The `never` is a claim about the PHASE, not a guarantee about the
|
|
511
|
+
* instance, and the gap is reachable rather than theoretical.** The wait
|
|
512
|
+
* underneath resolves at or ABOVE the requested state, so a document
|
|
513
|
+
* something else already carried past `Validated` comes back from
|
|
514
|
+
* `settled()` with a populated diagnostics array typed `never`. Nothing
|
|
515
|
+
* strips it — the envelope copies the live document's array verbatim — and
|
|
516
|
+
* any host that validates its workspace before a consumer asks produces
|
|
517
|
+
* exactly that. So read an empty array as "none were computed, or there are
|
|
518
|
+
* none", never as "this document is clean", and call {@link validated} when
|
|
519
|
+
* the answer has to mean the second.
|
|
520
|
+
*
|
|
510
521
|
* `settled` is the integrity-overlay name for "all integrity rules
|
|
511
522
|
* have fired"; it maps to {@link IntegrityService.SettledState} (which
|
|
512
523
|
* equals `DocumentState.IndexedReferences`), but the dedicated method
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
type AstReflection,
|
|
24
24
|
DefaultDocumentValidator,
|
|
25
25
|
type DiagnosticInfo,
|
|
26
|
+
DocumentValidator,
|
|
26
27
|
type LangiumDocument,
|
|
27
28
|
type LangiumCoreServices,
|
|
28
29
|
type ValidateSingleNodeOptions,
|
|
@@ -30,7 +31,10 @@ import {
|
|
|
30
31
|
type ValidationSeverity
|
|
31
32
|
} from '@hydranium/langium';
|
|
32
33
|
import type { CancellationToken } from 'vscode-languageserver-protocol';
|
|
33
|
-
import
|
|
34
|
+
// A VALUE import, for `Diagnostic.getMessageString`: `message` is
|
|
35
|
+
// `string | MarkupContent` in LSP 3.17+, so upstream's own reader is what
|
|
36
|
+
// narrows it rather than a hand-rolled union check here.
|
|
37
|
+
import { Diagnostic } from 'vscode-languageserver-types';
|
|
34
38
|
import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
35
39
|
import { isSyntheticNode } from '../workspace/synthetic.js';
|
|
36
40
|
import { isVirtualUri } from '../workspace/virtual-document.js';
|
|
@@ -78,6 +82,51 @@ export const UNRESOLVED_REFERENCE = defineMessage(
|
|
|
78
82
|
"Could not resolve reference to {referenceType} named '{refText}'."
|
|
79
83
|
);
|
|
80
84
|
|
|
85
|
+
/**
|
|
86
|
+
* A character no token of the grammar can start with.
|
|
87
|
+
*
|
|
88
|
+
* **The English is byte-identical to CHEVROTAIN's
|
|
89
|
+
* `defaultLexerErrorProvider.buildUnexpectedCharactersMessage`, and must stay
|
|
90
|
+
* so** — one layer further out than {@link UNRESOLVED_REFERENCE}, whose sentence
|
|
91
|
+
* is Langium's. Langium words neither: `processLexingErrors` copies
|
|
92
|
+
* `lexerDiagnostic.message` through untouched, so the text an adopter sees today
|
|
93
|
+
* is produced two dependencies down and is the only thing this identity may
|
|
94
|
+
* claim to be. {@link HydraniumDocumentValidator.identifyLexingError} attaches
|
|
95
|
+
* it only when the two match exactly, which is also what keeps a custom lexer's
|
|
96
|
+
* own diagnostics — Langium admits any of them through `lexerReport` — from
|
|
97
|
+
* being mislabelled as this one.
|
|
98
|
+
*
|
|
99
|
+
* It exists because a lexing error is the FIRST message a user of a new language
|
|
100
|
+
* sees and the one an adopter cannot reach: every other diagnostic worth
|
|
101
|
+
* translating either carries an identity already or is raised by adopter code,
|
|
102
|
+
* while this one arrives with a Langium `data.code` naming a KIND and no
|
|
103
|
+
* parameters at all — so a catalogue had nothing to key on and nothing to
|
|
104
|
+
* interpolate.
|
|
105
|
+
*
|
|
106
|
+
* `skipped` rather than `length`, matching what the sentence says the number
|
|
107
|
+
* means: chevrotain reports how many characters the lexer discarded to recover,
|
|
108
|
+
* which for a single stray character is one and for a run of them is the run.
|
|
109
|
+
*/
|
|
110
|
+
export const LEXING_ERROR = defineMessage(
|
|
111
|
+
'hydranium/core/lexing-error',
|
|
112
|
+
'unexpected character: ->{character}<- at offset: {offset}, skipped {skipped} characters.'
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Langium's own `data.code` values for a diagnostic that came out of the lexer.
|
|
117
|
+
*
|
|
118
|
+
* All four severities, not just the error one: `lexerReport` admits warnings and
|
|
119
|
+
* below, and a token builder that downgrades a stray character still produces
|
|
120
|
+
* the same sentence. Gating on the error code alone would leave the identity off
|
|
121
|
+
* a message that is word-for-word the one it names.
|
|
122
|
+
*/
|
|
123
|
+
const LEXING_CODES: ReadonlySet<unknown> = new Set([
|
|
124
|
+
DocumentValidator.LexingError,
|
|
125
|
+
DocumentValidator.LexingWarning,
|
|
126
|
+
DocumentValidator.LexingInfo,
|
|
127
|
+
DocumentValidator.LexingHint
|
|
128
|
+
]);
|
|
129
|
+
|
|
81
130
|
export interface DocumentValidatorOptions extends LogNameOptions {
|
|
82
131
|
/**
|
|
83
132
|
* Level at which the `validateDocument` timing line is emitted, or `'off'`
|
|
@@ -156,16 +205,85 @@ export class HydraniumDocumentValidator extends DefaultDocumentValidator {
|
|
|
156
205
|
}
|
|
157
206
|
const level = this.logLevel.value;
|
|
158
207
|
if (level === 'off') {
|
|
159
|
-
return
|
|
208
|
+
return this.validateAndIdentify(document, options, cancelToken);
|
|
160
209
|
}
|
|
161
210
|
// `level` is narrowed to `LogLevel` past the early-return.
|
|
162
211
|
return this.tracer
|
|
163
212
|
.withUri(document.uri.toString())
|
|
164
|
-
.time('validateDocument', () =>
|
|
213
|
+
.time('validateDocument', () => this.validateAndIdentify(document, options, cancelToken), level, {
|
|
165
214
|
logAfterMs: this.logAfterMs.value
|
|
166
215
|
});
|
|
167
216
|
}
|
|
168
217
|
|
|
218
|
+
/**
|
|
219
|
+
* Langium's validation pass, plus the framework identity on the lexing
|
|
220
|
+
* diagnostics it produced.
|
|
221
|
+
*
|
|
222
|
+
* **Here rather than in an override of `processLexingErrors`, and the reason
|
|
223
|
+
* is that the seam cannot see what the identity needs.** Langium hands that
|
|
224
|
+
* method a `ParseResult`, which carries the AST and the error lists but not
|
|
225
|
+
* the source text — and the offending CHARACTER is the parameter a
|
|
226
|
+
* translation exists to interpolate. The document does carry it, and this is
|
|
227
|
+
* the innermost point that still holds one. Reconstructing the character by
|
|
228
|
+
* matching it out of the finished sentence was the alternative, and it
|
|
229
|
+
* inverts the direction the rest of this file works in: every other identity
|
|
230
|
+
* here is derived from structured fields and CHECKED against the prose.
|
|
231
|
+
*
|
|
232
|
+
* Inside the timing span rather than around it, so the line accounts for the
|
|
233
|
+
* whole pass.
|
|
234
|
+
*/
|
|
235
|
+
protected async validateAndIdentify(
|
|
236
|
+
document: LangiumDocument,
|
|
237
|
+
options?: ValidationOptions,
|
|
238
|
+
cancelToken?: CancellationToken
|
|
239
|
+
): Promise<Diagnostic[]> {
|
|
240
|
+
const diagnostics = await super.validateDocument(document, options, cancelToken);
|
|
241
|
+
// Mapped in place over the array Langium built, rather than filtered and
|
|
242
|
+
// re-concatenated: the publish order is the diagnostic order and a
|
|
243
|
+
// reordering would move a squiggle's entry in the problems list.
|
|
244
|
+
for (let index = 0; index < diagnostics.length; index++) {
|
|
245
|
+
diagnostics[index] = this.identifyLexingError(document, diagnostics[index]);
|
|
246
|
+
}
|
|
247
|
+
return diagnostics;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Add the {@link LEXING_ERROR} identity to one diagnostic, or return it
|
|
252
|
+
* untouched when it is not the sentence that identity renders.
|
|
253
|
+
*
|
|
254
|
+
* The parameters come from the diagnostic's own RANGE, not from
|
|
255
|
+
* `parseResult.lexerErrors`. Both hold the same numbers, and the range is the
|
|
256
|
+
* one that needs no assumption about upstream: correlating the two lists
|
|
257
|
+
* would depend on Langium appending one diagnostic per lexer error in order,
|
|
258
|
+
* which is true today and is an internal of the method being wrapped.
|
|
259
|
+
*
|
|
260
|
+
* **The format-and-compare is the whole discriminator, and it validates the
|
|
261
|
+
* reconstruction as well as the identity.** A range that did not round-trip
|
|
262
|
+
* to the offset chevrotain reported would produce a different sentence and be
|
|
263
|
+
* declined, so a wrong parameter set can never be attached to a right-looking
|
|
264
|
+
* message.
|
|
265
|
+
*/
|
|
266
|
+
protected identifyLexingError(document: LangiumDocument, diagnostic: Diagnostic): Diagnostic {
|
|
267
|
+
const data = diagnostic.data as { code?: unknown } | undefined;
|
|
268
|
+
if (!LEXING_CODES.has(data?.code)) {
|
|
269
|
+
return diagnostic;
|
|
270
|
+
}
|
|
271
|
+
const text = document.textDocument;
|
|
272
|
+
const offset = text.offsetAt(diagnostic.range.start);
|
|
273
|
+
const params = {
|
|
274
|
+
character: text.getText().charAt(offset),
|
|
275
|
+
offset,
|
|
276
|
+
skipped: text.offsetAt(diagnostic.range.end) - offset
|
|
277
|
+
};
|
|
278
|
+
if (Diagnostic.getMessageString(diagnostic) !== LEXING_ERROR.format(params)) {
|
|
279
|
+
return diagnostic;
|
|
280
|
+
}
|
|
281
|
+
// Merged OVER Langium's data, so `data.code` survives for the readers that
|
|
282
|
+
// switch on it — `stopAfterLexingErrors` is one, and the GLSP head's
|
|
283
|
+
// read-only decision is another.
|
|
284
|
+
return { ...diagnostic, code: LEXING_ERROR.code, data: { ...data, ...messageData(LEXING_ERROR, params) } };
|
|
285
|
+
}
|
|
286
|
+
|
|
169
287
|
/**
|
|
170
288
|
* Skip validation for a node **and its children** when
|
|
171
289
|
* {@link shouldSkipValidation} returns true.
|
|
@@ -369,10 +369,22 @@ export class HydraniumWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
369
369
|
* params. `DefaultWorkspaceManager.initialize` reads `workspaceFolders`
|
|
370
370
|
* alone, so `params.locale` would otherwise be discarded — and this is the
|
|
371
371
|
* only place it arrives, which the headless init seams route through too.
|
|
372
|
+
*
|
|
373
|
+
* **The ABSENT case is reported from here rather than from `ServerLocale`,
|
|
374
|
+
* because this is the only end that can see it.** `accept` is not called
|
|
375
|
+
* when no locale was declared — nor should it be, since `''` is a claim
|
|
376
|
+
* about a language rather than the absence of one — so a log written there
|
|
377
|
+
* covers one of the two outcomes and leaves the other looking like a server
|
|
378
|
+
* that never reached init. Both lines are at `info` for the reason `accept`
|
|
379
|
+
* gives: the framework ships no catalogue, so an undeclared locale and an
|
|
380
|
+
* untranslated code produce the same English and the log is what separates
|
|
381
|
+
* them.
|
|
372
382
|
*/
|
|
373
383
|
override initialize(params: InitializeParams): void {
|
|
374
384
|
if (params.locale) {
|
|
375
385
|
this.serverLocale.accept(params.locale);
|
|
386
|
+
} else {
|
|
387
|
+
this.tracer.info("no locale declared at init — rendering messages in the framework's English");
|
|
376
388
|
}
|
|
377
389
|
super.initialize(params);
|
|
378
390
|
}
|