@hydranium/core 1.0.0-next.9 → 1.0.0-next.90

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 (316) hide show
  1. package/lib/documents/ast-document-manager.d.ts +75 -16
  2. package/lib/documents/ast-document-manager.d.ts.map +1 -1
  3. package/lib/documents/ast-document-manager.js +57 -19
  4. package/lib/documents/ast-document-manager.js.map +1 -1
  5. package/lib/documents/client-ids.d.ts +5 -19
  6. package/lib/documents/client-ids.d.ts.map +1 -1
  7. package/lib/documents/client-ids.js +5 -19
  8. package/lib/documents/client-ids.js.map +1 -1
  9. package/lib/documents/hydranium-text-documents.d.ts +55 -21
  10. package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
  11. package/lib/documents/hydranium-text-documents.js +142 -46
  12. package/lib/documents/hydranium-text-documents.js.map +1 -1
  13. package/lib/documents/language-client-text-shadow.d.ts +41 -9
  14. package/lib/documents/language-client-text-shadow.d.ts.map +1 -1
  15. package/lib/documents/language-client-text-shadow.js +56 -11
  16. package/lib/documents/language-client-text-shadow.js.map +1 -1
  17. package/lib/documents/self-save-registry.d.ts +37 -6
  18. package/lib/documents/self-save-registry.d.ts.map +1 -1
  19. package/lib/documents/self-save-registry.js +28 -15
  20. package/lib/documents/self-save-registry.js.map +1 -1
  21. package/lib/index.d.ts +2 -0
  22. package/lib/index.d.ts.map +1 -1
  23. package/lib/index.js +5 -0
  24. package/lib/index.js.map +1 -1
  25. package/lib/langium/ast-extension/ast-node-builder.d.ts +32 -9
  26. package/lib/langium/ast-extension/ast-node-builder.d.ts.map +1 -1
  27. package/lib/langium/ast-extension/ast-node-builder.js +60 -22
  28. package/lib/langium/ast-extension/ast-node-builder.js.map +1 -1
  29. package/lib/langium/bootstrap.d.ts.map +1 -1
  30. package/lib/langium/bootstrap.js +16 -9
  31. package/lib/langium/bootstrap.js.map +1 -1
  32. package/lib/langium/config/configuration-provider.d.ts +81 -0
  33. package/lib/langium/config/configuration-provider.d.ts.map +1 -0
  34. package/lib/langium/config/configuration-provider.js +112 -0
  35. package/lib/langium/config/configuration-provider.js.map +1 -0
  36. package/lib/langium/config/index.d.ts +1 -0
  37. package/lib/langium/config/index.d.ts.map +1 -1
  38. package/lib/langium/config/index.js +1 -0
  39. package/lib/langium/config/index.js.map +1 -1
  40. package/lib/langium/diagnostics/lsp-logger.d.ts +17 -0
  41. package/lib/langium/diagnostics/lsp-logger.d.ts.map +1 -1
  42. package/lib/langium/diagnostics/lsp-logger.js +40 -6
  43. package/lib/langium/diagnostics/lsp-logger.js.map +1 -1
  44. package/lib/langium/document-builder/build-pipeline-integration.d.ts +13 -1
  45. package/lib/langium/document-builder/build-pipeline-integration.d.ts.map +1 -1
  46. package/lib/langium/document-builder/build-pipeline-integration.js +1 -1
  47. package/lib/langium/document-builder/build-pipeline-integration.js.map +1 -1
  48. package/lib/langium/document-builder/build-session.d.ts +93 -0
  49. package/lib/langium/document-builder/build-session.d.ts.map +1 -0
  50. package/lib/langium/document-builder/build-session.js +72 -0
  51. package/lib/langium/document-builder/build-session.js.map +1 -0
  52. package/lib/langium/document-builder/document-builder.d.ts +150 -7
  53. package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
  54. package/lib/langium/document-builder/document-builder.js +298 -11
  55. package/lib/langium/document-builder/document-builder.js.map +1 -1
  56. package/lib/langium/document-builder/index.d.ts +1 -0
  57. package/lib/langium/document-builder/index.d.ts.map +1 -1
  58. package/lib/langium/document-builder/index.js +1 -0
  59. package/lib/langium/document-builder/index.js.map +1 -1
  60. package/lib/langium/integration-services.d.ts +45 -1
  61. package/lib/langium/integration-services.d.ts.map +1 -1
  62. package/lib/langium/integration-services.js +10 -5
  63. package/lib/langium/integration-services.js.map +1 -1
  64. package/lib/langium/integrity/integrity-service.d.ts +5 -0
  65. package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
  66. package/lib/langium/integrity/integrity-service.js +34 -1
  67. package/lib/langium/integrity/integrity-service.js.map +1 -1
  68. package/lib/langium/keys/containment.d.ts +64 -0
  69. package/lib/langium/keys/containment.d.ts.map +1 -0
  70. package/lib/langium/keys/containment.js +53 -0
  71. package/lib/langium/keys/containment.js.map +1 -0
  72. package/lib/langium/keys/index.d.ts +1 -0
  73. package/lib/langium/keys/index.d.ts.map +1 -1
  74. package/lib/langium/keys/index.js +1 -0
  75. package/lib/langium/keys/index.js.map +1 -1
  76. package/lib/langium/keys/name-based-key-provider.d.ts +4 -0
  77. package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -1
  78. package/lib/langium/keys/name-based-key-provider.js +4 -0
  79. package/lib/langium/keys/name-based-key-provider.js.map +1 -1
  80. package/lib/langium/model-service/model-service.d.ts +149 -10
  81. package/lib/langium/model-service/model-service.d.ts.map +1 -1
  82. package/lib/langium/model-service/model-service.js +120 -93
  83. package/lib/langium/model-service/model-service.js.map +1 -1
  84. package/lib/langium/module.d.ts +84 -15
  85. package/lib/langium/module.d.ts.map +1 -1
  86. package/lib/langium/module.js +26 -12
  87. package/lib/langium/module.js.map +1 -1
  88. package/lib/langium/naming/name-provider.d.ts +25 -4
  89. package/lib/langium/naming/name-provider.d.ts.map +1 -1
  90. package/lib/langium/naming/name-provider.js +2 -1
  91. package/lib/langium/naming/name-provider.js.map +1 -1
  92. package/lib/langium/naming/name-separator-validation.d.ts +23 -0
  93. package/lib/langium/naming/name-separator-validation.d.ts.map +1 -1
  94. package/lib/langium/naming/name-separator-validation.js +30 -1
  95. package/lib/langium/naming/name-separator-validation.js.map +1 -1
  96. package/lib/langium/residency/cst-residency-service.d.ts +31 -9
  97. package/lib/langium/residency/cst-residency-service.d.ts.map +1 -1
  98. package/lib/langium/residency/cst-residency-service.js +13 -56
  99. package/lib/langium/residency/cst-residency-service.js.map +1 -1
  100. package/lib/langium/scope/hydranium-scope-provider.d.ts +32 -13
  101. package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -1
  102. package/lib/langium/scope/hydranium-scope-provider.js +37 -20
  103. package/lib/langium/scope/hydranium-scope-provider.js.map +1 -1
  104. package/lib/langium/service-registry.d.ts +5 -1
  105. package/lib/langium/service-registry.d.ts.map +1 -1
  106. package/lib/langium/service-registry.js +4 -0
  107. package/lib/langium/service-registry.js.map +1 -1
  108. package/lib/langium/shared-services.d.ts +15 -2
  109. package/lib/langium/shared-services.d.ts.map +1 -1
  110. package/lib/langium/shared-services.js.map +1 -1
  111. package/lib/langium/transfer/transfer-encoder.d.ts +60 -17
  112. package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -1
  113. package/lib/langium/transfer/transfer-encoder.js +38 -16
  114. package/lib/langium/transfer/transfer-encoder.js.map +1 -1
  115. package/lib/langium/validation/document-validator.d.ts +294 -10
  116. package/lib/langium/validation/document-validator.d.ts.map +1 -1
  117. package/lib/langium/validation/document-validator.js +448 -5
  118. package/lib/langium/validation/document-validator.js.map +1 -1
  119. package/lib/langium/workspace/document-uri-policy.d.ts +3 -4
  120. package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -1
  121. package/lib/langium/workspace/document-uri-policy.js +3 -4
  122. package/lib/langium/workspace/document-uri-policy.js.map +1 -1
  123. package/lib/langium/workspace/hydranium-langium-document-factory.d.ts +25 -0
  124. package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -1
  125. package/lib/langium/workspace/hydranium-langium-document-factory.js +25 -0
  126. package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -1
  127. package/lib/langium/workspace/hydranium-workspace-manager.d.ts +21 -1
  128. package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
  129. package/lib/langium/workspace/hydranium-workspace-manager.js +28 -0
  130. package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -1
  131. package/lib/langium/workspace/in-memory-file-system-provider.d.ts +8 -0
  132. package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
  133. package/lib/langium/workspace/in-memory-file-system-provider.js +11 -2
  134. package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
  135. package/lib/langium/workspace/initialize-workspace.d.ts +22 -2
  136. package/lib/langium/workspace/initialize-workspace.d.ts.map +1 -1
  137. package/lib/langium/workspace/initialize-workspace.js +13 -5
  138. package/lib/langium/workspace/initialize-workspace.js.map +1 -1
  139. package/lib/langium/workspace/langium-documents.d.ts +79 -17
  140. package/lib/langium/workspace/langium-documents.d.ts.map +1 -1
  141. package/lib/langium/workspace/langium-documents.js +83 -28
  142. package/lib/langium/workspace/langium-documents.js.map +1 -1
  143. package/lib/locale/index.d.ts +10 -0
  144. package/lib/locale/index.d.ts.map +1 -0
  145. package/lib/locale/index.js +10 -0
  146. package/lib/locale/index.js.map +1 -0
  147. package/lib/locale/server-locale.d.ts +73 -0
  148. package/lib/locale/server-locale.d.ts.map +1 -0
  149. package/lib/locale/server-locale.js +61 -0
  150. package/lib/locale/server-locale.js.map +1 -0
  151. package/lib/lsp/hydranium-document-update-handler.js +1 -1
  152. package/lib/lsp/hydranium-document-update-handler.js.map +1 -1
  153. package/lib/lsp/index.d.ts +1 -1
  154. package/lib/lsp/index.d.ts.map +1 -1
  155. package/lib/lsp/index.js +1 -1
  156. package/lib/lsp/index.js.map +1 -1
  157. package/lib/lsp/lsp-latency.d.ts +39 -0
  158. package/lib/lsp/lsp-latency.d.ts.map +1 -0
  159. package/lib/lsp/lsp-latency.js +58 -0
  160. package/lib/lsp/lsp-latency.js.map +1 -0
  161. package/lib/lsp/semantic-token-provider.d.ts +34 -1
  162. package/lib/lsp/semantic-token-provider.d.ts.map +1 -1
  163. package/lib/lsp/semantic-token-provider.js +55 -8
  164. package/lib/lsp/semantic-token-provider.js.map +1 -1
  165. package/lib/messages/carriers.d.ts +54 -0
  166. package/lib/messages/carriers.d.ts.map +1 -0
  167. package/lib/messages/carriers.js +62 -0
  168. package/lib/messages/carriers.js.map +1 -0
  169. package/lib/messages/index.d.ts +25 -0
  170. package/lib/messages/index.d.ts.map +1 -0
  171. package/lib/messages/index.js +25 -0
  172. package/lib/messages/index.js.map +1 -0
  173. package/lib/messages/renderer.d.ts +136 -0
  174. package/lib/messages/renderer.d.ts.map +1 -0
  175. package/lib/messages/renderer.js +159 -0
  176. package/lib/messages/renderer.js.map +1 -0
  177. package/lib/node/heap-ceiling.d.ts +61 -0
  178. package/lib/node/heap-ceiling.d.ts.map +1 -0
  179. package/lib/node/heap-ceiling.js +72 -0
  180. package/lib/node/heap-ceiling.js.map +1 -0
  181. package/lib/node/index.d.ts +1 -0
  182. package/lib/node/index.d.ts.map +1 -1
  183. package/lib/node/index.js +1 -0
  184. package/lib/node/index.js.map +1 -1
  185. package/lib/node/latency-from-env.d.ts +1 -1
  186. package/lib/node/latency-from-env.js +1 -1
  187. package/lib/node/node-file-system-provider.d.ts.map +1 -1
  188. package/lib/node/node-file-system-provider.js +1 -40
  189. package/lib/node/node-file-system-provider.js.map +1 -1
  190. package/lib/node/profiling-run.d.ts +2 -2
  191. package/lib/node/profiling-run.js +1 -1
  192. package/lib/node/profiling-run.js.map +1 -1
  193. package/lib/node/rename-over-open-readers.d.ts +52 -0
  194. package/lib/node/rename-over-open-readers.d.ts.map +1 -0
  195. package/lib/node/rename-over-open-readers.js +66 -0
  196. package/lib/node/rename-over-open-readers.js.map +1 -0
  197. package/lib/node/socket-launcher.d.ts +15 -0
  198. package/lib/node/socket-launcher.d.ts.map +1 -1
  199. package/lib/node/socket-launcher.js +3 -2
  200. package/lib/node/socket-launcher.js.map +1 -1
  201. package/lib/testing/fake-document.d.ts +16 -4
  202. package/lib/testing/fake-document.d.ts.map +1 -1
  203. package/lib/testing/fake-document.js +18 -3
  204. package/lib/testing/fake-document.js.map +1 -1
  205. package/lib/testing/make-noop-shared-services.d.ts +14 -0
  206. package/lib/testing/make-noop-shared-services.d.ts.map +1 -1
  207. package/lib/testing/make-noop-shared-services.js +28 -2
  208. package/lib/testing/make-noop-shared-services.js.map +1 -1
  209. package/lib/testing/make-test-services.d.ts +44 -8
  210. package/lib/testing/make-test-services.d.ts.map +1 -1
  211. package/lib/testing/make-test-services.js +19 -3
  212. package/lib/testing/make-test-services.js.map +1 -1
  213. package/lib/testing/node/spawned-server.d.ts +14 -0
  214. package/lib/testing/node/spawned-server.d.ts.map +1 -1
  215. package/lib/testing/node/spawned-server.js +33 -1
  216. package/lib/testing/node/spawned-server.js.map +1 -1
  217. package/lib/testing/playwright/flaky-network-proxy.d.ts +76 -0
  218. package/lib/testing/playwright/flaky-network-proxy.d.ts.map +1 -0
  219. package/lib/testing/playwright/flaky-network-proxy.js +164 -0
  220. package/lib/testing/playwright/flaky-network-proxy.js.map +1 -0
  221. package/lib/testing/playwright/index.d.ts +1 -0
  222. package/lib/testing/playwright/index.d.ts.map +1 -1
  223. package/lib/testing/playwright/index.js +1 -0
  224. package/lib/testing/playwright/index.js.map +1 -1
  225. package/lib/testing/playwright/server-log-capture.d.ts +14 -4
  226. package/lib/testing/playwright/server-log-capture.d.ts.map +1 -1
  227. package/lib/testing/playwright/server-log-capture.js +21 -4
  228. package/lib/testing/playwright/server-log-capture.js.map +1 -1
  229. package/lib/testing/playwright/server-log-rename-reporter.d.ts.map +1 -1
  230. package/lib/testing/playwright/server-log-rename-reporter.js +10 -1
  231. package/lib/testing/playwright/server-log-rename-reporter.js.map +1 -1
  232. package/lib/testing/stub-ast-document-manager.d.ts +5 -5
  233. package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
  234. package/lib/testing/stub-ast-document-manager.js +4 -6
  235. package/lib/testing/stub-ast-document-manager.js.map +1 -1
  236. package/lib/testing/stub-document-builder.d.ts +8 -0
  237. package/lib/testing/stub-document-builder.d.ts.map +1 -1
  238. package/lib/testing/stub-document-builder.js +22 -3
  239. package/lib/testing/stub-document-builder.js.map +1 -1
  240. package/lib/testing/stub-langium-documents.d.ts +3 -2
  241. package/lib/testing/stub-langium-documents.d.ts.map +1 -1
  242. package/lib/testing/stub-langium-documents.js.map +1 -1
  243. package/lib/testing/stub-model-service.d.ts +5 -4
  244. package/lib/testing/stub-model-service.d.ts.map +1 -1
  245. package/lib/testing/stub-model-service.js +2 -2
  246. package/lib/testing/stub-model-service.js.map +1 -1
  247. package/package.json +17 -8
  248. package/src/documents/ast-document-manager.ts +129 -36
  249. package/src/documents/client-ids.ts +5 -22
  250. package/src/documents/hydranium-text-documents.ts +167 -61
  251. package/src/documents/language-client-text-shadow.ts +59 -11
  252. package/src/documents/self-save-registry.ts +52 -13
  253. package/src/index.ts +5 -0
  254. package/src/langium/ast-extension/ast-node-builder.ts +66 -22
  255. package/src/langium/bootstrap.ts +16 -9
  256. package/src/langium/config/configuration-provider.ts +119 -0
  257. package/src/langium/config/index.ts +1 -0
  258. package/src/langium/diagnostics/lsp-logger.ts +41 -6
  259. package/src/langium/document-builder/build-pipeline-integration.ts +14 -1
  260. package/src/langium/document-builder/build-session.ts +87 -0
  261. package/src/langium/document-builder/document-builder.ts +339 -11
  262. package/src/langium/document-builder/index.ts +1 -0
  263. package/src/langium/integration-services.ts +67 -6
  264. package/src/langium/integrity/integrity-service.ts +35 -1
  265. package/src/langium/keys/containment.ts +87 -0
  266. package/src/langium/keys/index.ts +1 -0
  267. package/src/langium/keys/name-based-key-provider.ts +4 -0
  268. package/src/langium/model-service/model-service.ts +211 -30
  269. package/src/langium/module.ts +106 -21
  270. package/src/langium/naming/name-provider.ts +27 -5
  271. package/src/langium/naming/name-separator-validation.ts +34 -5
  272. package/src/langium/residency/cst-residency-service.ts +36 -12
  273. package/src/langium/scope/hydranium-scope-provider.ts +40 -22
  274. package/src/langium/service-registry.ts +6 -2
  275. package/src/langium/shared-services.ts +19 -2
  276. package/src/langium/transfer/transfer-encoder.ts +85 -24
  277. package/src/langium/validation/document-validator.ts +537 -11
  278. package/src/langium/workspace/document-uri-policy.ts +3 -4
  279. package/src/langium/workspace/hydranium-langium-document-factory.ts +34 -0
  280. package/src/langium/workspace/hydranium-workspace-manager.ts +30 -1
  281. package/src/langium/workspace/in-memory-file-system-provider.ts +13 -3
  282. package/src/langium/workspace/initialize-workspace.ts +34 -5
  283. package/src/langium/workspace/langium-documents.ts +106 -33
  284. package/src/locale/index.ts +10 -0
  285. package/src/locale/server-locale.ts +86 -0
  286. package/src/lsp/hydranium-document-update-handler.ts +1 -1
  287. package/src/lsp/index.ts +1 -1
  288. package/src/lsp/lsp-latency.ts +62 -0
  289. package/src/lsp/semantic-token-provider.ts +74 -7
  290. package/src/messages/carriers.ts +78 -0
  291. package/src/messages/index.ts +36 -0
  292. package/src/messages/renderer.ts +204 -0
  293. package/src/node/heap-ceiling.ts +108 -0
  294. package/src/node/index.ts +1 -0
  295. package/src/node/latency-from-env.ts +1 -1
  296. package/src/node/node-file-system-provider.ts +1 -41
  297. package/src/node/profiling-run.ts +3 -3
  298. package/src/node/rename-over-open-readers.ts +78 -0
  299. package/src/node/socket-launcher.ts +18 -2
  300. package/src/testing/fake-document.ts +24 -5
  301. package/src/testing/make-noop-shared-services.ts +50 -2
  302. package/src/testing/make-test-services.ts +73 -18
  303. package/src/testing/node/spawned-server.ts +35 -1
  304. package/src/testing/playwright/flaky-network-proxy.ts +240 -0
  305. package/src/testing/playwright/index.ts +1 -0
  306. package/src/testing/playwright/server-log-capture.ts +24 -5
  307. package/src/testing/playwright/server-log-rename-reporter.ts +12 -1
  308. package/src/testing/stub-ast-document-manager.ts +10 -14
  309. package/src/testing/stub-document-builder.ts +32 -3
  310. package/src/testing/stub-langium-documents.ts +3 -2
  311. package/src/testing/stub-model-service.ts +7 -6
  312. package/lib/lsp/instrument-connection.d.ts +0 -36
  313. package/lib/lsp/instrument-connection.d.ts.map +0 -1
  314. package/lib/lsp/instrument-connection.js +0 -62
  315. package/lib/lsp/instrument-connection.js.map +0 -1
  316. package/src/lsp/instrument-connection.ts +0 -66
@@ -6,17 +6,160 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { ObservableValue, TransferDiagnostic } from '@hydranium/protocol';
10
- import { DefaultDocumentValidator } from '@hydranium/langium';
9
+ import { defineMessage, describeError, interpolate, messageData, ObservableValue, TransferDiagnostic } from '@hydranium/protocol';
10
+ import { DefaultDocumentValidator, DocumentValidator } from '@hydranium/langium';
11
+ // A VALUE import, for `Diagnostic.getMessageString`: `message` is
12
+ // `string | MarkupContent` in LSP 3.17+, so upstream's own reader is what
13
+ // narrows it rather than a hand-rolled union check here.
14
+ import { Diagnostic } from 'vscode-languageserver-types';
11
15
  import { isSyntheticNode } from '../workspace/synthetic.js';
12
16
  import { isVirtualUri } from '../workspace/virtual-document.js';
17
+ /**
18
+ * A reference resolved to nothing.
19
+ *
20
+ * **The English is byte-identical to Langium's `DefaultLinker.createLinkingError`
21
+ * sentence, and must stay so.** The identity is attached to a diagnostic Langium
22
+ * already worded, so a divergence here would silently change the text every
23
+ * adopter without a catalogue sees. {@link HydraniumDocumentValidator.processLinkingErrors}
24
+ * attaches it only when the two match exactly, which is also what keeps an
25
+ * adopter's own reworded linking error from being mislabelled as this one.
26
+ *
27
+ * It exists because this is the most-seen validation error in any language built
28
+ * on the framework, and Langium puts its own code in `data.code` rather than on
29
+ * `Diagnostic.code` — so without a framework identity every adopter wanting to
30
+ * render it has to special-case Langium's shape.
31
+ */
32
+ export const UNRESOLVED_REFERENCE = defineMessage('hydranium/core/unresolved-reference', "Could not resolve reference to {referenceType} named '{refText}'.");
33
+ /**
34
+ * A character no token of the grammar can start with.
35
+ *
36
+ * **The English is byte-identical to CHEVROTAIN's
37
+ * `defaultLexerErrorProvider.buildUnexpectedCharactersMessage`, and must stay
38
+ * so** — one layer further out than {@link UNRESOLVED_REFERENCE}, whose sentence
39
+ * is Langium's. Langium words neither: `processLexingErrors` copies
40
+ * `lexerDiagnostic.message` through untouched, so the text an adopter sees today
41
+ * is produced two dependencies down and is the only thing this identity may
42
+ * claim to be. {@link HydraniumDocumentValidator.identifyLexingError} attaches
43
+ * it only when the two match exactly, which is also what keeps a custom lexer's
44
+ * own diagnostics — Langium admits any of them through `lexerReport` — from
45
+ * being mislabelled as this one.
46
+ *
47
+ * It exists because a lexing error is the FIRST message a user of a new language
48
+ * sees and the one an adopter cannot reach: every other diagnostic worth
49
+ * translating either carries an identity already or is raised by adopter code,
50
+ * while this one arrives with a Langium `data.code` naming a KIND and no
51
+ * parameters at all — so a catalogue had nothing to key on and nothing to
52
+ * interpolate.
53
+ *
54
+ * `skipped` rather than `length`, matching what the sentence says the number
55
+ * means: chevrotain reports how many characters the lexer discarded to recover,
56
+ * which for a single stray character is one and for a run of them is the run.
57
+ */
58
+ export const UNEXPECTED_CHARACTER = defineMessage('hydranium/core/unexpected-character', 'unexpected character: ->{character}<- at offset: {offset}, skipped {skipped} characters.');
59
+ /**
60
+ * A token the grammar does not admit at this position.
61
+ *
62
+ * **The English is byte-identical to Langium's
63
+ * `LangiumParserErrorMessageProvider.buildMismatchTokenMessage`, and must stay
64
+ * so**, on the same rule as {@link UNRESOLVED_REFERENCE}.
65
+ *
66
+ * `expected` is a token type name, which is grammar vocabulary rather than
67
+ * translatable text — only the frame around it is. Promoting it into the code
68
+ * instead would make the catalogue as large as the grammar.
69
+ */
70
+ export const UNEXPECTED_TOKEN = defineMessage('hydranium/core/unexpected-token', "Expecting token of type '{expected}' but found `{found}`.");
71
+ /**
72
+ * Input left over once the entry rule had matched.
73
+ *
74
+ * **The English is byte-identical to Langium's
75
+ * `LangiumParserErrorMessageProvider.buildNotAllInputParsedMessage`, and must
76
+ * stay so.**
77
+ */
78
+ export const TRAILING_INPUT = defineMessage('hydranium/core/trailing-input', 'Expecting end of file but found `{found}`.');
79
+ /**
80
+ * A mode-popping token reached with nothing on the lexer's mode stack.
81
+ *
82
+ * **The English is byte-identical to CHEVROTAIN's
83
+ * `defaultLexerErrorProvider.buildUnableToPopLexerModeMessage`, and must stay
84
+ * so**, the closing clause running on without punctuation exactly as upstream
85
+ * writes it.
86
+ *
87
+ * Reachable only from a multi-mode lexer, which a grammar opts into through a
88
+ * custom token builder.
89
+ */
90
+ export const UNPOPPABLE_LEXER_MODE = defineMessage('hydranium/core/unpoppable-lexer-mode', 'Unable to pop Lexer Mode after encountering Token ->{image}<- The Mode Stack is empty');
91
+ /**
92
+ * A dedent that lines up with no enclosing indentation level.
93
+ *
94
+ * **The English is byte-identical to LANGIUM's `IndentationAwareTokenBuilder`,
95
+ * and must stay so** — the one lexing sentence Langium words itself rather than
96
+ * relaying from chevrotain, which is why it renders through no
97
+ * `ILexerErrorMessageProvider` and an adopter cannot reach it by replacing one.
98
+ *
99
+ * `stack` is the indentation stack as the template literal upstream stringifies
100
+ * it, comma-joined: structure would have to survive {@link MessageParams}, which
101
+ * holds scalars, and a translation has nothing to say about the numbers anyway.
102
+ */
103
+ export const INVALID_DEDENT = defineMessage('hydranium/core/invalid-dedent', 'Invalid dedent level {level} at offset: {offset}. Current indentation stack: {stack}');
104
+ /**
105
+ * A position where none of a rule's alternatives can start.
106
+ *
107
+ * **The English is byte-identical to CHEVROTAIN's
108
+ * `defaultParserErrorProvider.buildNoViableAltMessage`, and must stay so** —
109
+ * one layer further out than {@link UNEXPECTED_TOKEN}, because Langium overrides
110
+ * only two of the four parser sentences and passes this one straight through.
111
+ *
112
+ * `sequences` is the token-sequence list chevrotain generated, carried whole
113
+ * rather than as structure: {@link MessageParams} holds scalars, and the list is
114
+ * token names in any case, so only the frame around it is translatable.
115
+ */
116
+ export const NO_VIABLE_ALTERNATIVE = defineMessage('hydranium/core/no-viable-alternative', "Expecting: one of these possible Token sequences:\n{sequences}\nbut found: '{found}'");
117
+ /**
118
+ * A repetition that had to match at least once and matched nothing.
119
+ *
120
+ * **The English is byte-identical to CHEVROTAIN's
121
+ * `defaultParserErrorProvider.buildEarlyExitMessage`, and must stay so**,
122
+ * including the doubled colon after `sequences::`, which is upstream's and not a
123
+ * typo to repair here — a divergence would silently stop the identity attaching.
124
+ *
125
+ * Named for the empty repetition rather than for chevrotain's `EarlyExit`, which
126
+ * describes its own control flow rather than the reader's problem.
127
+ */
128
+ export const MISSING_ITERATION = defineMessage('hydranium/core/missing-iteration', "Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <{sequences}>\nbut found: '{found}'");
129
+ /**
130
+ * The two sentences whose only free parameter is a generated list, in the order
131
+ * {@link HydraniumDocumentValidator.identifyParsingError} tries them. Order is
132
+ * free: their frames share a prefix but diverge before the list begins, so at
133
+ * most one can match.
134
+ */
135
+ const SEQUENCE_LISTING_MESSAGES = [NO_VIABLE_ALTERNATIVE, MISSING_ITERATION];
136
+ /**
137
+ * Splits a template into alternating frame and placeholder NAME, for
138
+ * {@link HydraniumDocumentValidator.sliceFramed}. The capturing group is what
139
+ * keeps the names in the result rather than discarding them.
140
+ */
141
+ const PLACEHOLDER_CAPTURE = /\{([^}]+)\}/;
142
+ /**
143
+ * Langium's own `data.code` values for a diagnostic that came out of the lexer.
144
+ *
145
+ * All four severities, not just the error one: `lexerReport` admits warnings and
146
+ * below, and a token builder that downgrades a stray character still produces
147
+ * the same sentence. Gating on the error code alone would leave the identity off
148
+ * a message that is word-for-word the one it names.
149
+ */
150
+ const LEXING_CODES = new Set([
151
+ DocumentValidator.LexingError,
152
+ DocumentValidator.LexingWarning,
153
+ DocumentValidator.LexingInfo,
154
+ DocumentValidator.LexingHint
155
+ ]);
13
156
  /**
14
157
  * Default validator behaviour for `@hydranium/core` consumers:
15
158
  *
16
159
  * - **Skip-validation hook** via the virtual {@link shouldSkipValidation}
17
160
  * predicate, which adopters override to compose additional skip reasons.
18
161
  * - **Diagnostic mapping** to {@link TransferDiagnostic}-shaped
19
- * {@link TransferLspDiagnostic}: every emitted diagnostic carries the AST
162
+ * {@link AstDiagnostic}: every emitted diagnostic carries the AST
20
163
  * node's path (built via Langium's `AstNodeLocator`) plus the optional
21
164
  * offending property name.
22
165
  * - **Optional timing wrap** on `validateDocument`, on by default.
@@ -24,6 +167,13 @@ import { isVirtualUri } from '../workspace/virtual-document.js';
24
167
  export class HydraniumDocumentValidator extends DefaultDocumentValidator {
25
168
  tracer;
26
169
  astNodeLocator;
170
+ reflection;
171
+ lexer;
172
+ /**
173
+ * {@link tokenTypeNames}' answer. Nothing invalidates it: the vocabulary
174
+ * comes from the grammar, which is fixed once the DI tree is composed.
175
+ */
176
+ expectedNames;
27
177
  logLevel;
28
178
  logAfterMs;
29
179
  validateVirtualDocuments;
@@ -32,6 +182,8 @@ export class HydraniumDocumentValidator extends DefaultDocumentValidator {
32
182
  super(services);
33
183
  this.tracer = services.shared.Tracer.for(options.logName ?? 'DocumentValidator').trace('instantiated');
34
184
  this.astNodeLocator = services.workspace.AstNodeLocator;
185
+ this.reflection = services.shared.AstReflection;
186
+ this.lexer = services.parser.Lexer;
35
187
  this.logLevel = ObservableValue.from(options.logLevel ?? 'debug');
36
188
  this.logAfterMs = ObservableValue.from(options.logAfterMs ?? 20);
37
189
  this.validateVirtualDocuments = ObservableValue.from(options.validateVirtualDocuments ?? false);
@@ -48,15 +200,224 @@ export class HydraniumDocumentValidator extends DefaultDocumentValidator {
48
200
  }
49
201
  const level = this.logLevel.value;
50
202
  if (level === 'off') {
51
- return super.validateDocument(document, options, cancelToken);
203
+ return this.validateAndIdentify(document, options, cancelToken);
52
204
  }
53
205
  // `level` is narrowed to `LogLevel` past the early-return.
54
206
  return this.tracer
55
207
  .withUri(document.uri.toString())
56
- .time('validateDocument', () => super.validateDocument(document, options, cancelToken), level, {
208
+ .time('validateDocument', () => this.validateAndIdentify(document, options, cancelToken), level, {
57
209
  logAfterMs: this.logAfterMs.value
58
210
  });
59
211
  }
212
+ /**
213
+ * Langium's validation pass, plus the framework identity on the lexing and
214
+ * parsing diagnostics it produced.
215
+ *
216
+ * **Here rather than in an override of `processLexingErrors` /
217
+ * `processParsingErrors`, and the reason is that neither seam can see what
218
+ * the identity needs.** Langium hands them a `ParseResult`, which carries the
219
+ * AST and the error lists but not the source text — and the offending
220
+ * CHARACTER, or the offending TOKEN, is the parameter a translation exists to
221
+ * interpolate. The document does carry it, and this is the innermost point
222
+ * that still holds one.
223
+ *
224
+ * Correlating the finished diagnostics back to the `ParseResult`'s error
225
+ * lists positionally is the alternative, and it is unsound for the parsing
226
+ * half: `processParsingErrors` DROPS an error whose token offsets are `NaN`
227
+ * and whose exception carries no `previousToken`, so the two lists differ in
228
+ * length exactly when recovery has been at work.
229
+ *
230
+ * Inside the timing span rather than around it, so the line accounts for the
231
+ * whole pass.
232
+ */
233
+ async validateAndIdentify(document, options, cancelToken) {
234
+ const diagnostics = await super.validateDocument(document, options, cancelToken);
235
+ // Mapped in place over the array Langium built, rather than filtered and
236
+ // re-concatenated: the publish order is the diagnostic order and a
237
+ // reordering would move a squiggle's entry in the problems list.
238
+ // Each pass guards on its own `data.code`, so at most one can claim a
239
+ // given diagnostic and the order between them carries no meaning.
240
+ for (let index = 0; index < diagnostics.length; index++) {
241
+ diagnostics[index] = this.identifyLexingError(document, diagnostics[index]);
242
+ diagnostics[index] = this.identifyParsingError(document, diagnostics[index]);
243
+ }
244
+ return diagnostics;
245
+ }
246
+ /**
247
+ * Add whichever lexing identity renders `diagnostic`'s sentence, or return it
248
+ * untouched when none of them does — a custom lexer's own report, which
249
+ * Langium admits through `lexerReport`, being the case that reaches the end.
250
+ *
251
+ * The parameters come from the diagnostic's own RANGE, not from
252
+ * `parseResult.lexerErrors`. Both hold the same numbers, and the range is the
253
+ * one that needs no assumption about upstream: correlating the two lists
254
+ * would depend on Langium appending one diagnostic per lexer error in order,
255
+ * which is true today and is an internal of the method being wrapped.
256
+ *
257
+ * **The format-and-compare is the whole discriminator, and it validates the
258
+ * reconstruction as well as the identity.** A range that did not round-trip
259
+ * to the offset chevrotain reported would produce a different sentence and be
260
+ * declined, so a wrong parameter set can never be attached to a right-looking
261
+ * message.
262
+ */
263
+ identifyLexingError(document, diagnostic) {
264
+ const data = diagnostic.data;
265
+ if (!LEXING_CODES.has(data?.code)) {
266
+ return diagnostic;
267
+ }
268
+ const text = document.textDocument;
269
+ const message = Diagnostic.getMessageString(diagnostic);
270
+ const offset = text.offsetAt(diagnostic.range.start);
271
+ const stray = {
272
+ character: text.getText().charAt(offset),
273
+ offset,
274
+ skipped: text.offsetAt(diagnostic.range.end) - offset
275
+ };
276
+ if (message === UNEXPECTED_CHARACTER.format(stray)) {
277
+ return this.identified(diagnostic, UNEXPECTED_CHARACTER, stray);
278
+ }
279
+ // The mode-pop error's range spans the offending token exactly, upstream
280
+ // reporting its `startOffset` with the image's own length.
281
+ const image = text.getText(diagnostic.range);
282
+ if (message === UNPOPPABLE_LEXER_MODE.format({ image })) {
283
+ return this.identified(diagnostic, UNPOPPABLE_LEXER_MODE, { image });
284
+ }
285
+ // `level` and `stack` are lexer state that reaches no field here, so they
286
+ // are sliced; `offset` is given, which is what anchors the slice.
287
+ const dedent = this.sliceFramed(message, INVALID_DEDENT, { offset });
288
+ return dedent === undefined ? diagnostic : this.identified(diagnostic, INVALID_DEDENT, dedent);
289
+ }
290
+ /**
291
+ * Add whichever parser identity renders `diagnostic`'s sentence, or return it
292
+ * untouched when none of them does — an adopter that replaced the parser
293
+ * error-message provider being the case that reaches the last branch.
294
+ *
295
+ * `found` comes from the diagnostic's own RANGE, for the same reason
296
+ * {@link identifyLexingError} reads its parameters there. A token whose
297
+ * offsets chevrotain could not report collapses to a zero-width range, which
298
+ * yields the empty string the sentence already renders for it.
299
+ *
300
+ * **`expected` is recovered by SEARCHING the vocabulary, because nothing
301
+ * carries it.** Chevrotain hands the expected token type to the message
302
+ * provider and keeps it on neither the exception nor the diagnostic, so the
303
+ * only structured source left is the grammar's own vocabulary: every token
304
+ * type is offered to the same `format` the identity renders with, and the one
305
+ * that reproduces the message supplies the parameter. Matching it out of the
306
+ * prose instead would derive a parameter from a sentence that a Langium
307
+ * reword can change without warning. Two distinct names cannot render one
308
+ * sentence, so the match is unique where it exists.
309
+ */
310
+ identifyParsingError(document, diagnostic) {
311
+ const data = diagnostic.data;
312
+ if (data?.code !== DocumentValidator.ParsingError) {
313
+ return diagnostic;
314
+ }
315
+ const message = Diagnostic.getMessageString(diagnostic);
316
+ const found = document.textDocument.getText(diagnostic.range);
317
+ if (message === TRAILING_INPUT.format({ found })) {
318
+ return this.identified(diagnostic, TRAILING_INPUT, { found });
319
+ }
320
+ const expected = this.tokenTypeNames().find(name => UNEXPECTED_TOKEN.format({ expected: name, found }) === message);
321
+ if (expected !== undefined) {
322
+ return this.identified(diagnostic, UNEXPECTED_TOKEN, { expected, found });
323
+ }
324
+ for (const definition of SEQUENCE_LISTING_MESSAGES) {
325
+ const params = this.sliceFramed(message, definition, { found });
326
+ if (params !== undefined) {
327
+ return this.identified(diagnostic, definition, params);
328
+ }
329
+ }
330
+ return diagnostic;
331
+ }
332
+ /** `diagnostic` carrying `definition`'s identity, over whatever `data` it already had. */
333
+ identified(diagnostic, definition, ...params) {
334
+ // Merged OVER the existing data, so Langium's `code` survives for the
335
+ // readers that switch on it — `stopAfterParsingErrors` is one, and the
336
+ // GLSP head's read-only decision is another.
337
+ const data = diagnostic.data;
338
+ return { ...diagnostic, code: definition.code, data: { ...data, ...messageData(definition, ...params) } };
339
+ }
340
+ /**
341
+ * `definition`'s parameters as they appear in `message`, taking the ones in
342
+ * `known` as given, or `undefined` when `message` is not that sentence.
343
+ *
344
+ * **The only parameters in this file taken OUT of the prose rather than
345
+ * derived and checked against it, and the bound on that is what `known`
346
+ * is for.** A generated token-sequence list, a lexer's indentation stack: for
347
+ * these there is no finite candidate set to offer to `format` the way a token
348
+ * type name can be, and no structured field carries them. What keeps the read
349
+ * honest is that everything else in the sentence is either a fixed literal or
350
+ * a parameter the caller derived independently, so the frame either matches
351
+ * exactly or the sentence is declined.
352
+ *
353
+ * **The trailing format-and-compare is load-bearing once more than one
354
+ * parameter is unknown.** Each is captured up to the NEXT fixed separator, so
355
+ * a separator that also occurs inside a value would cut early — re-rendering
356
+ * catches that, where for a single unknown between two affixes it could not
357
+ * fail. Two adjacent placeholders are declined outright: nothing marks the
358
+ * boundary, so no capture is recoverable.
359
+ *
360
+ * The frame is split off the declaration's own `text`, so it cannot drift
361
+ * from the sentence `format` renders.
362
+ */
363
+ sliceFramed(message, definition, known) {
364
+ // `split` with a capturing group interleaves literals and placeholder
365
+ // names, so even indices are frame and odd ones are parameters.
366
+ const parts = definition.text.split(PLACEHOLDER_CAPTURE);
367
+ const params = { ...known };
368
+ let cursor = 0;
369
+ for (let index = 0; index < parts.length; index += 2) {
370
+ const literal = parts[index];
371
+ if (!message.startsWith(literal, cursor)) {
372
+ return undefined;
373
+ }
374
+ cursor += literal.length;
375
+ const name = parts[index + 1];
376
+ if (name === undefined) {
377
+ break;
378
+ }
379
+ const given = params[name];
380
+ if (given !== undefined) {
381
+ const rendered = String(given);
382
+ if (!message.startsWith(rendered, cursor)) {
383
+ return undefined;
384
+ }
385
+ cursor += rendered.length;
386
+ continue;
387
+ }
388
+ const separator = parts[index + 2];
389
+ const trailing = parts[index + 3] === undefined;
390
+ if (separator === '' && !trailing) {
391
+ return undefined;
392
+ }
393
+ const at = trailing && separator === '' ? message.length : message.indexOf(separator, cursor);
394
+ if (at < cursor) {
395
+ return undefined;
396
+ }
397
+ params[name] = message.slice(cursor, at);
398
+ cursor = at;
399
+ }
400
+ if (cursor !== message.length || interpolate(definition.text, params) !== message) {
401
+ return undefined;
402
+ }
403
+ // Narrowing only: every placeholder the template names was either given or
404
+ // captured above, which is precisely what `ParamsOf` requires.
405
+ return params;
406
+ }
407
+ /**
408
+ * Every token type name the grammar declares, as
409
+ * {@link identifyParsingError} candidates.
410
+ *
411
+ * Read off the lexer, whose `definition` the `Lexer` INTERFACE declares —
412
+ * the parser holds the same vocabulary only behind Langium's default class,
413
+ * where an adopter's replacement need not keep it. A token type the parser
414
+ * expects but the lexer does not declare yields no match, which declines the
415
+ * identity rather than attaching a wrong one.
416
+ */
417
+ tokenTypeNames() {
418
+ this.expectedNames ??= Object.keys(this.lexer.definition);
419
+ return this.expectedNames;
420
+ }
60
421
  /**
61
422
  * Skip validation for a node **and its children** when
62
423
  * {@link shouldSkipValidation} returns true.
@@ -78,6 +439,88 @@ export class HydraniumDocumentValidator extends DefaultDocumentValidator {
78
439
  shouldSkipValidation(node) {
79
440
  return !this.validateSyntheticNodes.value && isSyntheticNode(node);
80
441
  }
442
+ /**
443
+ * Langium's linking-error pass, plus the framework identity on each
444
+ * diagnostic it produced.
445
+ *
446
+ * Langium puts its own `linking-error` marker in `data.code` and leaves
447
+ * `Diagnostic.code` unset, so nothing identifies the message on a surface
448
+ * that drops `data` — which is every editor surface. This adds the framework
449
+ * identity to both `code` and `data.hydranium` while LEAVING `data.code` in
450
+ * place: `stopAfterLinkingErrors` and Langium's code-action dispatch both
451
+ * read it.
452
+ *
453
+ * **The identity is attached only when the message is the one
454
+ * {@link UNRESOLVED_REFERENCE} renders.** Two other sentences reach this
455
+ * list: the linker's exception form, raised when resolution itself throws,
456
+ * and whatever an adopter overriding `createLinkingError` chose. Labelling
457
+ * either would make a catalogue render the wrong sentence — and for the
458
+ * exception form it would discard the underlying cause. Comparing against
459
+ * the locally rendered English is what discriminates; there is no structural
460
+ * field that does.
461
+ */
462
+ processLinkingErrors(document, diagnostics, options) {
463
+ const from = diagnostics.length;
464
+ super.processLinkingErrors(document, diagnostics, options);
465
+ for (let index = from; index < diagnostics.length; index++) {
466
+ diagnostics[index] = this.identifyLinkingError(diagnostics[index]);
467
+ }
468
+ }
469
+ /**
470
+ * Add the {@link UNRESOLVED_REFERENCE} identity to one linking diagnostic,
471
+ * or return it untouched when its message is not the sentence that identity
472
+ * renders.
473
+ *
474
+ * `refText` comes from the `data` Langium populated; `referenceType` is not
475
+ * in it, so it is recovered the same way `createLinkingError` produced it —
476
+ * through the reflection, from the container type and property.
477
+ */
478
+ identifyLinkingError(diagnostic) {
479
+ const data = diagnostic.data;
480
+ if (typeof data?.refText !== 'string' || typeof data.containerType !== 'string' || typeof data.property !== 'string') {
481
+ return diagnostic;
482
+ }
483
+ const referenceType = this.referenceTypeOf(data.containerType, data.property, data.refText);
484
+ if (referenceType === undefined) {
485
+ return diagnostic;
486
+ }
487
+ const params = { referenceType, refText: data.refText };
488
+ if (diagnostic.message !== UNRESOLVED_REFERENCE.format(params)) {
489
+ return diagnostic;
490
+ }
491
+ // Merged OVER Langium's data rather than replacing it, so `data.code`
492
+ // survives for the readers that switch on it.
493
+ return { ...diagnostic, code: UNRESOLVED_REFERENCE.code, data: { ...data, ...messageData(UNRESOLVED_REFERENCE, params) } };
494
+ }
495
+ /**
496
+ * The declared target type of the reference this diagnostic came from, or
497
+ * `undefined` when the reflection cannot name one.
498
+ *
499
+ * **The lookup can throw, and that is the reason this is a method rather
500
+ * than an inline call.** `AbstractAstReflection.getReferenceType` raises on
501
+ * an unknown container `$type` and on a property that is not a reference —
502
+ * and the linking error whose type it cannot name is the one most likely to
503
+ * reach here, because `DefaultLinker` catches its OWN failed lookup and
504
+ * turns it into the exception-form message. Rethrowing would take
505
+ * `validateDocument` with it, since Langium wraps `processLinkingErrors` in
506
+ * no try: a diagnostic Langium degraded gracefully would become a failed
507
+ * build. Declining is also the right answer on the merits — a reference
508
+ * whose type cannot be named is not the message
509
+ * {@link UNRESOLVED_REFERENCE} claims.
510
+ */
511
+ referenceTypeOf(containerType, property, refText) {
512
+ try {
513
+ return this.reflection.getReferenceType({
514
+ container: { $type: containerType },
515
+ property,
516
+ reference: { $refText: refText }
517
+ });
518
+ }
519
+ catch (err) {
520
+ this.tracer.debug(`cannot name the reference type for ${containerType}.${property}: ${describeError(err)}`);
521
+ return undefined;
522
+ }
523
+ }
81
524
  toDiagnostic(severity, message, info) {
82
525
  const base = super.toDiagnostic(severity, message, info);
83
526
  const node = info.node;
@@ -1 +1 @@
1
- {"version":3,"file":"document-validator.js","sourceRoot":"","sources":["../../../src/langium/validation/document-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAgD,eAAe,EAAe,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACrI,OAAO,EAGJ,wBAAwB,EAO1B,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AA4ChE;;;;;;;;;;GAUG;AACH,MAAM,OAAO,0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AG,QAAQ,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAChF,CAAC;CACH"}
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,WAAW,EAKX,eAAe,EAEf,kBAAkB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAIJ,wBAAwB,EAExB,iBAAiB,EAOnB,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;AA+BhE;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAC9C,qCAAqC,EACrC,mEAAmE,CACrE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAC9C,qCAAqC,EACrC,0FAA0F,CAC5F,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC1C,iCAAiC,EACjC,2DAA2D,CAC7D,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC,+BAA+B,EAAE,4CAA4C,CAAC,CAAC;AAE3H;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAC/C,sCAAsC,EACtC,uFAAuF,CACzF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CACxC,+BAA+B,EAC/B,sFAAsF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,IAAI,CAAC,CAAC;QACtD,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IACrE,CAAC;IAED;;;;;;;;;;OAUG;IACO,gBAAgB,CAAoB,IAAO,EAAE,IAA+B;QACnF,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC5D,MAAM,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,IAAK,EAAE,KAAK,EAAE,OAAO,EAAc,CAAC,CAAC;QACtI,MAAM,QAAQ,GAAG,UAAU,IAAI,aAAa,CAAC;QAC7C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;YAC9F,OAAO,EAAE,CAAC;QACb,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;YAC/G,OAAO,QAAQ,CAAC;QACnB,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ;YACjB,CAAC,CAAC,GAAG,QAAQ,GAAG,kBAAkB,CAAC,yBAAyB,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,IAAI,CAAC,KAAK,EAAE;YACxI,CAAC,CAAC,GAAG,QAAQ,GAAG,kBAAkB,CAAC,uBAAuB,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAChF,CAAC;CACH"}
@@ -91,10 +91,9 @@ export declare class DefaultDocumentUriPolicy implements DocumentUriPolicy {
91
91
  /**
92
92
  * No filesystem access, so existence cannot be checked — every URI is
93
93
  * treated as loadable and returned unchanged. A later load that misses
94
- * therefore reaches the filesystem and throws, which
95
- * `AbstractHydraniumLangiumDocuments.getOrCreateDocument` absorbs into its
96
- * empty-document fallback: under this policy that fallback, not this method,
97
- * is what makes a missing file a placeholder rather than an error.
94
+ * therefore reaches the filesystem and throws, which reports the miss with
95
+ * the reason the read failed. Under a policy that CAN check, the miss is
96
+ * caught earlier and reported without one.
98
97
  */
99
98
  loadUri(uri: URI | string): URI | undefined;
100
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"document-uri-policy.d.ts","sourceRoot":"","sources":["../../../src/langium/workspace/document-uri-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACvC,QAAQ,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC;CACvC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,EAAE,EAAE,EAAE,yBAAyB,GAAG,GAAG,GAAG,SAAS,CAIxG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,WAAW,iBAAiB;IAC/B,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,YAAY,CAAC;IAC9C;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,GAAG,GAAG,SAAS,CAAC;CAC9C;AAED;;;;;GAKG;AACH,qBAAa,wBAAyB,YAAW,iBAAiB;IAC/D,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,YAAY;IAM7C;;;;;;;OAOG;I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wBAAyB,YAAW,iBAAiB;IAC/D,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,YAAY;IAM7C;;;;;;OAMG;IACH,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,GAAG,GAAG,SAAS;CAG7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,qBAAa,yBAA0B,SAAQ,wBAAwB;IACpE,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,yBAAyB,CAAC;gBAErC,QAAQ,EAAE,2BAA2B;IAKxC,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,YAAY;IAQ7C,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,GAAG,GAAG,SAAS;CAStD"}
@@ -42,10 +42,9 @@ export class DefaultDocumentUriPolicy {
42
42
  /**
43
43
  * No filesystem access, so existence cannot be checked — every URI is
44
44
  * treated as loadable and returned unchanged. A later load that misses
45
- * therefore reaches the filesystem and throws, which
46
- * `AbstractHydraniumLangiumDocuments.getOrCreateDocument` absorbs into its
47
- * empty-document fallback: under this policy that fallback, not this method,
48
- * is what makes a missing file a placeholder rather than an error.
45
+ * therefore reaches the filesystem and throws, which reports the miss with
46
+ * the reason the read failed. Under a policy that CAN check, the miss is
47
+ * caught earlier and reported without one.
49
48
  */
50
49
  loadUri(uri) {
51
50
  return UriUtils.toUri(uri);
@@ -1 +1 @@
1
- {"version":3,"file":"document-uri-policy.js","sourceRoot":"","sources":["../../../src/langium/workspace/document-uri-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAqB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAY,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAexD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAiB,EAAE,EAA6B;IACpF,MAAM,MAAM,GAAG,QAA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B,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,OAAO,yBAA0B,SAAQ,wBAAwB;IACjD,EAAE,CAA4B;IAEjD,YAAY,QAAqC;QAC9C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,SAAS,CAAC,kBAAkB,CAAC;IACnD,CAAC;IAEQ,YAAY,CAAC,GAAiB;QACpC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,MAAM,IAAI,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC;QAClD,yEAAyE;QACzE,uEAAuE;QACvE,OAAO,IAAI,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACpF,CAAC;IAEQ,OAAO,CAAC,GAAiB;QAC/B,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;QACD,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,kEAAkE;QAClE,yEAAyE;QACzE,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACrD,CAAC;CACH"}
@@ -7,6 +7,7 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  import { type AstNode, DefaultLangiumDocumentFactory, type LangiumDocument, type URI } from '@hydranium/langium';
10
+ import { type ExtendedServiceRegistry } from '../service-registry.js';
10
11
  /**
11
12
  * Framework `LangiumDocumentFactory` that fills in the one thing Langium
12
13
  * leaves empty for a code-built document: its text.
@@ -34,6 +35,30 @@ import { type AstNode, DefaultLangiumDocumentFactory, type LangiumDocument, type
34
35
  * node identity is preserved.
35
36
  */
36
37
  export declare class HydraniumLangiumDocumentFactory extends DefaultLangiumDocumentFactory {
38
+ /**
39
+ * Narrows the inherited Langium `ServiceRegistry` field to the framework's
40
+ * {@link ExtendedServiceRegistry}, so the by-id lookup below needs no
41
+ * per-callsite cast. The framework's shared module binds that class.
42
+ */
43
+ protected readonly serviceRegistry: ExtendedServiceRegistry;
44
+ /**
45
+ * Parse `text` for `uri` under the grammar `languageId` names, instead of
46
+ * the one `uri` routes to.
47
+ *
48
+ * For a URI that routes to no grammar at all: a directory, or any other URI
49
+ * that names no file and so carries no extension. Langium's ladder ends at
50
+ * the extension, so it reports `no services for the extension ''` from
51
+ * inside the parse — naming neither the URI nor the caller that could have
52
+ * said which grammar it meant.
53
+ *
54
+ * The caller supplies the language because nothing else can. A URI with no
55
+ * extension carries no routing signal, and choosing on its behalf would be a
56
+ * guess the moment a second grammar is registered — which is why this takes
57
+ * the id rather than falling back to a sole registered language.
58
+ *
59
+ * @throws when `languageId` names no registered grammar.
60
+ */
61
+ fromStringInLanguage<T extends AstNode = AstNode>(text: string, uri: URI, languageId: string): LangiumDocument<T>;
37
62
  fromModel<T extends AstNode = AstNode>(model: T, uri: URI): LangiumDocument<T>;
38
63
  /**
39
64
  * Serialize `model` via the per-language serializer, or `undefined` if none
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-langium-document-factory.d.ts","sourceRoot":"","sources":["../../../src/langium/workspace/hydranium-langium-document-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,OAAO,EAEZ,6BAA6B,EAC7B,KAAK,eAAe,EAEpB,KAAK,GAAG,EACV,MAAM,oBAAoB,CAAC;AAQ5B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,+BAAgC,SAAQ,6BAA6B;IACtE,SAAS,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC;IAYvF;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS;CASxE"}
1
+ {"version":3,"file":"hydranium-langium-document-factory.d.ts","sourceRoot":"","sources":["../../../src/langium/workspace/hydranium-langium-document-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,OAAO,EAEZ,6BAA6B,EAC7B,KAAK,eAAe,EAEpB,KAAK,GAAG,EACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAQtE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBAAa,+BAAgC,SAAQ,6BAA6B;IAC/E;;;;OAIG;IACH,mBAA2B,eAAe,EAAE,uBAAuB,CAAC;IAEpE;;;;;;;;;;;;;;;;OAgBG;IACH,oBAAoB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC;IASxG,SAAS,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,eAAe,CAAC,CAAC,CAAC;IAYvF;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,SAAS;CASxE"}