@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
|
@@ -53,9 +53,19 @@ export class ServerLocale {
|
|
|
53
53
|
*
|
|
54
54
|
* Override to ignore the argument, which is how a host pins a locale it
|
|
55
55
|
* already knows but has no LSP client to declare.
|
|
56
|
+
*
|
|
57
|
+
* **The line is at `info`, which is a deliberate exception to the
|
|
58
|
+
* per-service default.** A locale is written once per process and it is the
|
|
59
|
+
* one setting that silently changes every user-facing sentence the server
|
|
60
|
+
* produces, so a reader trying to explain an unexpected language has nothing
|
|
61
|
+
* else to look at: the framework ships no catalogue, so "no entry for this
|
|
62
|
+
* code" and "no locale declared" both render the English and are
|
|
63
|
+
* indistinguishable in the output. At `debug` the line is below the default
|
|
64
|
+
* threshold and therefore absent from exactly the log someone would be
|
|
65
|
+
* reading.
|
|
56
66
|
*/
|
|
57
67
|
accept(locale: string): void {
|
|
58
68
|
this.current = locale;
|
|
59
|
-
this.tracer.
|
|
69
|
+
this.tracer.info(`rendering messages in locale '${locale}'`);
|
|
60
70
|
}
|
|
61
71
|
}
|
package/src/messages/carriers.ts
CHANGED
|
@@ -29,6 +29,13 @@ import { Diagnostic } from 'vscode-languageserver-protocol';
|
|
|
29
29
|
* be able to request a quick fix. The identity is merged OVER whatever they
|
|
30
30
|
* pass, which makes the two conventions co-exist rather than compete.
|
|
31
31
|
*
|
|
32
|
+
* `data` admits adopter-owned keys beside Langium's, which is why the index
|
|
33
|
+
* signature is there rather than a bare `Partial<DiagnosticData>`. Langium's
|
|
34
|
+
* shape is closed, and a diagnostic that carries a COMPANION payload for its own
|
|
35
|
+
* surface to read — the field a form must highlight, say — has nowhere else to
|
|
36
|
+
* put it: an encoder projecting that payload reads `diagnostic.data`, so the
|
|
37
|
+
* narrower type made the identity and the companion mutually exclusive.
|
|
38
|
+
*
|
|
32
39
|
* The identity lands in both `code` and `data.hydranium` on purpose. `code` is
|
|
33
40
|
* what survives to the editor surface; Theia's converter drops `data` before the
|
|
34
41
|
* squiggle, so a parameterised diagnostic falls back to the server's English
|
|
@@ -44,10 +51,13 @@ export function acceptMessage<S extends string, N extends AstNode, P extends Pro
|
|
|
44
51
|
accept: ValidationAcceptor,
|
|
45
52
|
severity: 'error' | 'warning' | 'info' | 'hint',
|
|
46
53
|
message: MessageDefinition<S>,
|
|
47
|
-
info: Omit<DiagnosticInfo<N, P>, 'code' | 'data'> & { data?: Partial<DiagnosticData> },
|
|
54
|
+
info: Omit<DiagnosticInfo<N, P>, 'code' | 'data'> & { data?: Partial<DiagnosticData> & Record<string, unknown> },
|
|
48
55
|
...params: ParamsArg<S>
|
|
49
56
|
): void {
|
|
50
|
-
const data: HydraniumMessageData & Partial<DiagnosticData>
|
|
57
|
+
const data: HydraniumMessageData & Partial<DiagnosticData> & Record<string, unknown> = {
|
|
58
|
+
...info.data,
|
|
59
|
+
...messageData(message, ...params)
|
|
60
|
+
};
|
|
51
61
|
accept(severity, message.format(...params), { ...info, code: message.code, data });
|
|
52
62
|
}
|
|
53
63
|
|
package/src/messages/index.ts
CHANGED
|
@@ -22,6 +22,6 @@ export * from './renderer.js';
|
|
|
22
22
|
|
|
23
23
|
export { MODEL_UPDATE_EDIT } from '../langium/model-service/model-service.js';
|
|
24
24
|
export { SEPARATOR_IN_NAME } from '../langium/naming/name-separator-validation.js';
|
|
25
|
-
export { UNRESOLVED_REFERENCE } from '../langium/validation/document-validator.js';
|
|
25
|
+
export { LEXING_ERROR, UNRESOLVED_REFERENCE } from '../langium/validation/document-validator.js';
|
|
26
26
|
export { NO_LOADABLE_CONTENT } from '../langium/workspace/langium-documents.js';
|
|
27
27
|
export { NO_SUCH_FILE, NO_SUCH_PATH } from '../langium/workspace/in-memory-file-system-provider.js';
|