@hydranium/core 1.0.0-next.4 → 1.0.0-next.40

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.
Files changed (228) hide show
  1. package/lib/documents/ast-document-manager.d.ts +42 -5
  2. package/lib/documents/ast-document-manager.d.ts.map +1 -1
  3. package/lib/documents/ast-document-manager.js +9 -12
  4. package/lib/documents/ast-document-manager.js.map +1 -1
  5. package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
  6. package/lib/documents/hydranium-text-documents.js +41 -9
  7. package/lib/documents/hydranium-text-documents.js.map +1 -1
  8. package/lib/documents/language-client-text-shadow.d.ts +24 -1
  9. package/lib/documents/language-client-text-shadow.d.ts.map +1 -1
  10. package/lib/documents/language-client-text-shadow.js +36 -2
  11. package/lib/documents/language-client-text-shadow.js.map +1 -1
  12. package/lib/documents/self-save-registry.d.ts +37 -6
  13. package/lib/documents/self-save-registry.d.ts.map +1 -1
  14. package/lib/documents/self-save-registry.js +28 -15
  15. package/lib/documents/self-save-registry.js.map +1 -1
  16. package/lib/index.d.ts +2 -0
  17. package/lib/index.d.ts.map +1 -1
  18. package/lib/index.js +5 -0
  19. package/lib/index.js.map +1 -1
  20. package/lib/langium/ast-extension/ast-node-builder.d.ts +32 -9
  21. package/lib/langium/ast-extension/ast-node-builder.d.ts.map +1 -1
  22. package/lib/langium/ast-extension/ast-node-builder.js +60 -22
  23. package/lib/langium/ast-extension/ast-node-builder.js.map +1 -1
  24. package/lib/langium/bootstrap.d.ts.map +1 -1
  25. package/lib/langium/bootstrap.js +16 -9
  26. package/lib/langium/bootstrap.js.map +1 -1
  27. package/lib/langium/document-builder/build-pipeline-integration.d.ts +13 -1
  28. package/lib/langium/document-builder/build-pipeline-integration.d.ts.map +1 -1
  29. package/lib/langium/document-builder/build-pipeline-integration.js +1 -1
  30. package/lib/langium/document-builder/build-pipeline-integration.js.map +1 -1
  31. package/lib/langium/document-builder/build-session.d.ts +93 -0
  32. package/lib/langium/document-builder/build-session.d.ts.map +1 -0
  33. package/lib/langium/document-builder/build-session.js +72 -0
  34. package/lib/langium/document-builder/build-session.js.map +1 -0
  35. package/lib/langium/document-builder/document-builder.d.ts +150 -7
  36. package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
  37. package/lib/langium/document-builder/document-builder.js +298 -11
  38. package/lib/langium/document-builder/document-builder.js.map +1 -1
  39. package/lib/langium/document-builder/index.d.ts +1 -0
  40. package/lib/langium/document-builder/index.d.ts.map +1 -1
  41. package/lib/langium/document-builder/index.js +1 -0
  42. package/lib/langium/document-builder/index.js.map +1 -1
  43. package/lib/langium/integration-services.d.ts +45 -1
  44. package/lib/langium/integration-services.d.ts.map +1 -1
  45. package/lib/langium/integration-services.js +10 -5
  46. package/lib/langium/integration-services.js.map +1 -1
  47. package/lib/langium/integrity/integrity-service.d.ts +5 -0
  48. package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
  49. package/lib/langium/integrity/integrity-service.js +34 -1
  50. package/lib/langium/integrity/integrity-service.js.map +1 -1
  51. package/lib/langium/keys/containment.d.ts +64 -0
  52. package/lib/langium/keys/containment.d.ts.map +1 -0
  53. package/lib/langium/keys/containment.js +53 -0
  54. package/lib/langium/keys/containment.js.map +1 -0
  55. package/lib/langium/keys/index.d.ts +1 -0
  56. package/lib/langium/keys/index.d.ts.map +1 -1
  57. package/lib/langium/keys/index.js +1 -0
  58. package/lib/langium/keys/index.js.map +1 -1
  59. package/lib/langium/keys/name-based-key-provider.d.ts +4 -0
  60. package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -1
  61. package/lib/langium/keys/name-based-key-provider.js +4 -0
  62. package/lib/langium/keys/name-based-key-provider.js.map +1 -1
  63. package/lib/langium/model-service/model-service.d.ts +103 -7
  64. package/lib/langium/model-service/model-service.d.ts.map +1 -1
  65. package/lib/langium/model-service/model-service.js +70 -89
  66. package/lib/langium/model-service/model-service.js.map +1 -1
  67. package/lib/langium/module.d.ts +82 -13
  68. package/lib/langium/module.d.ts.map +1 -1
  69. package/lib/langium/module.js +21 -12
  70. package/lib/langium/module.js.map +1 -1
  71. package/lib/langium/naming/name-provider.d.ts +10 -0
  72. package/lib/langium/naming/name-provider.d.ts.map +1 -1
  73. package/lib/langium/naming/name-provider.js.map +1 -1
  74. package/lib/langium/naming/name-separator-validation.d.ts +23 -0
  75. package/lib/langium/naming/name-separator-validation.d.ts.map +1 -1
  76. package/lib/langium/naming/name-separator-validation.js +30 -1
  77. package/lib/langium/naming/name-separator-validation.js.map +1 -1
  78. package/lib/langium/residency/cst-residency-service.d.ts +31 -9
  79. package/lib/langium/residency/cst-residency-service.d.ts.map +1 -1
  80. package/lib/langium/residency/cst-residency-service.js +13 -56
  81. package/lib/langium/residency/cst-residency-service.js.map +1 -1
  82. package/lib/langium/scope/hydranium-scope-provider.d.ts +32 -13
  83. package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -1
  84. package/lib/langium/scope/hydranium-scope-provider.js +37 -20
  85. package/lib/langium/scope/hydranium-scope-provider.js.map +1 -1
  86. package/lib/langium/shared-services.d.ts +15 -2
  87. package/lib/langium/shared-services.d.ts.map +1 -1
  88. package/lib/langium/shared-services.js.map +1 -1
  89. package/lib/langium/transfer/transfer-encoder.d.ts +33 -2
  90. package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -1
  91. package/lib/langium/transfer/transfer-encoder.js +14 -3
  92. package/lib/langium/transfer/transfer-encoder.js.map +1 -1
  93. package/lib/langium/validation/document-validator.d.ts +145 -6
  94. package/lib/langium/validation/document-validator.d.ts.map +1 -1
  95. package/lib/langium/validation/document-validator.js +211 -4
  96. package/lib/langium/validation/document-validator.js.map +1 -1
  97. package/lib/langium/workspace/document-uri-policy.d.ts +3 -4
  98. package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -1
  99. package/lib/langium/workspace/document-uri-policy.js +3 -4
  100. package/lib/langium/workspace/document-uri-policy.js.map +1 -1
  101. package/lib/langium/workspace/hydranium-langium-document-factory.d.ts +25 -0
  102. package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -1
  103. package/lib/langium/workspace/hydranium-langium-document-factory.js +25 -0
  104. package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -1
  105. package/lib/langium/workspace/hydranium-workspace-manager.d.ts +21 -1
  106. package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
  107. package/lib/langium/workspace/hydranium-workspace-manager.js +28 -0
  108. package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -1
  109. package/lib/langium/workspace/in-memory-file-system-provider.d.ts +8 -0
  110. package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
  111. package/lib/langium/workspace/in-memory-file-system-provider.js +11 -2
  112. package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
  113. package/lib/langium/workspace/initialize-workspace.d.ts +22 -2
  114. package/lib/langium/workspace/initialize-workspace.d.ts.map +1 -1
  115. package/lib/langium/workspace/initialize-workspace.js +13 -5
  116. package/lib/langium/workspace/initialize-workspace.js.map +1 -1
  117. package/lib/langium/workspace/langium-documents.d.ts +79 -17
  118. package/lib/langium/workspace/langium-documents.d.ts.map +1 -1
  119. package/lib/langium/workspace/langium-documents.js +83 -28
  120. package/lib/langium/workspace/langium-documents.js.map +1 -1
  121. package/lib/locale/index.d.ts +10 -0
  122. package/lib/locale/index.d.ts.map +1 -0
  123. package/lib/locale/index.js +10 -0
  124. package/lib/locale/index.js.map +1 -0
  125. package/lib/locale/server-locale.d.ts +73 -0
  126. package/lib/locale/server-locale.d.ts.map +1 -0
  127. package/lib/locale/server-locale.js +61 -0
  128. package/lib/locale/server-locale.js.map +1 -0
  129. package/lib/lsp/hydranium-document-update-handler.js +1 -1
  130. package/lib/lsp/hydranium-document-update-handler.js.map +1 -1
  131. package/lib/messages/carriers.d.ts +54 -0
  132. package/lib/messages/carriers.d.ts.map +1 -0
  133. package/lib/messages/carriers.js +62 -0
  134. package/lib/messages/carriers.js.map +1 -0
  135. package/lib/messages/index.d.ts +25 -0
  136. package/lib/messages/index.d.ts.map +1 -0
  137. package/lib/messages/index.js +25 -0
  138. package/lib/messages/index.js.map +1 -0
  139. package/lib/messages/renderer.d.ts +136 -0
  140. package/lib/messages/renderer.d.ts.map +1 -0
  141. package/lib/messages/renderer.js +159 -0
  142. package/lib/messages/renderer.js.map +1 -0
  143. package/lib/node/node-file-system-provider.d.ts.map +1 -1
  144. package/lib/node/node-file-system-provider.js +1 -40
  145. package/lib/node/node-file-system-provider.js.map +1 -1
  146. package/lib/node/rename-over-open-readers.d.ts +52 -0
  147. package/lib/node/rename-over-open-readers.d.ts.map +1 -0
  148. package/lib/node/rename-over-open-readers.js +66 -0
  149. package/lib/node/rename-over-open-readers.js.map +1 -0
  150. package/lib/testing/fake-document.d.ts +14 -3
  151. package/lib/testing/fake-document.d.ts.map +1 -1
  152. package/lib/testing/fake-document.js +18 -3
  153. package/lib/testing/fake-document.js.map +1 -1
  154. package/lib/testing/make-noop-shared-services.d.ts +14 -0
  155. package/lib/testing/make-noop-shared-services.d.ts.map +1 -1
  156. package/lib/testing/make-noop-shared-services.js +28 -2
  157. package/lib/testing/make-noop-shared-services.js.map +1 -1
  158. package/lib/testing/make-test-services.d.ts +31 -4
  159. package/lib/testing/make-test-services.d.ts.map +1 -1
  160. package/lib/testing/make-test-services.js +19 -3
  161. package/lib/testing/make-test-services.js.map +1 -1
  162. package/lib/testing/playwright/server-log-capture.d.ts +14 -4
  163. package/lib/testing/playwright/server-log-capture.d.ts.map +1 -1
  164. package/lib/testing/playwright/server-log-capture.js +21 -4
  165. package/lib/testing/playwright/server-log-capture.js.map +1 -1
  166. package/lib/testing/playwright/server-log-rename-reporter.d.ts.map +1 -1
  167. package/lib/testing/playwright/server-log-rename-reporter.js +10 -1
  168. package/lib/testing/playwright/server-log-rename-reporter.js.map +1 -1
  169. package/lib/testing/stub-ast-document-manager.d.ts +3 -4
  170. package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
  171. package/lib/testing/stub-ast-document-manager.js +2 -5
  172. package/lib/testing/stub-ast-document-manager.js.map +1 -1
  173. package/lib/testing/stub-document-builder.d.ts +8 -0
  174. package/lib/testing/stub-document-builder.d.ts.map +1 -1
  175. package/lib/testing/stub-document-builder.js +22 -3
  176. package/lib/testing/stub-document-builder.js.map +1 -1
  177. package/lib/testing/stub-model-service.d.ts +1 -1
  178. package/lib/testing/stub-model-service.d.ts.map +1 -1
  179. package/lib/testing/stub-model-service.js +2 -2
  180. package/lib/testing/stub-model-service.js.map +1 -1
  181. package/package.json +17 -8
  182. package/src/documents/ast-document-manager.ts +55 -14
  183. package/src/documents/hydranium-text-documents.ts +41 -9
  184. package/src/documents/language-client-text-shadow.ts +38 -2
  185. package/src/documents/self-save-registry.ts +52 -13
  186. package/src/index.ts +5 -0
  187. package/src/langium/ast-extension/ast-node-builder.ts +66 -22
  188. package/src/langium/bootstrap.ts +16 -9
  189. package/src/langium/document-builder/build-pipeline-integration.ts +14 -1
  190. package/src/langium/document-builder/build-session.ts +87 -0
  191. package/src/langium/document-builder/document-builder.ts +339 -11
  192. package/src/langium/document-builder/index.ts +1 -0
  193. package/src/langium/integration-services.ts +67 -6
  194. package/src/langium/integrity/integrity-service.ts +35 -1
  195. package/src/langium/keys/containment.ts +87 -0
  196. package/src/langium/keys/index.ts +1 -0
  197. package/src/langium/keys/name-based-key-provider.ts +4 -0
  198. package/src/langium/model-service/model-service.ts +145 -22
  199. package/src/langium/module.ts +99 -19
  200. package/src/langium/naming/name-provider.ts +10 -0
  201. package/src/langium/naming/name-separator-validation.ts +34 -5
  202. package/src/langium/residency/cst-residency-service.ts +36 -12
  203. package/src/langium/scope/hydranium-scope-provider.ts +40 -22
  204. package/src/langium/shared-services.ts +19 -2
  205. package/src/langium/transfer/transfer-encoder.ts +45 -3
  206. package/src/langium/validation/document-validator.ts +255 -8
  207. package/src/langium/workspace/document-uri-policy.ts +3 -4
  208. package/src/langium/workspace/hydranium-langium-document-factory.ts +34 -0
  209. package/src/langium/workspace/hydranium-workspace-manager.ts +30 -1
  210. package/src/langium/workspace/in-memory-file-system-provider.ts +13 -3
  211. package/src/langium/workspace/initialize-workspace.ts +34 -5
  212. package/src/langium/workspace/langium-documents.ts +106 -33
  213. package/src/locale/index.ts +10 -0
  214. package/src/locale/server-locale.ts +86 -0
  215. package/src/lsp/hydranium-document-update-handler.ts +1 -1
  216. package/src/messages/carriers.ts +78 -0
  217. package/src/messages/index.ts +27 -0
  218. package/src/messages/renderer.ts +204 -0
  219. package/src/node/node-file-system-provider.ts +1 -41
  220. package/src/node/rename-over-open-readers.ts +78 -0
  221. package/src/testing/fake-document.ts +22 -4
  222. package/src/testing/make-noop-shared-services.ts +50 -2
  223. package/src/testing/make-test-services.ts +49 -7
  224. package/src/testing/playwright/server-log-capture.ts +24 -5
  225. package/src/testing/playwright/server-log-rename-reporter.ts +12 -1
  226. package/src/testing/stub-ast-document-manager.ts +5 -10
  227. package/src/testing/stub-document-builder.ts +32 -3
  228. package/src/testing/stub-model-service.ts +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-locale.js","sourceRoot":"","sources":["../../src/locale/server-locale.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAwBlF;;;;;;;;GAQG;AACH,MAAM,OAAO,mBAAmB;IACV,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"}
@@ -205,7 +205,7 @@ export class HydraniumDocumentUpdateHandler extends DefaultDocumentUpdateHandler
205
205
  }
206
206
  const uri = UriUtils.toUri(change.uri);
207
207
  const mtimeMs = await this.fileSystemProvider.mtimeMs?.(uri);
208
- if (mtimeMs !== undefined && this.selfSaveRegistry.matches(uri.fsPath, mtimeMs)) {
208
+ if (mtimeMs !== undefined && this.selfSaveRegistry.isRegistered(uri.fsPath, mtimeMs)) {
209
209
  return undefined;
210
210
  }
211
211
  return change;
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-document-update-handler.js","sourceRoot":"","sources":["../../src/lsp/hydranium-document-update-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,SAAS,EAAe,eAAe,EAA6B,MAAM,qBAAqB,CAAC;AACzG,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAIhE,OAAO,EAAoD,cAAc,EAAgC,MAAM,uBAAuB,CAAC;AAGvI;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC;IAClD,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,kBAAkB;IACpC,qBAAqB,EAAE,uBAAuB;IAC9C,QAAQ,EAAE,UAAU;CACb,CAAC,CAAC;AA4BZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,OAAO,8BAA+B,SAAQ,4BAA4B;IAQ1D,MAAM,CAAS;IACf,gBAAgB,CAAmB;IACnC,kBAAkB,CAA6B;IAC/C,aAAa,CAAuC;IAEvE,0FAA0F;IACvE,QAAQ,CAA0B;IAClC,8BAA8B,CAAU;IAE3D,qHAAqH;IAC3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,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;;;;;OAUG;IACO,QAAQ,CAAC,OAAc,EAAE,OAAc;QAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC;QAClC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,gBAAgB,CAAC,KAAK;aACvB,IAAI,CAAC,GAAG,EAAE,CACR,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QAC/D,CAAC,CAAC,CACJ;aACA,KAAK,CAAC,GAAG,CAAC,EAAE;YACV,MAAM,MAAM,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC/E,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uEAAuE,MAAM,EAAE,CAAC,CAAC;QACtG,CAAC,CAAC,CAAC;IACT,CAAC;CACH"}
@@ -0,0 +1,54 @@
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 MessageDefinition, type ParamsArg, type ResolvedMessage } from '@hydranium/protocol';
10
+ import type { AstNode, DiagnosticData, DiagnosticInfo, Properties, ValidationAcceptor } from '@hydranium/langium';
11
+ import { Diagnostic } from 'vscode-languageserver-protocol';
12
+ /**
13
+ * Raise a validation diagnostic from a declaration, so the call site never
14
+ * restates the code or the sentence.
15
+ *
16
+ * `code` is omitted from `info` because this owns it — the framework claims LSP
17
+ * `Diagnostic.code` for framework codes, which collides with no adopter today
18
+ * and is a stated rule rather than an accident. `data` is deliberately NOT
19
+ * omitted: Langium owns `data.code` for code-action dispatch, so a caller has to
20
+ * be able to request a quick fix. The identity is merged OVER whatever they
21
+ * pass, which makes the two conventions co-exist rather than compete.
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
+ *
30
+ * The identity lands in both `code` and `data.hydranium` on purpose. `code` is
31
+ * what survives to the editor surface; Theia's converter drops `data` before the
32
+ * squiggle, so a parameterised diagnostic falls back to the server's English
33
+ * there while any adopter-owned surface can still render the parameterised form
34
+ * from the marker store.
35
+ *
36
+ * `DiagnosticInfo` must be Langium's own type: a `Parameters<ValidationAcceptor>[2]`
37
+ * shortcut compiles but loses the `property?: Properties<N>` relation. The `data`
38
+ * re-type has to be an intersection rather than an `Omit` alone, because Langium
39
+ * declares `data?: unknown` and an `unknown` cannot be spread.
40
+ */
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'> & {
42
+ data?: Partial<DiagnosticData> & Record<string, unknown>;
43
+ }, ...params: ParamsArg<S>): void;
44
+ /**
45
+ * Recover the identity from a published diagnostic, for a surface that
46
+ * identifies or renders diagnostics itself.
47
+ *
48
+ * `Diagnostic.message` is `string | MarkupContent` in LSP 3.17+, so the text
49
+ * comes from upstream's own `Diagnostic.getMessageString` rather than a
50
+ * hand-rolled narrowing — consuming the library in its style, and one fewer
51
+ * place restating the union.
52
+ */
53
+ export declare function resolvedFromDiagnostic(diagnostic: Diagnostic): ResolvedMessage | undefined;
54
+ //# sourceMappingURL=carriers.d.ts.map
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
@@ -0,0 +1,62 @@
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 { hasMessageIdentity, messageData } from '@hydranium/protocol';
10
+ import { Diagnostic } from 'vscode-languageserver-protocol';
11
+ /**
12
+ * Raise a validation diagnostic from a declaration, so the call site never
13
+ * restates the code or the sentence.
14
+ *
15
+ * `code` is omitted from `info` because this owns it — the framework claims LSP
16
+ * `Diagnostic.code` for framework codes, which collides with no adopter today
17
+ * and is a stated rule rather than an accident. `data` is deliberately NOT
18
+ * omitted: Langium owns `data.code` for code-action dispatch, so a caller has to
19
+ * be able to request a quick fix. The identity is merged OVER whatever they
20
+ * pass, which makes the two conventions co-exist rather than compete.
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
+ *
29
+ * The identity lands in both `code` and `data.hydranium` on purpose. `code` is
30
+ * what survives to the editor surface; Theia's converter drops `data` before the
31
+ * squiggle, so a parameterised diagnostic falls back to the server's English
32
+ * there while any adopter-owned surface can still render the parameterised form
33
+ * from the marker store.
34
+ *
35
+ * `DiagnosticInfo` must be Langium's own type: a `Parameters<ValidationAcceptor>[2]`
36
+ * shortcut compiles but loses the `property?: Properties<N>` relation. The `data`
37
+ * re-type has to be an intersection rather than an `Omit` alone, because Langium
38
+ * declares `data?: unknown` and an `unknown` cannot be spread.
39
+ */
40
+ export function acceptMessage(accept, severity, message, info, ...params) {
41
+ const data = {
42
+ ...info.data,
43
+ ...messageData(message, ...params)
44
+ };
45
+ accept(severity, message.format(...params), { ...info, code: message.code, data });
46
+ }
47
+ /**
48
+ * Recover the identity from a published diagnostic, for a surface that
49
+ * identifies or renders diagnostics itself.
50
+ *
51
+ * `Diagnostic.message` is `string | MarkupContent` in LSP 3.17+, so the text
52
+ * comes from upstream's own `Diagnostic.getMessageString` rather than a
53
+ * hand-rolled narrowing — consuming the library in its style, and one fewer
54
+ * place restating the union.
55
+ */
56
+ export function resolvedFromDiagnostic(diagnostic) {
57
+ if (!hasMessageIdentity(diagnostic.data)) {
58
+ return undefined;
59
+ }
60
+ return { ...diagnostic.data.hydranium, text: Diagnostic.getMessageString(diagnostic) };
61
+ }
62
+ //# sourceMappingURL=carriers.js.map
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
@@ -0,0 +1,25 @@
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
+ * Every user-facing message `@hydranium/core` raises, plus the carrier helpers
11
+ * that attach an identity to one.
12
+ *
13
+ * Declarations stay beside their call sites and are re-exported here, so this is
14
+ * enumeration rather than centralization: a code's package segment has to name
15
+ * the package that raises it. The English is a fallback, not a contract; the
16
+ * code is the contract, and renaming one is a breaking change.
17
+ */
18
+ export * from './carriers.js';
19
+ export * from './renderer.js';
20
+ export { MODEL_UPDATE_EDIT } from '../langium/model-service/model-service.js';
21
+ export { SEPARATOR_IN_NAME } from '../langium/naming/name-separator-validation.js';
22
+ export { LEXING_ERROR, UNRESOLVED_REFERENCE } from '../langium/validation/document-validator.js';
23
+ export { NO_LOADABLE_CONTENT } from '../langium/workspace/langium-documents.js';
24
+ export { NO_SUCH_FILE, NO_SUCH_PATH } from '../langium/workspace/in-memory-file-system-provider.js';
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,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"}
@@ -0,0 +1,25 @@
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
+ * Every user-facing message `@hydranium/core` raises, plus the carrier helpers
11
+ * that attach an identity to one.
12
+ *
13
+ * Declarations stay beside their call sites and are re-exported here, so this is
14
+ * enumeration rather than centralization: a code's package segment has to name
15
+ * the package that raises it. The English is a fallback, not a contract; the
16
+ * code is the contract, and renaming one is a breaking change.
17
+ */
18
+ export * from './carriers.js';
19
+ export * from './renderer.js';
20
+ export { MODEL_UPDATE_EDIT } from '../langium/model-service/model-service.js';
21
+ export { SEPARATOR_IN_NAME } from '../langium/naming/name-separator-validation.js';
22
+ export { LEXING_ERROR, UNRESOLVED_REFERENCE } from '../langium/validation/document-validator.js';
23
+ export { NO_LOADABLE_CONTENT } from '../langium/workspace/langium-documents.js';
24
+ export { NO_SUCH_FILE, NO_SUCH_PATH } from '../langium/workspace/in-memory-file-system-provider.js';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,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"}
@@ -0,0 +1,136 @@
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 MessageDefinition, type ParamsArg, type ResolvedMessage, type Tracer } from '@hydranium/protocol';
10
+ import { SimpleCache } from '@hydranium/langium';
11
+ import type { ResponseError } from 'vscode-jsonrpc';
12
+ import { Diagnostic } from 'vscode-languageserver-protocol';
13
+ import { type LogNameOptions } from '../langium/diagnostics/logger.js';
14
+ import type { ServerSharedServicesMinimal } from '../langium/shared-services.js';
15
+ import type { ServerLocale } from '../locale/server-locale.js';
16
+ /** Construction options for {@link DefaultMessageRenderer}. */
17
+ export type MessageRendererOptions = LogNameOptions;
18
+ /**
19
+ * The render contract the `MessageRenderer` slot holds, implemented by
20
+ * {@link DefaultMessageRenderer}.
21
+ *
22
+ * An interface rather than the class, so the slot is compared STRUCTURALLY. A
23
+ * class-typed slot carries its `protected` members into every assignability
24
+ * check and TypeScript compares those nominally — which makes the slot
25
+ * unsatisfiable by a subclass declared against a second physical copy of this
26
+ * package, the state a pre-publish `yalc` / `file:` install produces. It also
27
+ * lets an adopter REPLACE this declaration rather than intersect with it, so
28
+ * slot resolution does not depend on the order a services type is written in.
29
+ *
30
+ * Every method carries a no-throw contract; see the implementation.
31
+ */
32
+ export interface MessageRenderer {
33
+ renderDiagnostic(diagnostic: Diagnostic): string;
34
+ renderError(error: ResponseError<unknown>): string;
35
+ renderMessage<S extends string>(message: MessageDefinition<S>, ...params: ParamsArg<S>): string;
36
+ }
37
+ /**
38
+ * Renders every user-facing message the server sends, in the locale the server
39
+ * was handed at init. The framework ships no catalogue, so its own behaviour is
40
+ * a pass-through.
41
+ *
42
+ * Adopters override {@link translationsFor}: the public render methods carry
43
+ * the no-throw contract, and the catalogue lookup they wrap is what can fail.
44
+ *
45
+ * Two render methods rather than one, because what is useful to an adopter is
46
+ * the carrier's structured fields and the two carriers have different ones. A
47
+ * single `render(text)` would force an adopter to match English prose, which
48
+ * breaks on the first Langium reword.
49
+ */
50
+ export declare class DefaultMessageRenderer implements MessageRenderer {
51
+ protected readonly tracer: Tracer;
52
+ protected readonly serverLocale: ServerLocale;
53
+ /**
54
+ * {@link translationsFor}'s answer per locale, `undefined` answers included —
55
+ * a `SimpleCache` distinguishes "absent" from "cached as none", which matters
56
+ * because shipping no catalogue is the framework's own hot path.
57
+ *
58
+ * `SimpleCache` rather than Langium's `WorkspaceCache`: the eviction axis
59
+ * there is document change, and a catalogue does not depend on documents, so
60
+ * it would evict on every build AND put a `DocumentBuilder` dependency on a
61
+ * service the shared tier declares free of one. Nothing evicts this: the
62
+ * locale arrives once per process. A subclass whose catalogue can change
63
+ * clears it.
64
+ */
65
+ protected readonly catalogues: SimpleCache<string | undefined, Record<string, string> | undefined>;
66
+ constructor(services: ServerSharedServicesMinimal, options?: MessageRendererOptions);
67
+ /**
68
+ * The sentence to publish for `diagnostic`, replacing its current `message`.
69
+ * Sees lexer and parser errors too, which Langium pushes onto the document
70
+ * without routing them through `toDiagnostic`.
71
+ *
72
+ * **Must not throw**, which is why the guard is here and not at the call
73
+ * site: this runs inside the `Validated` phase, and Langium's
74
+ * `notifyDocumentPhase` rethrows anything that is not a cancellation — so an
75
+ * escaping error leaves the document AT `Validated` with the phase's
76
+ * listeners never run, and the client receives no diagnostics for that file.
77
+ * A subclass overriding this method takes that contract on itself.
78
+ */
79
+ renderDiagnostic(diagnostic: Diagnostic): string;
80
+ /**
81
+ * The sentence to send for `error`, replacing its current `message`. Same
82
+ * no-throw contract as {@link renderDiagnostic}: an escaping error replaces a
83
+ * typed rejection the caller can handle with one it cannot.
84
+ */
85
+ renderError(error: ResponseError<unknown>): string;
86
+ /**
87
+ * The sentence for a declaration the caller holds directly, for a carrier
88
+ * with no slot to put an identity in.
89
+ *
90
+ * GLSP's action protocol is the case: every member of its message, status
91
+ * and reject actions is prose or an enum, so a code cannot travel and the
92
+ * raise site is the last place that still knows which message this is.
93
+ * Prefer {@link renderDiagnostic} / {@link renderError} wherever a carrier
94
+ * does hold the identity — they keep the render off the raise site, so an
95
+ * adopter's own messages ride the same one binding.
96
+ *
97
+ * Same no-throw contract as the carrier methods.
98
+ */
99
+ renderMessage<S extends string>(message: MessageDefinition<S>, ...params: ParamsArg<S>): string;
100
+ /**
101
+ * The catalogue for the current locale, or `undefined` for none — the
102
+ * framework's answer, shipping none. Overriding this leaves every identity
103
+ * decision, every pass-through and the no-throw guard in place.
104
+ *
105
+ * **Called once per locale, not once per message**, so an override may load
106
+ * a file or build a map without that cost landing per diagnostic. The
107
+ * corollary is that a catalogue mutated in place afterwards is not seen;
108
+ * clear {@link catalogues} to invalidate.
109
+ *
110
+ * An adopter wanting Langium's own uncoded sentences instead matches
111
+ * `Diagnostic.data.code` from an overridden {@link renderDiagnostic}, never
112
+ * the sentence.
113
+ */
114
+ protected translationsFor(_locale: string | undefined): Record<string, string> | undefined;
115
+ /**
116
+ * Resolve one identity against the current locale's catalogue.
117
+ *
118
+ * Reads the locale per call. Copying it into a field at construction pins
119
+ * whatever was there before init ran, which is always `undefined` — services
120
+ * compose first.
121
+ *
122
+ * The catalogue behind it is memoized, because a workspace-wide validation
123
+ * renders once per diagnostic and the naive override — parse a JSON file,
124
+ * build a map — then pays that per diagnostic rather than per locale.
125
+ */
126
+ protected render(message: ResolvedMessage): string;
127
+ /**
128
+ * Emit a failed render. Logged rather than swallowed: the fallback output is
129
+ * byte-identical to a correctly-configured default, so a throwing catalogue
130
+ * is otherwise invisible.
131
+ */
132
+ protected reportFailure(err: unknown, carrier: string): void;
133
+ /** Format the failed-render line. Override to name the adopter's catalogue entry. */
134
+ protected formatRenderFailure(err: unknown, carrier: string): string;
135
+ }
136
+ //# sourceMappingURL=renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src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,EAAE,UAAU,GAAG,MAAM;IAUhD;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM;IAUlD;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM;IAkB/F;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;IAI1F;;;;;;;;;;OAUG;IACH,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM;IAQlD;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAI5D,qFAAqF;IACrF,SAAS,CAAC,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;CAGtE"}
@@ -0,0 +1,159 @@
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 { describeError, renderFrameworkMessage, resolve, resolvedFromResponseError } from '@hydranium/protocol';
10
+ import { SimpleCache } from '@hydranium/langium';
11
+ import { Diagnostic } from 'vscode-languageserver-protocol';
12
+ import { resolvedFromDiagnostic } from './carriers.js';
13
+ /**
14
+ * Renders every user-facing message the server sends, in the locale the server
15
+ * was handed at init. The framework ships no catalogue, so its own behaviour is
16
+ * a pass-through.
17
+ *
18
+ * Adopters override {@link translationsFor}: the public render methods carry
19
+ * the no-throw contract, and the catalogue lookup they wrap is what can fail.
20
+ *
21
+ * Two render methods rather than one, because what is useful to an adopter is
22
+ * the carrier's structured fields and the two carriers have different ones. A
23
+ * single `render(text)` would force an adopter to match English prose, which
24
+ * breaks on the first Langium reword.
25
+ */
26
+ export class DefaultMessageRenderer {
27
+ tracer;
28
+ serverLocale;
29
+ /**
30
+ * {@link translationsFor}'s answer per locale, `undefined` answers included —
31
+ * a `SimpleCache` distinguishes "absent" from "cached as none", which matters
32
+ * because shipping no catalogue is the framework's own hot path.
33
+ *
34
+ * `SimpleCache` rather than Langium's `WorkspaceCache`: the eviction axis
35
+ * there is document change, and a catalogue does not depend on documents, so
36
+ * it would evict on every build AND put a `DocumentBuilder` dependency on a
37
+ * service the shared tier declares free of one. Nothing evicts this: the
38
+ * locale arrives once per process. A subclass whose catalogue can change
39
+ * clears it.
40
+ */
41
+ catalogues = new SimpleCache();
42
+ constructor(services, options = {}) {
43
+ this.serverLocale = services.ServerLocale;
44
+ this.tracer = services.Tracer.for(options.logName ?? 'MessageRenderer').trace('instantiated');
45
+ }
46
+ /**
47
+ * The sentence to publish for `diagnostic`, replacing its current `message`.
48
+ * Sees lexer and parser errors too, which Langium pushes onto the document
49
+ * without routing them through `toDiagnostic`.
50
+ *
51
+ * **Must not throw**, which is why the guard is here and not at the call
52
+ * site: this runs inside the `Validated` phase, and Langium's
53
+ * `notifyDocumentPhase` rethrows anything that is not a cancellation — so an
54
+ * escaping error leaves the document AT `Validated` with the phase's
55
+ * listeners never run, and the client receives no diagnostics for that file.
56
+ * A subclass overriding this method takes that contract on itself.
57
+ */
58
+ renderDiagnostic(diagnostic) {
59
+ try {
60
+ const resolved = resolvedFromDiagnostic(diagnostic);
61
+ return resolved ? this.render(resolved) : Diagnostic.getMessageString(diagnostic);
62
+ }
63
+ catch (err) {
64
+ this.reportFailure(err, 'a diagnostic');
65
+ return Diagnostic.getMessageString(diagnostic);
66
+ }
67
+ }
68
+ /**
69
+ * The sentence to send for `error`, replacing its current `message`. Same
70
+ * no-throw contract as {@link renderDiagnostic}: an escaping error replaces a
71
+ * typed rejection the caller can handle with one it cannot.
72
+ */
73
+ renderError(error) {
74
+ try {
75
+ const resolved = resolvedFromResponseError(error);
76
+ return resolved ? this.render(resolved) : error.message;
77
+ }
78
+ catch (err) {
79
+ this.reportFailure(err, 'an RPC error');
80
+ return error.message;
81
+ }
82
+ }
83
+ /**
84
+ * The sentence for a declaration the caller holds directly, for a carrier
85
+ * with no slot to put an identity in.
86
+ *
87
+ * GLSP's action protocol is the case: every member of its message, status
88
+ * and reject actions is prose or an enum, so a code cannot travel and the
89
+ * raise site is the last place that still knows which message this is.
90
+ * Prefer {@link renderDiagnostic} / {@link renderError} wherever a carrier
91
+ * does hold the identity — they keep the render off the raise site, so an
92
+ * adopter's own messages ride the same one binding.
93
+ *
94
+ * Same no-throw contract as the carrier methods.
95
+ */
96
+ renderMessage(message, ...params) {
97
+ // `resolve` is inside the guard with the render, not before it: it calls
98
+ // the declaration's own `format`, which for an adopter declaration is
99
+ // arbitrary code, and a throw there would escape a method whose contract
100
+ // says it cannot.
101
+ let resolved;
102
+ try {
103
+ resolved = resolve(message, ...params);
104
+ return this.render(resolved);
105
+ }
106
+ catch (err) {
107
+ this.reportFailure(err, `the message '${message.code}'`);
108
+ // Unset only when `format` ITSELF threw, which leaves the
109
+ // uninterpolated template as the only text there is. A failed render
110
+ // still has the resolved English.
111
+ return resolved?.text ?? message.text;
112
+ }
113
+ }
114
+ /**
115
+ * The catalogue for the current locale, or `undefined` for none — the
116
+ * framework's answer, shipping none. Overriding this leaves every identity
117
+ * decision, every pass-through and the no-throw guard in place.
118
+ *
119
+ * **Called once per locale, not once per message**, so an override may load
120
+ * a file or build a map without that cost landing per diagnostic. The
121
+ * corollary is that a catalogue mutated in place afterwards is not seen;
122
+ * clear {@link catalogues} to invalidate.
123
+ *
124
+ * An adopter wanting Langium's own uncoded sentences instead matches
125
+ * `Diagnostic.data.code` from an overridden {@link renderDiagnostic}, never
126
+ * the sentence.
127
+ */
128
+ translationsFor(_locale) {
129
+ return undefined;
130
+ }
131
+ /**
132
+ * Resolve one identity against the current locale's catalogue.
133
+ *
134
+ * Reads the locale per call. Copying it into a field at construction pins
135
+ * whatever was there before init ran, which is always `undefined` — services
136
+ * compose first.
137
+ *
138
+ * The catalogue behind it is memoized, because a workspace-wide validation
139
+ * renders once per diagnostic and the naive override — parse a JSON file,
140
+ * build a map — then pays that per diagnostic rather than per locale.
141
+ */
142
+ render(message) {
143
+ const locale = this.serverLocale.value;
144
+ return renderFrameworkMessage(message, this.catalogues.get(locale, () => this.translationsFor(locale)));
145
+ }
146
+ /**
147
+ * Emit a failed render. Logged rather than swallowed: the fallback output is
148
+ * byte-identical to a correctly-configured default, so a throwing catalogue
149
+ * is otherwise invisible.
150
+ */
151
+ reportFailure(err, carrier) {
152
+ this.tracer.error(this.formatRenderFailure(err, carrier));
153
+ }
154
+ /** Format the failed-render line. Override to name the adopter's catalogue entry. */
155
+ formatRenderFailure(err, carrier) {
156
+ return `rendering ${carrier} failed; falling back to the server's own text. ${describeError(err)}`;
157
+ }
158
+ }
159
+ //# sourceMappingURL=renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../src/messages/renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,aAAa,EACb,sBAAsB,EACtB,OAAO,EACP,yBAAyB,EAK3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAI5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAyBvD;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,sBAAsB;IACb,MAAM,CAAS;IACf,YAAY,CAAe;IAC9C;;;;;;;;;;;OAWG;IACgB,UAAU,GAAG,IAAI,WAAW,EAA0D,CAAC;IAE1G,YAAY,QAAqC,EAAE,UAAkC,EAAE;QACp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,OAAO,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;YACvC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACrB,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,gBAAgB,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;YACzD,0DAA0D;YAC1D,qEAAqE;YACrE,kCAAkC;YAClC,OAAO,QAAQ,EAAE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;QACzC,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;OAaG;IACO,eAAe,CAAC,OAA2B;QAClD,OAAO,SAAS,CAAC;IACpB,CAAC;IAED;;;;;;;;;;OAUG;IACO,MAAM,CAAC,OAAwB;QACtC,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;QACvC,OAAO,sBAAsB,CAC1B,OAAO,EACP,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CACjE,CAAC;IACL,CAAC;IAED;;;;OAIG;IACO,aAAa,CAAC,GAAY,EAAE,OAAe;QAClD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,qFAAqF;IAC3E,mBAAmB,CAAC,GAAY,EAAE,OAAe;QACxD,OAAO,aAAa,OAAO,mDAAmD,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;IACtG,CAAC;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"node-file-system-provider.d.ts","sourceRoot":"","sources":["../../src/node/node-file-system-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,GAAG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from '@hydranium/langium/node';
11
11
  import { randomUUID } from 'node:crypto';
12
12
  import { realpathSync } from 'node:fs';
13
13
  import * as fsp from 'node:fs/promises';
14
+ import { renameOverOpenReaders } from './rename-over-open-readers.js';
14
15
  import { serverSharedFactory } from '../langium/shared-services.js';
15
16
  import { serveVirtualDocument } from '../langium/workspace/virtual-document.js';
16
17
  /**
@@ -173,46 +174,6 @@ async function replacedFile(path) {
173
174
  return undefined;
174
175
  }
175
176
  }
176
- /**
177
- * Errno values a rename reports on Windows when another handle holds the
178
- * destination open. POSIX renames are unaffected by open handles, so this
179
- * cannot fire there and the retry below costs nothing.
180
- */
181
- const RENAME_CONTENTION_CODES = new Set(['EPERM', 'EACCES', 'EBUSY']);
182
- /**
183
- * `rename` the staged content over `destination`, retrying while Windows
184
- * reports the destination as held open.
185
- *
186
- * The staging file exists so a reader never sees a half-written file, and on
187
- * Windows the very presence of that reader is what makes the replacing rename
188
- * fail — so the indivisible write breaks under exactly the contention it was
189
- * built for, and it breaks intermittently, which is worse than never working.
190
- * A reader's handle is released in milliseconds, so waiting turns a spurious
191
- * failure into a slightly later success.
192
- *
193
- * BOUNDED, not open-ended: a genuine permission fault raises the same errno and
194
- * is distinguishable from contention only by never clearing, so an unbounded
195
- * wait would convert a hard error into a hang. Exhausting the budget rethrows
196
- * the last failure, leaving the caller's cleanup and error contract unchanged.
197
- */
198
- async function renameOverOpenReaders(staging, destination) {
199
- const deadline = Date.now() + 2_000;
200
- for (let attempt = 0;; attempt++) {
201
- try {
202
- await fsp.rename(staging, destination);
203
- return;
204
- }
205
- catch (err) {
206
- const code = err instanceof Error && 'code' in err ? String(err.code) : undefined;
207
- if (code === undefined || !RENAME_CONTENTION_CODES.has(code) || Date.now() >= deadline) {
208
- throw err;
209
- }
210
- // Backs off to keep a long contention window from spinning, capped so
211
- // a late attempt still lands promptly once the handle is released.
212
- await new Promise(resolve => setTimeout(resolve, Math.min(2 ** attempt, 50)));
213
- }
214
- }
215
- }
216
177
  /**
217
178
  * Module fragment that binds the writable Node {@link DefaultFileSystemProvider},
218
179
  * spread into the services context on a Node host.
@@ -1 +1 @@
1
- {"version":3,"file":"node-file-system-provider.js","sourceRoot":"","sources":["../../src/node/node-file-system-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAIxC,OAAO,EAAE,mBAAmB,EAAoC,MAAM,+BAA+B,CAAC;AACtG,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,yBAA0B,SAAQ,sBAAsB;IAK5C;IAJb,gBAAgB,CAAmB;IACzB,MAAM,CAAS;IAElC,YACsB,QAAqC,EACxD,UAA0B,EAAE;QAE5B,KAAK,EAAE,CAAC;QAHW,aAAQ,GAAR,QAAQ,CAA6B;QAIxD,IAAI,CAAC,gBAAgB,GAAG,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC;QAC5D,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,4EAA4E;IAC5E,6EAA6E;IACpE,QAAQ,CAAC,GAAQ;QACvB,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QACxD,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAA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