@hydranium/core 1.0.0-next.10

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 (868) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +100 -0
  3. package/lib/documents/ast-document-manager.d.ts +243 -0
  4. package/lib/documents/ast-document-manager.d.ts.map +1 -0
  5. package/lib/documents/ast-document-manager.js +302 -0
  6. package/lib/documents/ast-document-manager.js.map +1 -0
  7. package/lib/documents/client-ids.d.ts +30 -0
  8. package/lib/documents/client-ids.d.ts.map +1 -0
  9. package/lib/documents/client-ids.js +30 -0
  10. package/lib/documents/client-ids.js.map +1 -0
  11. package/lib/documents/hydranium-text-documents.d.ts +490 -0
  12. package/lib/documents/hydranium-text-documents.d.ts.map +1 -0
  13. package/lib/documents/hydranium-text-documents.js +893 -0
  14. package/lib/documents/hydranium-text-documents.js.map +1 -0
  15. package/lib/documents/index.d.ts +14 -0
  16. package/lib/documents/index.d.ts.map +1 -0
  17. package/lib/documents/index.js +14 -0
  18. package/lib/documents/index.js.map +1 -0
  19. package/lib/documents/language-client-text-shadow.d.ts +101 -0
  20. package/lib/documents/language-client-text-shadow.d.ts.map +1 -0
  21. package/lib/documents/language-client-text-shadow.js +156 -0
  22. package/lib/documents/language-client-text-shadow.js.map +1 -0
  23. package/lib/documents/self-save-registry.d.ts +55 -0
  24. package/lib/documents/self-save-registry.d.ts.map +1 -0
  25. package/lib/documents/self-save-registry.js +68 -0
  26. package/lib/documents/self-save-registry.js.map +1 -0
  27. package/lib/index.d.ts +38 -0
  28. package/lib/index.d.ts.map +1 -0
  29. package/lib/index.js +39 -0
  30. package/lib/index.js.map +1 -0
  31. package/lib/langium/ast-extension/ast-extension-contribution.d.ts +33 -0
  32. package/lib/langium/ast-extension/ast-extension-contribution.d.ts.map +1 -0
  33. package/lib/langium/ast-extension/ast-extension-contribution.js +10 -0
  34. package/lib/langium/ast-extension/ast-extension-contribution.js.map +1 -0
  35. package/lib/langium/ast-extension/ast-extension-service.d.ts +212 -0
  36. package/lib/langium/ast-extension/ast-extension-service.d.ts.map +1 -0
  37. package/lib/langium/ast-extension/ast-extension-service.js +181 -0
  38. package/lib/langium/ast-extension/ast-extension-service.js.map +1 -0
  39. package/lib/langium/ast-extension/ast-node-builder.d.ts +90 -0
  40. package/lib/langium/ast-extension/ast-node-builder.d.ts.map +1 -0
  41. package/lib/langium/ast-extension/ast-node-builder.js +61 -0
  42. package/lib/langium/ast-extension/ast-node-builder.js.map +1 -0
  43. package/lib/langium/ast-extension/index.d.ts +12 -0
  44. package/lib/langium/ast-extension/index.d.ts.map +1 -0
  45. package/lib/langium/ast-extension/index.js +12 -0
  46. package/lib/langium/ast-extension/index.js.map +1 -0
  47. package/lib/langium/bootstrap.d.ts +224 -0
  48. package/lib/langium/bootstrap.d.ts.map +1 -0
  49. package/lib/langium/bootstrap.js +512 -0
  50. package/lib/langium/bootstrap.js.map +1 -0
  51. package/lib/langium/build-phase-pass/build-phase-pass-service.d.ts +77 -0
  52. package/lib/langium/build-phase-pass/build-phase-pass-service.d.ts.map +1 -0
  53. package/lib/langium/build-phase-pass/build-phase-pass-service.js +102 -0
  54. package/lib/langium/build-phase-pass/build-phase-pass-service.js.map +1 -0
  55. package/lib/langium/build-phase-pass/build-phase-pass.d.ts +106 -0
  56. package/lib/langium/build-phase-pass/build-phase-pass.d.ts.map +1 -0
  57. package/lib/langium/build-phase-pass/build-phase-pass.js +43 -0
  58. package/lib/langium/build-phase-pass/build-phase-pass.js.map +1 -0
  59. package/lib/langium/build-phase-pass/index.d.ts +11 -0
  60. package/lib/langium/build-phase-pass/index.d.ts.map +1 -0
  61. package/lib/langium/build-phase-pass/index.js +11 -0
  62. package/lib/langium/build-phase-pass/index.js.map +1 -0
  63. package/lib/langium/config/index.d.ts +10 -0
  64. package/lib/langium/config/index.d.ts.map +1 -0
  65. package/lib/langium/config/index.js +10 -0
  66. package/lib/langium/config/index.js.map +1 -0
  67. package/lib/langium/config/settings.d.ts +173 -0
  68. package/lib/langium/config/settings.d.ts.map +1 -0
  69. package/lib/langium/config/settings.js +196 -0
  70. package/lib/langium/config/settings.js.map +1 -0
  71. package/lib/langium/diagnostics/hydranium-langium-profiler.d.ts +109 -0
  72. package/lib/langium/diagnostics/hydranium-langium-profiler.d.ts.map +1 -0
  73. package/lib/langium/diagnostics/hydranium-langium-profiler.js +153 -0
  74. package/lib/langium/diagnostics/hydranium-langium-profiler.js.map +1 -0
  75. package/lib/langium/diagnostics/index.d.ts +14 -0
  76. package/lib/langium/diagnostics/index.d.ts.map +1 -0
  77. package/lib/langium/diagnostics/index.js +19 -0
  78. package/lib/langium/diagnostics/index.js.map +1 -0
  79. package/lib/langium/diagnostics/log-file-token.d.ts +16 -0
  80. package/lib/langium/diagnostics/log-file-token.d.ts.map +1 -0
  81. package/lib/langium/diagnostics/log-file-token.js +25 -0
  82. package/lib/langium/diagnostics/log-file-token.js.map +1 -0
  83. package/lib/langium/diagnostics/log-preamble.d.ts +42 -0
  84. package/lib/langium/diagnostics/log-preamble.d.ts.map +1 -0
  85. package/lib/langium/diagnostics/log-preamble.js +57 -0
  86. package/lib/langium/diagnostics/log-preamble.js.map +1 -0
  87. package/lib/langium/diagnostics/logger.d.ts +104 -0
  88. package/lib/langium/diagnostics/logger.d.ts.map +1 -0
  89. package/lib/langium/diagnostics/logger.js +178 -0
  90. package/lib/langium/diagnostics/logger.js.map +1 -0
  91. package/lib/langium/diagnostics/lsp-logger.d.ts +76 -0
  92. package/lib/langium/diagnostics/lsp-logger.d.ts.map +1 -0
  93. package/lib/langium/diagnostics/lsp-logger.js +223 -0
  94. package/lib/langium/diagnostics/lsp-logger.js.map +1 -0
  95. package/lib/langium/diagnostics/server-tracer.d.ts +27 -0
  96. package/lib/langium/diagnostics/server-tracer.d.ts.map +1 -0
  97. package/lib/langium/diagnostics/server-tracer.js +66 -0
  98. package/lib/langium/diagnostics/server-tracer.js.map +1 -0
  99. package/lib/langium/document-builder/build-pipeline-integration.d.ts +88 -0
  100. package/lib/langium/document-builder/build-pipeline-integration.d.ts.map +1 -0
  101. package/lib/langium/document-builder/build-pipeline-integration.js +151 -0
  102. package/lib/langium/document-builder/build-pipeline-integration.js.map +1 -0
  103. package/lib/langium/document-builder/document-builder.d.ts +405 -0
  104. package/lib/langium/document-builder/document-builder.d.ts.map +1 -0
  105. package/lib/langium/document-builder/document-builder.js +729 -0
  106. package/lib/langium/document-builder/document-builder.js.map +1 -0
  107. package/lib/langium/document-builder/index.d.ts +12 -0
  108. package/lib/langium/document-builder/index.d.ts.map +1 -0
  109. package/lib/langium/document-builder/index.js +12 -0
  110. package/lib/langium/document-builder/index.js.map +1 -0
  111. package/lib/langium/document-builder/labeled-phase-listener.d.ts +21 -0
  112. package/lib/langium/document-builder/labeled-phase-listener.d.ts.map +1 -0
  113. package/lib/langium/document-builder/labeled-phase-listener.js +15 -0
  114. package/lib/langium/document-builder/labeled-phase-listener.js.map +1 -0
  115. package/lib/langium/documentation/comment-provider.d.ts +31 -0
  116. package/lib/langium/documentation/comment-provider.d.ts.map +1 -0
  117. package/lib/langium/documentation/comment-provider.js +36 -0
  118. package/lib/langium/documentation/comment-provider.js.map +1 -0
  119. package/lib/langium/documentation/index.d.ts +10 -0
  120. package/lib/langium/documentation/index.d.ts.map +1 -0
  121. package/lib/langium/documentation/index.js +10 -0
  122. package/lib/langium/documentation/index.js.map +1 -0
  123. package/lib/langium/integration-services.d.ts +200 -0
  124. package/lib/langium/integration-services.d.ts.map +1 -0
  125. package/lib/langium/integration-services.js +65 -0
  126. package/lib/langium/integration-services.js.map +1 -0
  127. package/lib/langium/integrity/index.d.ts +12 -0
  128. package/lib/langium/integrity/index.d.ts.map +1 -0
  129. package/lib/langium/integrity/index.js +12 -0
  130. package/lib/langium/integrity/index.js.map +1 -0
  131. package/lib/langium/integrity/integrity-contribution.d.ts +42 -0
  132. package/lib/langium/integrity/integrity-contribution.d.ts.map +1 -0
  133. package/lib/langium/integrity/integrity-contribution.js +10 -0
  134. package/lib/langium/integrity/integrity-contribution.js.map +1 -0
  135. package/lib/langium/integrity/integrity-rule.d.ts +82 -0
  136. package/lib/langium/integrity/integrity-rule.d.ts.map +1 -0
  137. package/lib/langium/integrity/integrity-rule.js +52 -0
  138. package/lib/langium/integrity/integrity-rule.js.map +1 -0
  139. package/lib/langium/integrity/integrity-service.d.ts +221 -0
  140. package/lib/langium/integrity/integrity-service.d.ts.map +1 -0
  141. package/lib/langium/integrity/integrity-service.js +328 -0
  142. package/lib/langium/integrity/integrity-service.js.map +1 -0
  143. package/lib/langium/keys/default-element-key-provider.d.ts +19 -0
  144. package/lib/langium/keys/default-element-key-provider.d.ts.map +1 -0
  145. package/lib/langium/keys/default-element-key-provider.js +18 -0
  146. package/lib/langium/keys/default-element-key-provider.js.map +1 -0
  147. package/lib/langium/keys/element-key-provider.d.ts +106 -0
  148. package/lib/langium/keys/element-key-provider.d.ts.map +1 -0
  149. package/lib/langium/keys/element-key-provider.js +25 -0
  150. package/lib/langium/keys/element-key-provider.js.map +1 -0
  151. package/lib/langium/keys/index.d.ts +13 -0
  152. package/lib/langium/keys/index.d.ts.map +1 -0
  153. package/lib/langium/keys/index.js +13 -0
  154. package/lib/langium/keys/index.js.map +1 -0
  155. package/lib/langium/keys/name-based-key-provider.d.ts +99 -0
  156. package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -0
  157. package/lib/langium/keys/name-based-key-provider.js +134 -0
  158. package/lib/langium/keys/name-based-key-provider.js.map +1 -0
  159. package/lib/langium/keys/positional-key-provider.d.ts +41 -0
  160. package/lib/langium/keys/positional-key-provider.d.ts.map +1 -0
  161. package/lib/langium/keys/positional-key-provider.js +48 -0
  162. package/lib/langium/keys/positional-key-provider.js.map +1 -0
  163. package/lib/langium/labeling/index.d.ts +10 -0
  164. package/lib/langium/labeling/index.d.ts.map +1 -0
  165. package/lib/langium/labeling/index.js +10 -0
  166. package/lib/langium/labeling/index.js.map +1 -0
  167. package/lib/langium/labeling/label-provider.d.ts +79 -0
  168. package/lib/langium/labeling/label-provider.d.ts.map +1 -0
  169. package/lib/langium/labeling/label-provider.js +44 -0
  170. package/lib/langium/labeling/label-provider.js.map +1 -0
  171. package/lib/langium/language-module.d.ts +281 -0
  172. package/lib/langium/language-module.d.ts.map +1 -0
  173. package/lib/langium/language-module.js +103 -0
  174. package/lib/langium/language-module.js.map +1 -0
  175. package/lib/langium/language-types.d.ts +85 -0
  176. package/lib/langium/language-types.d.ts.map +1 -0
  177. package/lib/langium/language-types.js +173 -0
  178. package/lib/langium/language-types.js.map +1 -0
  179. package/lib/langium/model-service/index.d.ts +10 -0
  180. package/lib/langium/model-service/index.d.ts.map +1 -0
  181. package/lib/langium/model-service/index.js +10 -0
  182. package/lib/langium/model-service/index.js.map +1 -0
  183. package/lib/langium/model-service/model-service.d.ts +598 -0
  184. package/lib/langium/model-service/model-service.d.ts.map +1 -0
  185. package/lib/langium/model-service/model-service.js +889 -0
  186. package/lib/langium/model-service/model-service.js.map +1 -0
  187. package/lib/langium/module.d.ts +308 -0
  188. package/lib/langium/module.d.ts.map +1 -0
  189. package/lib/langium/module.js +165 -0
  190. package/lib/langium/module.js.map +1 -0
  191. package/lib/langium/naming/index.d.ts +11 -0
  192. package/lib/langium/naming/index.d.ts.map +1 -0
  193. package/lib/langium/naming/index.js +11 -0
  194. package/lib/langium/naming/index.js.map +1 -0
  195. package/lib/langium/naming/name-provider.d.ts +360 -0
  196. package/lib/langium/naming/name-provider.d.ts.map +1 -0
  197. package/lib/langium/naming/name-provider.js +240 -0
  198. package/lib/langium/naming/name-provider.js.map +1 -0
  199. package/lib/langium/naming/name-separator-validation.d.ts +47 -0
  200. package/lib/langium/naming/name-separator-validation.d.ts.map +1 -0
  201. package/lib/langium/naming/name-separator-validation.js +61 -0
  202. package/lib/langium/naming/name-separator-validation.js.map +1 -0
  203. package/lib/langium/project/abstract-project-manager.d.ts +242 -0
  204. package/lib/langium/project/abstract-project-manager.d.ts.map +1 -0
  205. package/lib/langium/project/abstract-project-manager.js +545 -0
  206. package/lib/langium/project/abstract-project-manager.js.map +1 -0
  207. package/lib/langium/project/index.d.ts +13 -0
  208. package/lib/langium/project/index.d.ts.map +1 -0
  209. package/lib/langium/project/index.js +13 -0
  210. package/lib/langium/project/index.js.map +1 -0
  211. package/lib/langium/project/project-change-event.d.ts +64 -0
  212. package/lib/langium/project/project-change-event.d.ts.map +1 -0
  213. package/lib/langium/project/project-change-event.js +10 -0
  214. package/lib/langium/project/project-change-event.js.map +1 -0
  215. package/lib/langium/project/project-manager.d.ts +196 -0
  216. package/lib/langium/project/project-manager.d.ts.map +1 -0
  217. package/lib/langium/project/project-manager.js +10 -0
  218. package/lib/langium/project/project-manager.js.map +1 -0
  219. package/lib/langium/project/single-project-manager.d.ts +69 -0
  220. package/lib/langium/project/single-project-manager.d.ts.map +1 -0
  221. package/lib/langium/project/single-project-manager.js +104 -0
  222. package/lib/langium/project/single-project-manager.js.map +1 -0
  223. package/lib/langium/residency/cst-residency-service.d.ts +214 -0
  224. package/lib/langium/residency/cst-residency-service.d.ts.map +1 -0
  225. package/lib/langium/residency/cst-residency-service.js +349 -0
  226. package/lib/langium/residency/cst-residency-service.js.map +1 -0
  227. package/lib/langium/residency/index.d.ts +10 -0
  228. package/lib/langium/residency/index.d.ts.map +1 -0
  229. package/lib/langium/residency/index.js +10 -0
  230. package/lib/langium/residency/index.js.map +1 -0
  231. package/lib/langium/scope/ast-node-description-provider.d.ts +122 -0
  232. package/lib/langium/scope/ast-node-description-provider.d.ts.map +1 -0
  233. package/lib/langium/scope/ast-node-description-provider.js +115 -0
  234. package/lib/langium/scope/ast-node-description-provider.js.map +1 -0
  235. package/lib/langium/scope/hydranium-scope-computation.d.ts +163 -0
  236. package/lib/langium/scope/hydranium-scope-computation.d.ts.map +1 -0
  237. package/lib/langium/scope/hydranium-scope-computation.js +220 -0
  238. package/lib/langium/scope/hydranium-scope-computation.js.map +1 -0
  239. package/lib/langium/scope/hydranium-scope-provider.d.ts +411 -0
  240. package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -0
  241. package/lib/langium/scope/hydranium-scope-provider.js +543 -0
  242. package/lib/langium/scope/hydranium-scope-provider.js.map +1 -0
  243. package/lib/langium/scope/index.d.ts +18 -0
  244. package/lib/langium/scope/index.d.ts.map +1 -0
  245. package/lib/langium/scope/index.js +18 -0
  246. package/lib/langium/scope/index.js.map +1 -0
  247. package/lib/langium/scope/reference-builder.d.ts +125 -0
  248. package/lib/langium/scope/reference-builder.d.ts.map +1 -0
  249. package/lib/langium/scope/reference-builder.js +115 -0
  250. package/lib/langium/scope/reference-builder.js.map +1 -0
  251. package/lib/langium/scope/reference-candidate-provider.d.ts +228 -0
  252. package/lib/langium/scope/reference-candidate-provider.d.ts.map +1 -0
  253. package/lib/langium/scope/reference-candidate-provider.js +185 -0
  254. package/lib/langium/scope/reference-candidate-provider.js.map +1 -0
  255. package/lib/langium/scope/scope-extension-contribution.d.ts +32 -0
  256. package/lib/langium/scope/scope-extension-contribution.d.ts.map +1 -0
  257. package/lib/langium/scope/scope-extension-contribution.js +10 -0
  258. package/lib/langium/scope/scope-extension-contribution.js.map +1 -0
  259. package/lib/langium/scope/scope-extension-service.d.ts +149 -0
  260. package/lib/langium/scope/scope-extension-service.d.ts.map +1 -0
  261. package/lib/langium/scope/scope-extension-service.js +94 -0
  262. package/lib/langium/scope/scope-extension-service.js.map +1 -0
  263. package/lib/langium/scope/scoped-ast-node-description.d.ts +160 -0
  264. package/lib/langium/scope/scoped-ast-node-description.d.ts.map +1 -0
  265. package/lib/langium/scope/scoped-ast-node-description.js +98 -0
  266. package/lib/langium/scope/scoped-ast-node-description.js.map +1 -0
  267. package/lib/langium/scope/tier-specificity.d.ts +47 -0
  268. package/lib/langium/scope/tier-specificity.d.ts.map +1 -0
  269. package/lib/langium/scope/tier-specificity.js +83 -0
  270. package/lib/langium/scope/tier-specificity.js.map +1 -0
  271. package/lib/langium/serialization/abstract-serializer.d.ts +316 -0
  272. package/lib/langium/serialization/abstract-serializer.d.ts.map +1 -0
  273. package/lib/langium/serialization/abstract-serializer.js +351 -0
  274. package/lib/langium/serialization/abstract-serializer.js.map +1 -0
  275. package/lib/langium/serialization/index.d.ts +14 -0
  276. package/lib/langium/serialization/index.d.ts.map +1 -0
  277. package/lib/langium/serialization/index.js +14 -0
  278. package/lib/langium/serialization/index.js.map +1 -0
  279. package/lib/langium/serialization/json-serializer.d.ts +106 -0
  280. package/lib/langium/serialization/json-serializer.d.ts.map +1 -0
  281. package/lib/langium/serialization/json-serializer.js +198 -0
  282. package/lib/langium/serialization/json-serializer.js.map +1 -0
  283. package/lib/langium/serialization/serialization-util.d.ts +29 -0
  284. package/lib/langium/serialization/serialization-util.d.ts.map +1 -0
  285. package/lib/langium/serialization/serialization-util.js +37 -0
  286. package/lib/langium/serialization/serialization-util.js.map +1 -0
  287. package/lib/langium/serialization/serializer.d.ts +66 -0
  288. package/lib/langium/serialization/serializer.d.ts.map +1 -0
  289. package/lib/langium/serialization/serializer.js +10 -0
  290. package/lib/langium/serialization/serializer.js.map +1 -0
  291. package/lib/langium/serialization/yaml-serializer.d.ts +166 -0
  292. package/lib/langium/serialization/yaml-serializer.d.ts.map +1 -0
  293. package/lib/langium/serialization/yaml-serializer.js +228 -0
  294. package/lib/langium/serialization/yaml-serializer.js.map +1 -0
  295. package/lib/langium/service-registry.d.ts +220 -0
  296. package/lib/langium/service-registry.d.ts.map +1 -0
  297. package/lib/langium/service-registry.js +258 -0
  298. package/lib/langium/service-registry.js.map +1 -0
  299. package/lib/langium/shared-services.d.ts +98 -0
  300. package/lib/langium/shared-services.d.ts.map +1 -0
  301. package/lib/langium/shared-services.js +30 -0
  302. package/lib/langium/shared-services.js.map +1 -0
  303. package/lib/langium/transfer/index.d.ts +10 -0
  304. package/lib/langium/transfer/index.d.ts.map +1 -0
  305. package/lib/langium/transfer/index.js +10 -0
  306. package/lib/langium/transfer/index.js.map +1 -0
  307. package/lib/langium/transfer/transfer-encoder.d.ts +294 -0
  308. package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -0
  309. package/lib/langium/transfer/transfer-encoder.js +328 -0
  310. package/lib/langium/transfer/transfer-encoder.js.map +1 -0
  311. package/lib/langium/update-rewrite/index.d.ts +14 -0
  312. package/lib/langium/update-rewrite/index.d.ts.map +1 -0
  313. package/lib/langium/update-rewrite/index.js +14 -0
  314. package/lib/langium/update-rewrite/index.js.map +1 -0
  315. package/lib/langium/update-rewrite/normalize-empty-strings.d.ts +52 -0
  316. package/lib/langium/update-rewrite/normalize-empty-strings.d.ts.map +1 -0
  317. package/lib/langium/update-rewrite/normalize-empty-strings.js +83 -0
  318. package/lib/langium/update-rewrite/normalize-empty-strings.js.map +1 -0
  319. package/lib/langium/update-rewrite/semantic-root-rewrite.d.ts +37 -0
  320. package/lib/langium/update-rewrite/semantic-root-rewrite.d.ts.map +1 -0
  321. package/lib/langium/update-rewrite/semantic-root-rewrite.js +51 -0
  322. package/lib/langium/update-rewrite/semantic-root-rewrite.js.map +1 -0
  323. package/lib/langium/update-rewrite/update-rewrite-contribution.d.ts +42 -0
  324. package/lib/langium/update-rewrite/update-rewrite-contribution.d.ts.map +1 -0
  325. package/lib/langium/update-rewrite/update-rewrite-contribution.js +10 -0
  326. package/lib/langium/update-rewrite/update-rewrite-contribution.js.map +1 -0
  327. package/lib/langium/update-rewrite/update-rewrite-service.d.ts +89 -0
  328. package/lib/langium/update-rewrite/update-rewrite-service.d.ts.map +1 -0
  329. package/lib/langium/update-rewrite/update-rewrite-service.js +75 -0
  330. package/lib/langium/update-rewrite/update-rewrite-service.js.map +1 -0
  331. package/lib/langium/update-rewrite/update-rewrite.d.ts +59 -0
  332. package/lib/langium/update-rewrite/update-rewrite.d.ts.map +1 -0
  333. package/lib/langium/update-rewrite/update-rewrite.js +10 -0
  334. package/lib/langium/update-rewrite/update-rewrite.js.map +1 -0
  335. package/lib/langium/validation/document-validator.d.ts +106 -0
  336. package/lib/langium/validation/document-validator.d.ts.map +1 -0
  337. package/lib/langium/validation/document-validator.js +118 -0
  338. package/lib/langium/validation/document-validator.js.map +1 -0
  339. package/lib/langium/validation/index.d.ts +12 -0
  340. package/lib/langium/validation/index.d.ts.map +1 -0
  341. package/lib/langium/validation/index.js +12 -0
  342. package/lib/langium/validation/index.js.map +1 -0
  343. package/lib/langium/validation/validation-contribution-collector.d.ts +34 -0
  344. package/lib/langium/validation/validation-contribution-collector.d.ts.map +1 -0
  345. package/lib/langium/validation/validation-contribution-collector.js +51 -0
  346. package/lib/langium/validation/validation-contribution-collector.js.map +1 -0
  347. package/lib/langium/validation/validation-contribution.d.ts +36 -0
  348. package/lib/langium/validation/validation-contribution.d.ts.map +1 -0
  349. package/lib/langium/validation/validation-contribution.js +10 -0
  350. package/lib/langium/validation/validation-contribution.js.map +1 -0
  351. package/lib/langium/workspace/additional-document-contribution.d.ts +68 -0
  352. package/lib/langium/workspace/additional-document-contribution.d.ts.map +1 -0
  353. package/lib/langium/workspace/additional-document-contribution.js +23 -0
  354. package/lib/langium/workspace/additional-document-contribution.js.map +1 -0
  355. package/lib/langium/workspace/document-uri-policy.d.ts +151 -0
  356. package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -0
  357. package/lib/langium/workspace/document-uri-policy.js +121 -0
  358. package/lib/langium/workspace/document-uri-policy.js.map +1 -0
  359. package/lib/langium/workspace/file-system-provider.d.ts +30 -0
  360. package/lib/langium/workspace/file-system-provider.d.ts.map +1 -0
  361. package/lib/langium/workspace/file-system-provider.js +41 -0
  362. package/lib/langium/workspace/file-system-provider.js.map +1 -0
  363. package/lib/langium/workspace/hydranium-langium-document-factory.d.ts +45 -0
  364. package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -0
  365. package/lib/langium/workspace/hydranium-langium-document-factory.js +64 -0
  366. package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -0
  367. package/lib/langium/workspace/hydranium-workspace-lock.d.ts +31 -0
  368. package/lib/langium/workspace/hydranium-workspace-lock.d.ts.map +1 -0
  369. package/lib/langium/workspace/hydranium-workspace-lock.js +33 -0
  370. package/lib/langium/workspace/hydranium-workspace-lock.js.map +1 -0
  371. package/lib/langium/workspace/hydranium-workspace-manager.d.ts +232 -0
  372. package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -0
  373. package/lib/langium/workspace/hydranium-workspace-manager.js +368 -0
  374. package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -0
  375. package/lib/langium/workspace/in-memory-file-system-provider.d.ts +127 -0
  376. package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -0
  377. package/lib/langium/workspace/in-memory-file-system-provider.js +195 -0
  378. package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -0
  379. package/lib/langium/workspace/index-manager.d.ts +142 -0
  380. package/lib/langium/workspace/index-manager.d.ts.map +1 -0
  381. package/lib/langium/workspace/index-manager.js +245 -0
  382. package/lib/langium/workspace/index-manager.js.map +1 -0
  383. package/lib/langium/workspace/index.d.ts +23 -0
  384. package/lib/langium/workspace/index.d.ts.map +1 -0
  385. package/lib/langium/workspace/index.js +23 -0
  386. package/lib/langium/workspace/index.js.map +1 -0
  387. package/lib/langium/workspace/initialize-workspace.d.ts +63 -0
  388. package/lib/langium/workspace/initialize-workspace.d.ts.map +1 -0
  389. package/lib/langium/workspace/initialize-workspace.js +88 -0
  390. package/lib/langium/workspace/initialize-workspace.js.map +1 -0
  391. package/lib/langium/workspace/langium-documents.d.ts +47 -0
  392. package/lib/langium/workspace/langium-documents.d.ts.map +1 -0
  393. package/lib/langium/workspace/langium-documents.js +85 -0
  394. package/lib/langium/workspace/langium-documents.js.map +1 -0
  395. package/lib/langium/workspace/persistent-file-system-provider.d.ts +207 -0
  396. package/lib/langium/workspace/persistent-file-system-provider.d.ts.map +1 -0
  397. package/lib/langium/workspace/persistent-file-system-provider.js +208 -0
  398. package/lib/langium/workspace/persistent-file-system-provider.js.map +1 -0
  399. package/lib/langium/workspace/synthetic.d.ts +38 -0
  400. package/lib/langium/workspace/synthetic.d.ts.map +1 -0
  401. package/lib/langium/workspace/synthetic.js +58 -0
  402. package/lib/langium/workspace/synthetic.js.map +1 -0
  403. package/lib/langium/workspace/virtual-document.d.ts +78 -0
  404. package/lib/langium/workspace/virtual-document.d.ts.map +1 -0
  405. package/lib/langium/workspace/virtual-document.js +89 -0
  406. package/lib/langium/workspace/virtual-document.js.map +1 -0
  407. package/lib/langium/workspace/write-lock-scope.d.ts +69 -0
  408. package/lib/langium/workspace/write-lock-scope.d.ts.map +1 -0
  409. package/lib/langium/workspace/write-lock-scope.js +54 -0
  410. package/lib/langium/workspace/write-lock-scope.js.map +1 -0
  411. package/lib/launcher/index.d.ts +10 -0
  412. package/lib/launcher/index.d.ts.map +1 -0
  413. package/lib/launcher/index.js +12 -0
  414. package/lib/launcher/index.js.map +1 -0
  415. package/lib/launcher/integrated-server.d.ts +28 -0
  416. package/lib/launcher/integrated-server.d.ts.map +1 -0
  417. package/lib/launcher/integrated-server.js +10 -0
  418. package/lib/launcher/integrated-server.js.map +1 -0
  419. package/lib/lsp/completion/hydranium-completion-provider.d.ts +89 -0
  420. package/lib/lsp/completion/hydranium-completion-provider.d.ts.map +1 -0
  421. package/lib/lsp/completion/hydranium-completion-provider.js +123 -0
  422. package/lib/lsp/completion/hydranium-completion-provider.js.map +1 -0
  423. package/lib/lsp/hydranium-document-update-handler.d.ts +204 -0
  424. package/lib/lsp/hydranium-document-update-handler.d.ts.map +1 -0
  425. package/lib/lsp/hydranium-document-update-handler.js +288 -0
  426. package/lib/lsp/hydranium-document-update-handler.js.map +1 -0
  427. package/lib/lsp/index.d.ts +23 -0
  428. package/lib/lsp/index.d.ts.map +1 -0
  429. package/lib/lsp/index.js +23 -0
  430. package/lib/lsp/index.js.map +1 -0
  431. package/lib/lsp/instrument-connection.d.ts +36 -0
  432. package/lib/lsp/instrument-connection.d.ts.map +1 -0
  433. package/lib/lsp/instrument-connection.js +62 -0
  434. package/lib/lsp/instrument-connection.js.map +1 -0
  435. package/lib/lsp/language-module.d.ts +53 -0
  436. package/lib/lsp/language-module.d.ts.map +1 -0
  437. package/lib/lsp/language-module.js +28 -0
  438. package/lib/lsp/language-module.js.map +1 -0
  439. package/lib/lsp/semantic-token-provider.d.ts +131 -0
  440. package/lib/lsp/semantic-token-provider.d.ts.map +1 -0
  441. package/lib/lsp/semantic-token-provider.js +148 -0
  442. package/lib/lsp/semantic-token-provider.js.map +1 -0
  443. package/lib/lsp/shared-module.d.ts +76 -0
  444. package/lib/lsp/shared-module.d.ts.map +1 -0
  445. package/lib/lsp/shared-module.js +33 -0
  446. package/lib/lsp/shared-module.js.map +1 -0
  447. package/lib/lsp/start-language-server.d.ts +43 -0
  448. package/lib/lsp/start-language-server.d.ts.map +1 -0
  449. package/lib/lsp/start-language-server.js +60 -0
  450. package/lib/lsp/start-language-server.js.map +1 -0
  451. package/lib/node/ast-ground-truth.d.ts +57 -0
  452. package/lib/node/ast-ground-truth.d.ts.map +1 -0
  453. package/lib/node/ast-ground-truth.js +46 -0
  454. package/lib/node/ast-ground-truth.js.map +1 -0
  455. package/lib/node/event-loop-monitor.d.ts +40 -0
  456. package/lib/node/event-loop-monitor.d.ts.map +1 -0
  457. package/lib/node/event-loop-monitor.js +62 -0
  458. package/lib/node/event-loop-monitor.js.map +1 -0
  459. package/lib/node/index.d.ts +29 -0
  460. package/lib/node/index.d.ts.map +1 -0
  461. package/lib/node/index.js +50 -0
  462. package/lib/node/index.js.map +1 -0
  463. package/lib/node/latency-from-env.d.ts +32 -0
  464. package/lib/node/latency-from-env.d.ts.map +1 -0
  465. package/lib/node/latency-from-env.js +36 -0
  466. package/lib/node/latency-from-env.js.map +1 -0
  467. package/lib/node/lint-grammar.d.ts +87 -0
  468. package/lib/node/lint-grammar.d.ts.map +1 -0
  469. package/lib/node/lint-grammar.js +124 -0
  470. package/lib/node/lint-grammar.js.map +1 -0
  471. package/lib/node/log-file-sink.d.ts +22 -0
  472. package/lib/node/log-file-sink.d.ts.map +1 -0
  473. package/lib/node/log-file-sink.js +43 -0
  474. package/lib/node/log-file-sink.js.map +1 -0
  475. package/lib/node/log-preamble-node.d.ts +28 -0
  476. package/lib/node/log-preamble-node.d.ts.map +1 -0
  477. package/lib/node/log-preamble-node.js +55 -0
  478. package/lib/node/log-preamble-node.js.map +1 -0
  479. package/lib/node/measure-memory.d.ts +86 -0
  480. package/lib/node/measure-memory.d.ts.map +1 -0
  481. package/lib/node/measure-memory.js +128 -0
  482. package/lib/node/measure-memory.js.map +1 -0
  483. package/lib/node/memory-monitor.d.ts +42 -0
  484. package/lib/node/memory-monitor.d.ts.map +1 -0
  485. package/lib/node/memory-monitor.js +83 -0
  486. package/lib/node/memory-monitor.js.map +1 -0
  487. package/lib/node/node-file-system-provider.d.ts +112 -0
  488. package/lib/node/node-file-system-provider.d.ts.map +1 -0
  489. package/lib/node/node-file-system-provider.js +230 -0
  490. package/lib/node/node-file-system-provider.js.map +1 -0
  491. package/lib/node/process-memory.d.ts +66 -0
  492. package/lib/node/process-memory.d.ts.map +1 -0
  493. package/lib/node/process-memory.js +252 -0
  494. package/lib/node/process-memory.js.map +1 -0
  495. package/lib/node/profile-capture.d.ts +118 -0
  496. package/lib/node/profile-capture.d.ts.map +1 -0
  497. package/lib/node/profile-capture.js +315 -0
  498. package/lib/node/profile-capture.js.map +1 -0
  499. package/lib/node/profile-digest.d.ts +49 -0
  500. package/lib/node/profile-digest.d.ts.map +1 -0
  501. package/lib/node/profile-digest.js +74 -0
  502. package/lib/node/profile-digest.js.map +1 -0
  503. package/lib/node/profiling-run.d.ts +80 -0
  504. package/lib/node/profiling-run.d.ts.map +1 -0
  505. package/lib/node/profiling-run.js +183 -0
  506. package/lib/node/profiling-run.js.map +1 -0
  507. package/lib/node/reflect-grammar.d.ts +109 -0
  508. package/lib/node/reflect-grammar.d.ts.map +1 -0
  509. package/lib/node/reflect-grammar.js +96 -0
  510. package/lib/node/reflect-grammar.js.map +1 -0
  511. package/lib/node/server-diagnostics.d.ts +43 -0
  512. package/lib/node/server-diagnostics.d.ts.map +1 -0
  513. package/lib/node/server-diagnostics.js +46 -0
  514. package/lib/node/server-diagnostics.js.map +1 -0
  515. package/lib/node/server-state-snapshot.d.ts +48 -0
  516. package/lib/node/server-state-snapshot.d.ts.map +1 -0
  517. package/lib/node/server-state-snapshot.js +139 -0
  518. package/lib/node/server-state-snapshot.js.map +1 -0
  519. package/lib/node/socket-launcher.d.ts +106 -0
  520. package/lib/node/socket-launcher.d.ts.map +1 -0
  521. package/lib/node/socket-launcher.js +138 -0
  522. package/lib/node/socket-launcher.js.map +1 -0
  523. package/lib/node/stdio-launcher.d.ts +88 -0
  524. package/lib/node/stdio-launcher.d.ts.map +1 -0
  525. package/lib/node/stdio-launcher.js +83 -0
  526. package/lib/node/stdio-launcher.js.map +1 -0
  527. package/lib/node/validate-workspace.d.ts +80 -0
  528. package/lib/node/validate-workspace.d.ts.map +1 -0
  529. package/lib/node/validate-workspace.js +72 -0
  530. package/lib/node/validate-workspace.js.map +1 -0
  531. package/lib/node/write-lock-scope-node.d.ts +27 -0
  532. package/lib/node/write-lock-scope-node.d.ts.map +1 -0
  533. package/lib/node/write-lock-scope-node.js +38 -0
  534. package/lib/node/write-lock-scope-node.js.map +1 -0
  535. package/lib/testing/ast-snapshot.d.ts +38 -0
  536. package/lib/testing/ast-snapshot.d.ts.map +1 -0
  537. package/lib/testing/ast-snapshot.js +78 -0
  538. package/lib/testing/ast-snapshot.js.map +1 -0
  539. package/lib/testing/document-uri-policy-conformance.d.ts +65 -0
  540. package/lib/testing/document-uri-policy-conformance.d.ts.map +1 -0
  541. package/lib/testing/document-uri-policy-conformance.js +69 -0
  542. package/lib/testing/document-uri-policy-conformance.js.map +1 -0
  543. package/lib/testing/fake-description.d.ts +35 -0
  544. package/lib/testing/fake-description.d.ts.map +1 -0
  545. package/lib/testing/fake-description.js +38 -0
  546. package/lib/testing/fake-description.js.map +1 -0
  547. package/lib/testing/fake-document.d.ts +71 -0
  548. package/lib/testing/fake-document.d.ts.map +1 -0
  549. package/lib/testing/fake-document.js +85 -0
  550. package/lib/testing/fake-document.js.map +1 -0
  551. package/lib/testing/fake-reflection.d.ts +29 -0
  552. package/lib/testing/fake-reflection.d.ts.map +1 -0
  553. package/lib/testing/fake-reflection.js +30 -0
  554. package/lib/testing/fake-reflection.js.map +1 -0
  555. package/lib/testing/index.d.ts +44 -0
  556. package/lib/testing/index.d.ts.map +1 -0
  557. package/lib/testing/index.js +44 -0
  558. package/lib/testing/index.js.map +1 -0
  559. package/lib/testing/langium-test-helpers.d.ts +26 -0
  560. package/lib/testing/langium-test-helpers.d.ts.map +1 -0
  561. package/lib/testing/langium-test-helpers.js +26 -0
  562. package/lib/testing/langium-test-helpers.js.map +1 -0
  563. package/lib/testing/make-noop-language-services.d.ts +39 -0
  564. package/lib/testing/make-noop-language-services.d.ts.map +1 -0
  565. package/lib/testing/make-noop-language-services.js +30 -0
  566. package/lib/testing/make-noop-language-services.js.map +1 -0
  567. package/lib/testing/make-noop-shared-services.d.ts +61 -0
  568. package/lib/testing/make-noop-shared-services.d.ts.map +1 -0
  569. package/lib/testing/make-noop-shared-services.js +49 -0
  570. package/lib/testing/make-noop-shared-services.js.map +1 -0
  571. package/lib/testing/make-test-services.d.ts +217 -0
  572. package/lib/testing/make-test-services.d.ts.map +1 -0
  573. package/lib/testing/make-test-services.js +128 -0
  574. package/lib/testing/make-test-services.js.map +1 -0
  575. package/lib/testing/make-test-tracer.d.ts +67 -0
  576. package/lib/testing/make-test-tracer.d.ts.map +1 -0
  577. package/lib/testing/make-test-tracer.js +68 -0
  578. package/lib/testing/make-test-tracer.js.map +1 -0
  579. package/lib/testing/node/generated-workspace.d.ts +95 -0
  580. package/lib/testing/node/generated-workspace.d.ts.map +1 -0
  581. package/lib/testing/node/generated-workspace.js +134 -0
  582. package/lib/testing/node/generated-workspace.js.map +1 -0
  583. package/lib/testing/node/golden-corpus.d.ts +50 -0
  584. package/lib/testing/node/golden-corpus.d.ts.map +1 -0
  585. package/lib/testing/node/golden-corpus.js +80 -0
  586. package/lib/testing/node/golden-corpus.js.map +1 -0
  587. package/lib/testing/node/index.d.ts +28 -0
  588. package/lib/testing/node/index.d.ts.map +1 -0
  589. package/lib/testing/node/index.js +28 -0
  590. package/lib/testing/node/index.js.map +1 -0
  591. package/lib/testing/node/lsp-harness.d.ts +139 -0
  592. package/lib/testing/node/lsp-harness.d.ts.map +1 -0
  593. package/lib/testing/node/lsp-harness.js +119 -0
  594. package/lib/testing/node/lsp-harness.js.map +1 -0
  595. package/lib/testing/node/lsp-server-connection.d.ts +232 -0
  596. package/lib/testing/node/lsp-server-connection.d.ts.map +1 -0
  597. package/lib/testing/node/lsp-server-connection.js +304 -0
  598. package/lib/testing/node/lsp-server-connection.js.map +1 -0
  599. package/lib/testing/node/scratch-workspace.d.ts +60 -0
  600. package/lib/testing/node/scratch-workspace.d.ts.map +1 -0
  601. package/lib/testing/node/scratch-workspace.js +87 -0
  602. package/lib/testing/node/scratch-workspace.js.map +1 -0
  603. package/lib/testing/node/spawned-server.d.ts +170 -0
  604. package/lib/testing/node/spawned-server.d.ts.map +1 -0
  605. package/lib/testing/node/spawned-server.js +265 -0
  606. package/lib/testing/node/spawned-server.js.map +1 -0
  607. package/lib/testing/parse-semantic-root.d.ts +83 -0
  608. package/lib/testing/parse-semantic-root.d.ts.map +1 -0
  609. package/lib/testing/parse-semantic-root.js +119 -0
  610. package/lib/testing/parse-semantic-root.js.map +1 -0
  611. package/lib/testing/playwright/browser-capture-bridge.d.ts +80 -0
  612. package/lib/testing/playwright/browser-capture-bridge.d.ts.map +1 -0
  613. package/lib/testing/playwright/browser-capture-bridge.js +161 -0
  614. package/lib/testing/playwright/browser-capture-bridge.js.map +1 -0
  615. package/lib/testing/playwright/e2e-profiling.d.ts +132 -0
  616. package/lib/testing/playwright/e2e-profiling.d.ts.map +1 -0
  617. package/lib/testing/playwright/e2e-profiling.js +270 -0
  618. package/lib/testing/playwright/e2e-profiling.js.map +1 -0
  619. package/lib/testing/playwright/index.d.ts +13 -0
  620. package/lib/testing/playwright/index.d.ts.map +1 -0
  621. package/lib/testing/playwright/index.js +16 -0
  622. package/lib/testing/playwright/index.js.map +1 -0
  623. package/lib/testing/playwright/server-log-capture.d.ts +230 -0
  624. package/lib/testing/playwright/server-log-capture.d.ts.map +1 -0
  625. package/lib/testing/playwright/server-log-capture.js +336 -0
  626. package/lib/testing/playwright/server-log-capture.js.map +1 -0
  627. package/lib/testing/playwright/server-log-fixture.d.ts +36 -0
  628. package/lib/testing/playwright/server-log-fixture.d.ts.map +1 -0
  629. package/lib/testing/playwright/server-log-fixture.js +38 -0
  630. package/lib/testing/playwright/server-log-fixture.js.map +1 -0
  631. package/lib/testing/playwright/server-log-rename-reporter.d.ts +22 -0
  632. package/lib/testing/playwright/server-log-rename-reporter.d.ts.map +1 -0
  633. package/lib/testing/playwright/server-log-rename-reporter.js +26 -0
  634. package/lib/testing/playwright/server-log-rename-reporter.js.map +1 -0
  635. package/lib/testing/run-update-pipeline.d.ts +99 -0
  636. package/lib/testing/run-update-pipeline.d.ts.map +1 -0
  637. package/lib/testing/run-update-pipeline.js +24 -0
  638. package/lib/testing/run-update-pipeline.js.map +1 -0
  639. package/lib/testing/stub-ast-document-manager.d.ts +82 -0
  640. package/lib/testing/stub-ast-document-manager.d.ts.map +1 -0
  641. package/lib/testing/stub-ast-document-manager.js +125 -0
  642. package/lib/testing/stub-ast-document-manager.js.map +1 -0
  643. package/lib/testing/stub-document-builder.d.ts +99 -0
  644. package/lib/testing/stub-document-builder.d.ts.map +1 -0
  645. package/lib/testing/stub-document-builder.js +142 -0
  646. package/lib/testing/stub-document-builder.js.map +1 -0
  647. package/lib/testing/stub-hydranium-text-documents.d.ts +125 -0
  648. package/lib/testing/stub-hydranium-text-documents.d.ts.map +1 -0
  649. package/lib/testing/stub-hydranium-text-documents.js +164 -0
  650. package/lib/testing/stub-hydranium-text-documents.js.map +1 -0
  651. package/lib/testing/stub-index-manager.d.ts +40 -0
  652. package/lib/testing/stub-index-manager.d.ts.map +1 -0
  653. package/lib/testing/stub-index-manager.js +38 -0
  654. package/lib/testing/stub-index-manager.js.map +1 -0
  655. package/lib/testing/stub-langium-documents.d.ts +53 -0
  656. package/lib/testing/stub-langium-documents.d.ts.map +1 -0
  657. package/lib/testing/stub-langium-documents.js +62 -0
  658. package/lib/testing/stub-langium-documents.js.map +1 -0
  659. package/lib/testing/stub-model-service.d.ts +31 -0
  660. package/lib/testing/stub-model-service.d.ts.map +1 -0
  661. package/lib/testing/stub-model-service.js +45 -0
  662. package/lib/testing/stub-model-service.js.map +1 -0
  663. package/lib/testing/stub-project-manager.d.ts +43 -0
  664. package/lib/testing/stub-project-manager.d.ts.map +1 -0
  665. package/lib/testing/stub-project-manager.js +125 -0
  666. package/lib/testing/stub-project-manager.js.map +1 -0
  667. package/lib/testing/stub-self-save-registry.d.ts +31 -0
  668. package/lib/testing/stub-self-save-registry.d.ts.map +1 -0
  669. package/lib/testing/stub-self-save-registry.js +23 -0
  670. package/lib/testing/stub-self-save-registry.js.map +1 -0
  671. package/lib/testing/stub-service-registry.d.ts +95 -0
  672. package/lib/testing/stub-service-registry.d.ts.map +1 -0
  673. package/lib/testing/stub-service-registry.js +108 -0
  674. package/lib/testing/stub-service-registry.js.map +1 -0
  675. package/lib/testing/stub-writable-file-system.d.ts +42 -0
  676. package/lib/testing/stub-writable-file-system.d.ts.map +1 -0
  677. package/lib/testing/stub-writable-file-system.js +26 -0
  678. package/lib/testing/stub-writable-file-system.js.map +1 -0
  679. package/lib/util/connection-liveness.d.ts +25 -0
  680. package/lib/util/connection-liveness.d.ts.map +1 -0
  681. package/lib/util/connection-liveness.js +46 -0
  682. package/lib/util/connection-liveness.js.map +1 -0
  683. package/lib/util/environment.d.ts +53 -0
  684. package/lib/util/environment.d.ts.map +1 -0
  685. package/lib/util/environment.js +78 -0
  686. package/lib/util/environment.js.map +1 -0
  687. package/lib/util/index.d.ts +13 -0
  688. package/lib/util/index.d.ts.map +1 -0
  689. package/lib/util/index.js +18 -0
  690. package/lib/util/index.js.map +1 -0
  691. package/lib/util/registry.d.ts +88 -0
  692. package/lib/util/registry.d.ts.map +1 -0
  693. package/lib/util/registry.js +105 -0
  694. package/lib/util/registry.js.map +1 -0
  695. package/package.json +134 -0
  696. package/src/documents/ast-document-manager.ts +455 -0
  697. package/src/documents/client-ids.ts +33 -0
  698. package/src/documents/hydranium-text-documents.ts +1142 -0
  699. package/src/documents/index.ts +14 -0
  700. package/src/documents/language-client-text-shadow.ts +175 -0
  701. package/src/documents/self-save-registry.ts +81 -0
  702. package/src/index.ts +39 -0
  703. package/src/langium/ast-extension/ast-extension-contribution.ts +35 -0
  704. package/src/langium/ast-extension/ast-extension-service.ts +311 -0
  705. package/src/langium/ast-extension/ast-node-builder.ts +125 -0
  706. package/src/langium/ast-extension/index.ts +12 -0
  707. package/src/langium/bootstrap.ts +600 -0
  708. package/src/langium/build-phase-pass/build-phase-pass-service.ts +141 -0
  709. package/src/langium/build-phase-pass/build-phase-pass.ts +123 -0
  710. package/src/langium/build-phase-pass/index.ts +11 -0
  711. package/src/langium/config/index.ts +10 -0
  712. package/src/langium/config/settings.ts +353 -0
  713. package/src/langium/diagnostics/hydranium-langium-profiler.ts +187 -0
  714. package/src/langium/diagnostics/index.ts +19 -0
  715. package/src/langium/diagnostics/log-file-token.ts +26 -0
  716. package/src/langium/diagnostics/log-preamble.ts +87 -0
  717. package/src/langium/diagnostics/logger.ts +246 -0
  718. package/src/langium/diagnostics/lsp-logger.ts +277 -0
  719. package/src/langium/diagnostics/server-tracer.ts +73 -0
  720. package/src/langium/document-builder/build-pipeline-integration.ts +193 -0
  721. package/src/langium/document-builder/document-builder.ts +839 -0
  722. package/src/langium/document-builder/index.ts +12 -0
  723. package/src/langium/document-builder/labeled-phase-listener.ts +26 -0
  724. package/src/langium/documentation/comment-provider.ts +37 -0
  725. package/src/langium/documentation/index.ts +10 -0
  726. package/src/langium/integration-services.ts +281 -0
  727. package/src/langium/integrity/index.ts +12 -0
  728. package/src/langium/integrity/integrity-contribution.ts +44 -0
  729. package/src/langium/integrity/integrity-rule.ts +100 -0
  730. package/src/langium/integrity/integrity-service.ts +423 -0
  731. package/src/langium/keys/default-element-key-provider.ts +20 -0
  732. package/src/langium/keys/element-key-provider.ts +114 -0
  733. package/src/langium/keys/index.ts +13 -0
  734. package/src/langium/keys/name-based-key-provider.ts +146 -0
  735. package/src/langium/keys/positional-key-provider.ts +57 -0
  736. package/src/langium/labeling/index.ts +10 -0
  737. package/src/langium/labeling/label-provider.ts +110 -0
  738. package/src/langium/language-module.ts +367 -0
  739. package/src/langium/language-types.ts +214 -0
  740. package/src/langium/model-service/index.ts +10 -0
  741. package/src/langium/model-service/model-service.ts +1051 -0
  742. package/src/langium/module.ts +446 -0
  743. package/src/langium/naming/index.ts +11 -0
  744. package/src/langium/naming/name-provider.ts +533 -0
  745. package/src/langium/naming/name-separator-validation.ts +73 -0
  746. package/src/langium/project/abstract-project-manager.ts +630 -0
  747. package/src/langium/project/index.ts +13 -0
  748. package/src/langium/project/project-change-event.ts +66 -0
  749. package/src/langium/project/project-manager.ts +221 -0
  750. package/src/langium/project/single-project-manager.ts +126 -0
  751. package/src/langium/residency/cst-residency-service.ts +412 -0
  752. package/src/langium/residency/index.ts +10 -0
  753. package/src/langium/scope/ast-node-description-provider.ts +141 -0
  754. package/src/langium/scope/hydranium-scope-computation.ts +246 -0
  755. package/src/langium/scope/hydranium-scope-provider.ts +659 -0
  756. package/src/langium/scope/index.ts +18 -0
  757. package/src/langium/scope/reference-builder.ts +194 -0
  758. package/src/langium/scope/reference-candidate-provider.ts +314 -0
  759. package/src/langium/scope/scope-extension-contribution.ts +34 -0
  760. package/src/langium/scope/scope-extension-service.ts +207 -0
  761. package/src/langium/scope/scoped-ast-node-description.ts +174 -0
  762. package/src/langium/scope/tier-specificity.ts +89 -0
  763. package/src/langium/serialization/abstract-serializer.ts +474 -0
  764. package/src/langium/serialization/index.ts +14 -0
  765. package/src/langium/serialization/json-serializer.ts +264 -0
  766. package/src/langium/serialization/serialization-util.ts +40 -0
  767. package/src/langium/serialization/serializer.ts +68 -0
  768. package/src/langium/serialization/yaml-serializer.ts +348 -0
  769. package/src/langium/service-registry.ts +323 -0
  770. package/src/langium/shared-services.ts +107 -0
  771. package/src/langium/transfer/index.ts +10 -0
  772. package/src/langium/transfer/transfer-encoder.ts +434 -0
  773. package/src/langium/update-rewrite/index.ts +14 -0
  774. package/src/langium/update-rewrite/normalize-empty-strings.ts +86 -0
  775. package/src/langium/update-rewrite/semantic-root-rewrite.ts +57 -0
  776. package/src/langium/update-rewrite/update-rewrite-contribution.ts +44 -0
  777. package/src/langium/update-rewrite/update-rewrite-service.ts +129 -0
  778. package/src/langium/update-rewrite/update-rewrite.ts +60 -0
  779. package/src/langium/validation/document-validator.ts +188 -0
  780. package/src/langium/validation/index.ts +12 -0
  781. package/src/langium/validation/validation-contribution-collector.ts +61 -0
  782. package/src/langium/validation/validation-contribution.ts +38 -0
  783. package/src/langium/workspace/additional-document-contribution.ts +80 -0
  784. package/src/langium/workspace/document-uri-policy.ts +187 -0
  785. package/src/langium/workspace/file-system-provider.ts +52 -0
  786. package/src/langium/workspace/hydranium-langium-document-factory.ts +78 -0
  787. package/src/langium/workspace/hydranium-workspace-lock.ts +35 -0
  788. package/src/langium/workspace/hydranium-workspace-manager.ts +412 -0
  789. package/src/langium/workspace/in-memory-file-system-provider.ts +241 -0
  790. package/src/langium/workspace/index-manager.ts +266 -0
  791. package/src/langium/workspace/index.ts +23 -0
  792. package/src/langium/workspace/initialize-workspace.ts +102 -0
  793. package/src/langium/workspace/langium-documents.ts +94 -0
  794. package/src/langium/workspace/persistent-file-system-provider.ts +287 -0
  795. package/src/langium/workspace/synthetic.ts +63 -0
  796. package/src/langium/workspace/virtual-document.ts +94 -0
  797. package/src/langium/workspace/write-lock-scope.ts +88 -0
  798. package/src/launcher/index.ts +12 -0
  799. package/src/launcher/integrated-server.ts +28 -0
  800. package/src/lsp/completion/hydranium-completion-provider.ts +132 -0
  801. package/src/lsp/hydranium-document-update-handler.ts +345 -0
  802. package/src/lsp/index.ts +24 -0
  803. package/src/lsp/instrument-connection.ts +66 -0
  804. package/src/lsp/language-module.ts +64 -0
  805. package/src/lsp/semantic-token-provider.ts +215 -0
  806. package/src/lsp/shared-module.ts +88 -0
  807. package/src/lsp/start-language-server.ts +68 -0
  808. package/src/node/ast-ground-truth.ts +76 -0
  809. package/src/node/event-loop-monitor.ts +89 -0
  810. package/src/node/index.ts +53 -0
  811. package/src/node/latency-from-env.ts +39 -0
  812. package/src/node/lint-grammar.ts +189 -0
  813. package/src/node/log-file-sink.ts +43 -0
  814. package/src/node/log-preamble-node.ts +63 -0
  815. package/src/node/measure-memory.ts +196 -0
  816. package/src/node/memory-monitor.ts +103 -0
  817. package/src/node/node-file-system-provider.ts +252 -0
  818. package/src/node/process-memory.ts +299 -0
  819. package/src/node/profile-capture.ts +377 -0
  820. package/src/node/profile-digest.ts +112 -0
  821. package/src/node/profiling-run.ts +236 -0
  822. package/src/node/reflect-grammar.ts +182 -0
  823. package/src/node/server-diagnostics.ts +63 -0
  824. package/src/node/server-state-snapshot.ts +192 -0
  825. package/src/node/socket-launcher.ts +210 -0
  826. package/src/node/stdio-launcher.ts +150 -0
  827. package/src/node/validate-workspace.ts +133 -0
  828. package/src/node/write-lock-scope-node.ts +41 -0
  829. package/src/testing/ast-snapshot.ts +88 -0
  830. package/src/testing/document-uri-policy-conformance.ts +104 -0
  831. package/src/testing/fake-description.ts +52 -0
  832. package/src/testing/fake-document.ts +120 -0
  833. package/src/testing/fake-reflection.ts +39 -0
  834. package/src/testing/index.ts +45 -0
  835. package/src/testing/langium-test-helpers.ts +26 -0
  836. package/src/testing/make-noop-language-services.ts +47 -0
  837. package/src/testing/make-noop-shared-services.ts +78 -0
  838. package/src/testing/make-test-services.ts +356 -0
  839. package/src/testing/make-test-tracer.ts +92 -0
  840. package/src/testing/node/generated-workspace.ts +222 -0
  841. package/src/testing/node/golden-corpus.ts +114 -0
  842. package/src/testing/node/index.ts +29 -0
  843. package/src/testing/node/lsp-harness.ts +230 -0
  844. package/src/testing/node/lsp-server-connection.ts +575 -0
  845. package/src/testing/node/scratch-workspace.ts +137 -0
  846. package/src/testing/node/spawned-server.ts +447 -0
  847. package/src/testing/parse-semantic-root.ts +150 -0
  848. package/src/testing/playwright/browser-capture-bridge.ts +258 -0
  849. package/src/testing/playwright/e2e-profiling.ts +362 -0
  850. package/src/testing/playwright/index.ts +16 -0
  851. package/src/testing/playwright/server-log-capture.ts +433 -0
  852. package/src/testing/playwright/server-log-fixture.ts +57 -0
  853. package/src/testing/playwright/server-log-rename-reporter.ts +29 -0
  854. package/src/testing/run-update-pipeline.ts +113 -0
  855. package/src/testing/stub-ast-document-manager.ts +224 -0
  856. package/src/testing/stub-document-builder.ts +242 -0
  857. package/src/testing/stub-hydranium-text-documents.ts +270 -0
  858. package/src/testing/stub-index-manager.ts +79 -0
  859. package/src/testing/stub-langium-documents.ts +104 -0
  860. package/src/testing/stub-model-service.ts +72 -0
  861. package/src/testing/stub-project-manager.ts +161 -0
  862. package/src/testing/stub-self-save-registry.ts +43 -0
  863. package/src/testing/stub-service-registry.ts +192 -0
  864. package/src/testing/stub-writable-file-system.ts +58 -0
  865. package/src/util/connection-liveness.ts +47 -0
  866. package/src/util/environment.ts +88 -0
  867. package/src/util/index.ts +18 -0
  868. package/src/util/registry.ts +129 -0
@@ -0,0 +1,57 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023-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 { DEFER_START_MS } from '@hydranium/protocol';
10
+ const DIVIDER = '───────────────────────────────────────────────────────────────────';
11
+ /**
12
+ * Emits session info and log format conventions. The body is portable
13
+ * (browser-safe); Node-specific runtime details and monitor conventions are
14
+ * injected via {@link LogPreambleOptions.systemInfoLines} /
15
+ * {@link LogPreambleOptions.conventionLines} (see `@hydranium/core/node`).
16
+ */
17
+ export function logPreamble(logger, options) {
18
+ logSessionInfo(logger, options.productName, options.version, options.systemInfoLines ?? []);
19
+ logFormatConventions(logger, options.phaseDetailThresholdMs ?? 50, options.conventionLines ?? []);
20
+ }
21
+ function logSessionInfo(logger, productName, version, systemInfoLines) {
22
+ const now = new Date();
23
+ const dateStr = now.toISOString().slice(0, 10); // YYYY-MM-DD, unambiguous across midnight
24
+ const lines = [
25
+ DIVIDER,
26
+ `${productName} server session`,
27
+ DIVIDER,
28
+ `date ${dateStr}`,
29
+ `version ${version}`,
30
+ ...systemInfoLines,
31
+ DIVIDER
32
+ ];
33
+ for (const line of lines) {
34
+ logger.info(line);
35
+ }
36
+ }
37
+ function logFormatConventions(logger, phaseDetailThresholdMs, conventionLines) {
38
+ const lines = [
39
+ 'Log format conventions',
40
+ DIVIDER,
41
+ '• Timing pairs: "<op> [#N start]" -> "<op> [#N done|cancelled|failed, Nms]"',
42
+ '• Rebuild tags: contextual metadata lives inside the status brackets, e.g.',
43
+ ' "[#N start, event: didChangeContent, cancels #M]"',
44
+ `• Quiet ops: operations under ${DEFER_START_MS}ms are silent; lifecycle ops (save, load) always log`,
45
+ ' (failures/cancels always log, even below the threshold - in that case',
46
+ ' [start] is emitted retroactively so timestamps may be back-to-back while',
47
+ ' the reported Nms is the real elapsed time)',
48
+ `• Phase detail: Parsed/IndexedContent/.../Validated shown only for rebuilds >=${phaseDetailThresholdMs}ms;`,
49
+ ' workspace init always emits per-phase lines live',
50
+ ...conventionLines,
51
+ DIVIDER
52
+ ];
53
+ for (const line of lines) {
54
+ logger.info(line);
55
+ }
56
+ }
57
+ //# sourceMappingURL=log-preamble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-preamble.js","sourceRoot":"","sources":["../../../src/langium/diagnostics/log-preamble.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAElE,MAAM,OAAO,GAAG,qEAAqE,CAAC;AA4BtF;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,OAA2B;IACpE,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IAC5F,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,sBAAsB,IAAI,EAAE,EAAE,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;AACrG,CAAC;AAED,SAAS,cAAc,CAAC,MAAc,EAAE,WAAmB,EAAE,OAAe,EAAE,eAAkC;IAC7G,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,0CAA0C;IAC1F,MAAM,KAAK,GAAG;QACX,OAAO;QACP,GAAG,WAAW,iBAAiB;QAC/B,OAAO;QACP,eAAe,OAAO,EAAE;QACxB,eAAe,OAAO,EAAE;QACxB,GAAG,eAAe;QAClB,OAAO;KACT,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAc,EAAE,sBAA8B,EAAE,eAAkC;IAC7G,MAAM,KAAK,GAAG;QACX,wBAAwB;QACxB,OAAO;QACP,iFAAiF;QACjF,8EAA8E;QAC9E,qEAAqE;QACrE,sCAAsC,cAAc,sDAAsD;QAC1G,yFAAyF;QACzF,4FAA4F;QAC5F,8DAA8D;QAC9D,mFAAmF,sBAAsB,KAAK;QAC9G,oEAAoE;QACpE,GAAG,eAAe;QAClB,OAAO;KACT,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,104 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023-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
+ /** Only append a memory suffix when the heap has moved by at least this much since the last log line. */
10
+ export declare const MEMORY_DELTA_BYTES: number;
11
+ /**
12
+ * Pluggable file-tee sink. The file-tee's only platform coupling is the
13
+ * actual disk write + directory create; routing those through an injected
14
+ * sink keeps this module free of `node:fs` so it stays on the portable `.`
15
+ * entry. `@hydranium/core/node` installs a `node:fs`-backed sink (see
16
+ * `installNodeLogFileSink`); when
17
+ * no sink is installed (browser / in-memory hosts) the file-tee is inert and
18
+ * lines fan out only to the LSP/console destination. Configuring a tee target
19
+ * (`HYDRANIUM_LOG_FILE`) is itself Node-only, so the inert path is never hit
20
+ * in a browser.
21
+ */
22
+ export interface LogFileSink {
23
+ /** Append already-formatted text to the file at `path`. Must not throw. */
24
+ append(path: string, data: string): void;
25
+ /** Best-effort create of the parent directory for `path`. Must not throw. */
26
+ ensureDir(path: string): void;
27
+ }
28
+ /** Install (or clear, with `undefined`) the file-tee sink. Idempotent. */
29
+ export declare function setLogFileSink(sink: LogFileSink | undefined): void;
30
+ /**
31
+ * Set the file-tee target programmatically. Pass `undefined` to disable. The
32
+ * path may contain `{placeholder}` tokens (e.g. `{workspace}`); lines buffer
33
+ * until every token is supplied via {@link resolveLogFilePlaceholder}.
34
+ * Called by the `LspLogger` constructor's
35
+ * one-time `HYDRANIUM_LOG_FILE` env baseline (and by tests).
36
+ */
37
+ export declare function setLogFilePath(path: string | undefined): void;
38
+ /**
39
+ * Supply a value for a `{name}` placeholder in the configured target. Once the
40
+ * last placeholder is supplied the target resolves and any lines buffered while
41
+ * it was pending are flushed in emission order.
42
+ */
43
+ export declare function resolveLogFilePlaceholder(name: string, value: string): void;
44
+ /**
45
+ * Last-resort flush for the case where the target never resolves (e.g. the
46
+ * server crashed before the workspace was known). Substitutes any remaining
47
+ * `{...}` token with a process-unique `_startup-<pid>` segment and flushes the
48
+ * buffer, so startup / failure lines are never lost. No-op when the target is
49
+ * already resolved or there is nothing buffered. Registered on `process.exit`
50
+ * as soon as an unresolved target is configured.
51
+ */
52
+ export declare function flushLogFileFallback(): void;
53
+ /** Current resolved file-tee target. `undefined` when disabled or still pending. */
54
+ export declare function getLogFilePath(): string | undefined;
55
+ /**
56
+ * Fan a single already-formatted log line out to the file-tee target, if one is
57
+ * configured. Called by `LspLogger`'s emit in
58
+ * addition to the LSP/console sink — log sinks fan out, they don't replace.
59
+ * While the target is still pending (unresolved `{placeholder}`), the line is
60
+ * buffered instead of dropped.
61
+ */
62
+ export declare function teeLogLine(formatted: string): void;
63
+ export { toLogFileWorkspaceToken } from './log-file-token.js';
64
+ /**
65
+ * Shared options-base for every framework-bound service that derives a
66
+ * `Tracer` (or
67
+ * `Logger`) from its `services`
68
+ * constructor parameter. Carries the `logName` label used to identify the
69
+ * service in its log / trace output and in the startup instantiation trace.
70
+ *
71
+ * The field name reads from the adopter's perspective — `logName` is "the
72
+ * name this service appears under in the log". Distinct from
73
+ * `LspLoggerOptions.component`, which is the logger's own identity field
74
+ * (matches `AbstractLogger.component` and `Logger.for`'s argument).
75
+ *
76
+ * A framework service's constructor stores a tracer named by `logName` and
77
+ * emits a single instantiation trace. The fallback used when `logName` is
78
+ * absent is chosen per service: a fixed curated string where the slot has one
79
+ * canonical implementation, or `this.constructor.name` where it has swappable
80
+ * strategy bindings, so the log shows which implementation ran. The
81
+ * framework's default `Logger` level is `'info'`, so those trace lines are
82
+ * no-ops in production; raising the level to `trace` — directly or via the
83
+ * LSP-config-bound setting — before workspace load makes startup
84
+ * instantiation visible.
85
+ */
86
+ export interface LogNameOptions {
87
+ /**
88
+ * Name passed to `Tracer.for(...)` / `Logger.for(...)` — the label the
89
+ * service appears under in its log / trace output. Optional; each
90
+ * service supplies its own default (a fixed curated string, or
91
+ * `this.constructor.name`). Override when the runtime class name is
92
+ * generic (anonymous adopter subclass) or when multiple instances of
93
+ * the same class are bound to distinct slots and the adopter wants to
94
+ * disambiguate them in the log.
95
+ */
96
+ readonly logName?: string;
97
+ }
98
+ /**
99
+ * Format current memory as "heap used/total, rss N". Returns `''` where
100
+ * `process.memoryUsage` is unavailable (browser) so callers can append it
101
+ * unconditionally.
102
+ */
103
+ export declare function formatMemory(): string;
104
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/langium/diagnostics/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAKlF,yGAAyG;AACzG,eAAO,MAAM,kBAAkB,QAAkB,CAAC;AAElD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW;IACzB,2EAA2E;IAC3E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,6EAA6E;IAC7E,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAID,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAElE;AA6ED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAM7D;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAG3E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAO3C;AAaD,oFAAoF;AACpF,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,CAEnD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAYlD;AAKD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,cAAc;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAMrC"}
@@ -0,0 +1,178 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023-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 { Format } from '@hydranium/protocol';
10
+ import { currentMemoryUsage, onProcessEvent, processPid } from '../../util/environment.js';
11
+ /** Only append a memory suffix when the heap has moved by at least this much since the last log line. */
12
+ export const MEMORY_DELTA_BYTES = 5 * 1024 * 1024;
13
+ let fileSink;
14
+ /** Install (or clear, with `undefined`) the file-tee sink. Idempotent. */
15
+ export function setLogFileSink(sink) {
16
+ fileSink = sink;
17
+ }
18
+ /**
19
+ * File-tee state for `LspLogger`'s emit. When
20
+ * non-empty, every formatted log line is appended to the path in addition to
21
+ * its LSP `window/logMessage` / console destination (see {@link teeLogLine}).
22
+ * Diagnostic surface only — once the LSP connection binds, server logs route
23
+ * through `connection.console.*` and disappear from any pipe watching backend
24
+ * stdout; setting this path makes them visible to a headless test harness
25
+ * without scraping the client's Output view.
26
+ *
27
+ * The sink writes synchronously, so log lines preserve emission order; errors
28
+ * are swallowed because a failing log sink must not propagate.
29
+ * Append-only — the path is the consumer's responsibility to truncate / rotate.
30
+ *
31
+ * Raw configured target — may contain `{placeholder}` tokens (e.g.
32
+ * `{workspace}`) that are not known at module-load time.
33
+ */
34
+ let logFileTemplate;
35
+ /** Fully-resolved target (no remaining placeholders). `undefined` while pending. */
36
+ let resolvedLogFilePath;
37
+ /** Placeholder values supplied so far via {@link resolveLogFilePlaceholder}. */
38
+ const logFilePlaceholders = new Map();
39
+ /**
40
+ * Lines emitted while the target is still pending (placeholders unresolved).
41
+ * Flushed verbatim — preserving emission order — once the target resolves, so
42
+ * no startup line is ever dropped. Each entry already carries its trailing `\n`.
43
+ */
44
+ const pendingLogLines = [];
45
+ /** Matches any remaining `{name}` placeholder token. */
46
+ const PLACEHOLDER_PATTERN = /\{[^}]+\}/;
47
+ /**
48
+ * Recompute {@link resolvedLogFilePath} from the template + known placeholders.
49
+ * Resolves (and flushes the pending buffer) only once no `{...}` token remains.
50
+ */
51
+ function tryResolveLogFilePath() {
52
+ if (!logFileTemplate) {
53
+ resolvedLogFilePath = undefined;
54
+ return;
55
+ }
56
+ let path = logFileTemplate;
57
+ for (const [name, value] of logFilePlaceholders) {
58
+ path = path.split(`{${name}}`).join(value);
59
+ }
60
+ if (PLACEHOLDER_PATTERN.test(path)) {
61
+ resolvedLogFilePath = undefined;
62
+ // Target is pending — guarantee the buffer is flushed even if the process
63
+ // exits before the remaining placeholders are ever supplied.
64
+ ensureFallbackHandler();
65
+ return;
66
+ }
67
+ resolvedLogFilePath = path;
68
+ ensureLogDir(path);
69
+ flushPendingLogLines();
70
+ }
71
+ /**
72
+ * Best-effort create of the target's parent directory. Covers the headless-test
73
+ * case where the runner wipes the output directory before the server writes its
74
+ * log under it. Failures are swallowed — a log sink must never propagate.
75
+ */
76
+ function ensureLogDir(filePath) {
77
+ // No-op when no sink is installed (browser); the Node sink swallows its own errors.
78
+ fileSink?.ensureDir(filePath);
79
+ }
80
+ /** Append the buffered lines to the resolved target, then clear the buffer. */
81
+ function flushPendingLogLines() {
82
+ if (!resolvedLogFilePath || pendingLogLines.length === 0) {
83
+ return;
84
+ }
85
+ fileSink?.append(resolvedLogFilePath, pendingLogLines.join(''));
86
+ pendingLogLines.length = 0;
87
+ }
88
+ /**
89
+ * Set the file-tee target programmatically. Pass `undefined` to disable. The
90
+ * path may contain `{placeholder}` tokens (e.g. `{workspace}`); lines buffer
91
+ * until every token is supplied via {@link resolveLogFilePlaceholder}.
92
+ * Called by the `LspLogger` constructor's
93
+ * one-time `HYDRANIUM_LOG_FILE` env baseline (and by tests).
94
+ */
95
+ export function setLogFilePath(path) {
96
+ logFileTemplate = path && path.length > 0 ? path : undefined;
97
+ logFilePlaceholders.clear();
98
+ pendingLogLines.length = 0;
99
+ resolvedLogFilePath = undefined;
100
+ tryResolveLogFilePath();
101
+ }
102
+ /**
103
+ * Supply a value for a `{name}` placeholder in the configured target. Once the
104
+ * last placeholder is supplied the target resolves and any lines buffered while
105
+ * it was pending are flushed in emission order.
106
+ */
107
+ export function resolveLogFilePlaceholder(name, value) {
108
+ logFilePlaceholders.set(name, value);
109
+ tryResolveLogFilePath();
110
+ }
111
+ /**
112
+ * Last-resort flush for the case where the target never resolves (e.g. the
113
+ * server crashed before the workspace was known). Substitutes any remaining
114
+ * `{...}` token with a process-unique `_startup-<pid>` segment and flushes the
115
+ * buffer, so startup / failure lines are never lost. No-op when the target is
116
+ * already resolved or there is nothing buffered. Registered on `process.exit`
117
+ * as soon as an unresolved target is configured.
118
+ */
119
+ export function flushLogFileFallback() {
120
+ if (!logFileTemplate || resolvedLogFilePath || pendingLogLines.length === 0) {
121
+ return;
122
+ }
123
+ resolvedLogFilePath = logFileTemplate.replace(/\{[^}]+\}/g, `_startup-${processPid() ?? 'unknown'}`);
124
+ ensureLogDir(resolvedLogFilePath);
125
+ flushPendingLogLines();
126
+ }
127
+ /** Registered at most once; flushes any pending buffer on process teardown. */
128
+ let fallbackHandlerRegistered = false;
129
+ function ensureFallbackHandler() {
130
+ if (fallbackHandlerRegistered) {
131
+ return;
132
+ }
133
+ fallbackHandlerRegistered = true;
134
+ // Node-only teardown flush; a no-op in a browser worker (no `exit` event).
135
+ onProcessEvent('exit', () => flushLogFileFallback());
136
+ }
137
+ /** Current resolved file-tee target. `undefined` when disabled or still pending. */
138
+ export function getLogFilePath() {
139
+ return resolvedLogFilePath;
140
+ }
141
+ /**
142
+ * Fan a single already-formatted log line out to the file-tee target, if one is
143
+ * configured. Called by `LspLogger`'s emit in
144
+ * addition to the LSP/console sink — log sinks fan out, they don't replace.
145
+ * While the target is still pending (unresolved `{placeholder}`), the line is
146
+ * buffered instead of dropped.
147
+ */
148
+ export function teeLogLine(formatted) {
149
+ if (!logFileTemplate) {
150
+ return;
151
+ }
152
+ const line = `${formatted}\n`;
153
+ if (resolvedLogFilePath) {
154
+ // The sink swallows its own errors; recursing into the logger here would
155
+ // re-enter emit and loop. The LSP/console sink already delivered the line.
156
+ fileSink?.append(resolvedLogFilePath, line);
157
+ }
158
+ else {
159
+ pendingLogLines.push(line);
160
+ }
161
+ }
162
+ // Re-exported so the token derivation is reachable from the diagnostics barrel.
163
+ // It is defined in a standalone, dependency-light module so a Playwright test
164
+ // helper can import it directly without pulling the barrel's module graph.
165
+ export { toLogFileWorkspaceToken } from './log-file-token.js';
166
+ /**
167
+ * Format current memory as "heap used/total, rss N". Returns `''` where
168
+ * `process.memoryUsage` is unavailable (browser) so callers can append it
169
+ * unconditionally.
170
+ */
171
+ export function formatMemory() {
172
+ const mem = currentMemoryUsage();
173
+ if (!mem) {
174
+ return '';
175
+ }
176
+ return `heap ${Format.bytes(mem.heapUsed)}/${Format.bytes(mem.heapTotal)}, rss ${Format.bytes(mem.rss)}`;
177
+ }
178
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/langium/diagnostics/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE3F,yGAAyG;AACzG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAoBlD,IAAI,QAAiC,CAAC;AAEtC,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAAC,IAA6B;IACzD,QAAQ,GAAG,IAAI,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,IAAI,eAAmC,CAAC;AACxC,oFAAoF;AACpF,IAAI,mBAAuC,CAAC;AAC5C,gFAAgF;AAChF,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;AACtD;;;;GAIG;AACH,MAAM,eAAe,GAAa,EAAE,CAAC;AAErC,wDAAwD;AACxD,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAExC;;;GAGG;AACH,SAAS,qBAAqB;IAC3B,IAAI,CAAC,eAAe,EAAE,CAAC;QACpB,mBAAmB,GAAG,SAAS,CAAC;QAChC,OAAO;IACV,CAAC;IACD,IAAI,IAAI,GAAG,eAAe,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,mBAAmB,EAAE,CAAC;QAC/C,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,mBAAmB,GAAG,SAAS,CAAC;QAChC,0EAA0E;QAC1E,6DAA6D;QAC7D,qBAAqB,EAAE,CAAC;QACxB,OAAO;IACV,CAAC;IACD,mBAAmB,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,IAAI,CAAC,CAAC;IACnB,oBAAoB,EAAE,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,QAAgB;IACnC,oFAAoF;IACpF,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,+EAA+E;AAC/E,SAAS,oBAAoB;IAC1B,IAAI,CAAC,mBAAmB,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxD,OAAO;IACV,CAAC;IACD,QAAQ,EAAE,MAAM,CAAC,mBAAmB,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,IAAwB;IACpD,eAAe,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7D,mBAAmB,CAAC,KAAK,EAAE,CAAC;IAC5B,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3B,mBAAmB,GAAG,SAAS,CAAC;IAChC,qBAAqB,EAAE,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAY,EAAE,KAAa;IAClE,mBAAmB,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,qBAAqB,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB;IACjC,IAAI,CAAC,eAAe,IAAI,mBAAmB,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3E,OAAO;IACV,CAAC;IACD,mBAAmB,GAAG,eAAe,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,UAAU,EAAE,IAAI,SAAS,EAAE,CAAC,CAAC;IACrG,YAAY,CAAC,mBAAmB,CAAC,CAAC;IAClC,oBAAoB,EAAE,CAAC;AAC1B,CAAC;AAED,+EAA+E;AAC/E,IAAI,yBAAyB,GAAG,KAAK,CAAC;AACtC,SAAS,qBAAqB;IAC3B,IAAI,yBAAyB,EAAE,CAAC;QAC7B,OAAO;IACV,CAAC;IACD,yBAAyB,GAAG,IAAI,CAAC;IACjC,2EAA2E;IAC3E,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,cAAc;IAC3B,OAAO,mBAAmB,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB;IACzC,IAAI,CAAC,eAAe,EAAE,CAAC;QACpB,OAAO;IACV,CAAC;IACD,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,CAAC;IAC9B,IAAI,mBAAmB,EAAE,CAAC;QACvB,yEAAyE;QACzE,2EAA2E;QAC3E,QAAQ,EAAE,MAAM,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;SAAM,CAAC;QACL,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,8EAA8E;AAC9E,2EAA2E;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAqC9D;;;;GAIG;AACH,MAAM,UAAU,YAAY;IACzB,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;IACjC,IAAI,CAAC,GAAG,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;IACb,CAAC;IACD,OAAO,QAAQ,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;AAC5G,CAAC"}
@@ -0,0 +1,76 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023-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 { AbstractLogger, type Clock, Logger, type LogLevel, type LogThreshold, type MaybeObservableValue } from '@hydranium/protocol';
10
+ import { type URI } from '@hydranium/langium';
11
+ import { type ServerSharedServices } from '../module.js';
12
+ /**
13
+ * Options accepted by {@link LspLogger}. Carries the logger's own
14
+ * identity {@link component} (the field on {@link AbstractLogger}
15
+ * prefixed to every log line the logger emits). This is intentionally
16
+ * a separate field from `logName` on
17
+ * `LogNameOptions` — the latter labels a
18
+ * service that DERIVES a logger; this labels the logger itself.
19
+ */
20
+ export interface LspLoggerOptions {
21
+ /** Component label prefixed to log output. Read by `AbstractLogger.emit`. */
22
+ readonly component?: string;
23
+ /**
24
+ * Process-global log threshold, applied at construction of the ROOT logger
25
+ * (the instance bound in DI). When set, the constructor calls
26
+ * `Logger.setLevel` with the current value (only when truthy, so an unset
27
+ * setting leaves the env-fallback / `'info'` default in place) and
28
+ * re-applies on every `onChange`. Bind to a user setting via
29
+ * `Settings.value`.
30
+ *
31
+ * The threshold is GLOBAL, not per-instance: `derive` / `for` create child
32
+ * loggers passing only `component`, so children never carry or re-apply
33
+ * `logThreshold` — the root owns it. Pass a constant for tests / non-LSP
34
+ * runs. (Named `logThreshold`, not `logLevel`, to avoid colliding with
35
+ * GLSP's per-instance numeric `Logger.logLevel`; it is an
36
+ * `MaybeObservableValue<LogThreshold>`, matching the framework's filter-side type.)
37
+ */
38
+ readonly logThreshold?: MaybeObservableValue<LogThreshold | undefined>;
39
+ }
40
+ /**
41
+ * LSP-bound implementation of {@link Logger}. Forwards messages to the
42
+ * language client via the connection bound in {@link ServerSharedServices}.
43
+ * Emission only — memory readout and timing live on the server's
44
+ * `ServerTracer`, which composes this
45
+ * logger. Adds URI-aware labelling on top of {@link AbstractLogger}.
46
+ *
47
+ * `withUri` renders workspace-relative paths by default (via the framework
48
+ * `WorkspaceManager.wsRelativePath`); consumers subclass only for a different
49
+ * display convention or extra language-specific helpers.
50
+ */
51
+ export declare class LspLogger extends AbstractLogger implements Logger {
52
+ protected readonly services: ServerSharedServices;
53
+ constructor(services: ServerSharedServices, options?: LspLoggerOptions);
54
+ /**
55
+ * Route logger timing and timestamps through the injected framework
56
+ * {@link Clock} (the dedicated `shared.Clock` slot) so server-side log time
57
+ * shares the one fake-clock axis tests drive with `makeFakeClock`, rather
58
+ * than reading the wall clock directly. The logger takes the full
59
+ * {@link ServerSharedServices}, which carries the slot, so the read is
60
+ * direct — no cast or fallback needed.
61
+ */
62
+ protected clock(): Clock;
63
+ /**
64
+ * URI labelling rendered as a workspace-relative path via the framework
65
+ * `HydraniumWorkspaceManager.wsRelativePath` (falls back to the URI
66
+ * string when no workspace folder is known). Widens the
67
+ * {@link Logger.withUri} parameter to accept a `URI` object directly —
68
+ * server-side callers typically hold URIs, not strings. Subclasses with a
69
+ * different display convention override their `WorkspaceManager.wsRelativePath`
70
+ * (preferred) or this method.
71
+ */
72
+ withUri(uri: URI | string): this;
73
+ protected emit(level: LogLevel, label: string, message: string, args: readonly unknown[]): void;
74
+ protected derive(component: string): this;
75
+ }
76
+ //# sourceMappingURL=lsp-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lsp-logger.d.ts","sourceRoot":"","sources":["../../../src/langium/diagnostics/lsp-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,cAAc,EACd,KAAK,KAAK,EAGV,MAAM,EACN,KAAK,QAAQ,EACb,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EAE3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAYzD;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;CACzE;AAED;;;;;;;;;;GAUG;AACH,qBAAa,SAAU,SAAQ,cAAe,YAAW,MAAM;IAEzD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB;gBAA9B,QAAQ,EAAE,oBAAoB,EACjD,OAAO,GAAE,gBAAqB;IA2CjC;;;;;;;OAOG;cACgB,KAAK,IAAI,KAAK;IAIjC;;;;;;;;OAQG;IACM,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI;IAIzC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI;IAuC/F,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAM3C"}
@@ -0,0 +1,223 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023-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 { AbstractLogger, DEFAULT_LOG_FILE_ENV, DEFAULT_LOG_LEVEL_ENV, Logger, ObservableValue, parseLogLevel } from '@hydranium/protocol';
10
+ import { setLogFilePath, teeLogLine } from './logger.js';
11
+ import { processEnv, writeStderr } from '../../util/environment.js';
12
+ /**
13
+ * Guards the one-time env-var log-level and log-file baselines (see the
14
+ * {@link LspLogger} constructor). Applied on the first logger construction and
15
+ * never again, so derived child loggers cannot re-read the env and clobber a
16
+ * live setting.
17
+ */
18
+ let envBaselineApplied = false;
19
+ /**
20
+ * LSP-bound implementation of {@link Logger}. Forwards messages to the
21
+ * language client via the connection bound in {@link ServerSharedServices}.
22
+ * Emission only — memory readout and timing live on the server's
23
+ * `ServerTracer`, which composes this
24
+ * logger. Adds URI-aware labelling on top of {@link AbstractLogger}.
25
+ *
26
+ * `withUri` renders workspace-relative paths by default (via the framework
27
+ * `WorkspaceManager.wsRelativePath`); consumers subclass only for a different
28
+ * display convention or extra language-specific helpers.
29
+ */
30
+ export class LspLogger extends AbstractLogger {
31
+ services;
32
+ constructor(services, options = {}) {
33
+ super(options.component);
34
+ this.services = services;
35
+ // Apply the framework env baselines (`HYDRANIUM_LOG_LEVEL` and
36
+ // `HYDRANIUM_LOG_FILE`) exactly once, on the first logger construction,
37
+ // before any setting is read. Unconditional and process-global, so it
38
+ // needs no root detection and is never re-applied by derived children —
39
+ // which would otherwise clobber a live setting. These are the single env
40
+ // vars for level / file-tee (an adopter brands them by renaming the
41
+ // framework env, not by introducing its own).
42
+ if (!envBaselineApplied) {
43
+ envBaselineApplied = true;
44
+ // No `process.env` in a browser — the level/file-tee env baseline is
45
+ // a Node concern; skip it cleanly there.
46
+ const env = processEnv();
47
+ if (env) {
48
+ const envLevel = parseLogLevel(env[DEFAULT_LOG_LEVEL_ENV]);
49
+ if (envLevel) {
50
+ Logger.setLevel(envLevel);
51
+ }
52
+ const envLogFile = env[DEFAULT_LOG_FILE_ENV];
53
+ if (envLogFile) {
54
+ setLogFilePath(envLogFile);
55
+ }
56
+ }
57
+ }
58
+ // Apply the configured threshold from the root logger only — `derive`
59
+ // passes just `component`, so children never carry `logThreshold`. The
60
+ // setting overrides the env baseline above and re-applies on every change;
61
+ // truthy-guarded so an unset setting leaves the baseline / `'info'` default.
62
+ if (options.logThreshold !== undefined) {
63
+ const level = ObservableValue.from(options.logThreshold);
64
+ if (level.value) {
65
+ Logger.setLevel(level.value);
66
+ }
67
+ level.onChange(next => {
68
+ if (next) {
69
+ Logger.setLevel(next);
70
+ }
71
+ });
72
+ }
73
+ }
74
+ /**
75
+ * Route logger timing and timestamps through the injected framework
76
+ * {@link Clock} (the dedicated `shared.Clock` slot) so server-side log time
77
+ * shares the one fake-clock axis tests drive with `makeFakeClock`, rather
78
+ * than reading the wall clock directly. The logger takes the full
79
+ * {@link ServerSharedServices}, which carries the slot, so the read is
80
+ * direct — no cast or fallback needed.
81
+ */
82
+ clock() {
83
+ return this.services.Clock;
84
+ }
85
+ /**
86
+ * URI labelling rendered as a workspace-relative path via the framework
87
+ * `HydraniumWorkspaceManager.wsRelativePath` (falls back to the URI
88
+ * string when no workspace folder is known). Widens the
89
+ * {@link Logger.withUri} parameter to accept a `URI` object directly —
90
+ * server-side callers typically hold URIs, not strings. Subclasses with a
91
+ * different display convention override their `WorkspaceManager.wsRelativePath`
92
+ * (preferred) or this method.
93
+ */
94
+ withUri(uri) {
95
+ return this.with(this.services.workspace.WorkspaceManager.wsRelativePath(uri));
96
+ }
97
+ emit(level, label, message, args) {
98
+ const component = this.component ? ` [${this.component}]` : '';
99
+ // Pad to the widest label (5 chars — 'Error'/'Debug'/'Trace') so timestamps line up.
100
+ const prefix = `[${label.padEnd(5)} - ${this.timestamp()}]${component}`;
101
+ const combined = args.length === 0 ? message : `${message} ${args.map(formatLogArg).join(' ')}`;
102
+ const formatted = `${prefix} ${combined}`;
103
+ const connection = this.services.lsp.Connection;
104
+ // Route through the LSP `window/logMessage` channel so log lines stay
105
+ // framed as JSON-RPC messages even in `--stdio` mode (where stdout is
106
+ // the LSP transport — any raw `console.*` write before
107
+ // vscode-languageserver's `attachConsole` patches the globals would
108
+ // corrupt the protocol stream). Pre-stringify all args into one
109
+ // message because `RemoteConsole.*` takes a single string.
110
+ //
111
+ // Falls through to the raw sink below when the connection cannot take the
112
+ // line, which is NOT a theoretical case: `RemoteConsole.send` throws
113
+ // `Connection is disposed` once the client has gone, and the log lines
114
+ // most likely to arrive at that moment are the ones that matter most —
115
+ // shutdown diagnostics and the workspace manager's own
116
+ // unhandled-rejection handler. A log sink that throws turns a diagnostic
117
+ // into a crash, so a dead channel degrades to stderr instead.
118
+ if (!connection || !sendViaConnection(connection, level, formatted)) {
119
+ if (!writeStderr(`${formatted}\n`)) {
120
+ // Browser only. In Node every level goes to STDERR, including the
121
+ // three that `console.*` would put on stdout (`info` / `debug` /
122
+ // `log`) — stdout is the JSON-RPC channel for any head launched over
123
+ // stdio, so a log line written there corrupts the protocol stream
124
+ // rather than merely appearing in the wrong place. A browser has no
125
+ // such channel, so it keeps the per-level console methods, which
126
+ // render structured args far better than a pre-joined string.
127
+ const consumer = CONSOLE[level];
128
+ consumer(prefix, message, ...args);
129
+ }
130
+ }
131
+ // File-tee fan-out for headless capture (see `setLogFilePath`). Always runs
132
+ // in addition to the LSP/console sink — log sinks fan out, they don't replace.
133
+ teeLogLine(formatted);
134
+ }
135
+ derive(component) {
136
+ const Subclass = this.constructor;
137
+ return new Subclass(this.services, { component });
138
+ }
139
+ }
140
+ /**
141
+ * Deliver one formatted line over the LSP `window/logMessage` channel,
142
+ * reporting whether the channel took it.
143
+ *
144
+ * Returns `false` — rather than throwing — when the connection is closed or
145
+ * disposed. `RemoteConsole.send` throws `Connection is disposed` in that state,
146
+ * and a logger that propagates it converts a diagnostic into an uncaught
147
+ * exception at exactly the moment things are already going wrong: the framework's
148
+ * own `handleProcessUnhandledRejection` logs through this path, so a late
149
+ * rejection after client teardown would crash the server while *reporting* an
150
+ * error. The caller falls back to the raw sink, so the line is still delivered.
151
+ */
152
+ function sendViaConnection(connection, level, formatted) {
153
+ try {
154
+ LSP_CONSOLE[level](connection)(formatted);
155
+ return true;
156
+ }
157
+ catch {
158
+ return false;
159
+ }
160
+ }
161
+ /**
162
+ * Per-level console adapter, used **only where there is no `process.stderr`**
163
+ * (a browser). In Node the fallback writes to stderr for every level instead —
164
+ * see the `emit` branch. Kept per-level rather than collapsed onto
165
+ * `console.error` because devtools render `info` / `debug` distinctly and
166
+ * colouring every framework log line as an error would be actively misleading.
167
+ */
168
+ const CONSOLE = {
169
+ error: console.error,
170
+ warn: console.warn,
171
+ info: console.info,
172
+ debug: console.debug,
173
+ trace: console.log
174
+ };
175
+ /**
176
+ * Per-level adapter that resolves the right `RemoteConsole` method on a
177
+ * Langium {@link Connection}. `RemoteConsole` exposes
178
+ * `error / warn / info / log / debug` — `debug` arriving with LSP 3.18's
179
+ * `MessageType.Debug` severity, so a debug line is now tagged as such in
180
+ * the client's log instead of being indistinguishable from `log`. There is
181
+ * still no `trace`, so that one level folds into `log` (severity `Log` in
182
+ * the `window/logMessage` type table). A client predating 3.18 has no
183
+ * `Debug` case and appends the message unlabelled, so the mapping degrades
184
+ * rather than dropping output. The returned function takes a single
185
+ * pre-formatted string since `RemoteConsole.*` accepts only one argument.
186
+ */
187
+ const LSP_CONSOLE = {
188
+ error: c => c.console.error.bind(c.console),
189
+ warn: c => c.console.warn.bind(c.console),
190
+ info: c => c.console.info.bind(c.console),
191
+ debug: c => c.console.debug.bind(c.console),
192
+ trace: c => c.console.log.bind(c.console)
193
+ };
194
+ /**
195
+ * Render a logger-argument value into the single combined string the LSP
196
+ * `window/logMessage` channel takes. Mirrors how raw `console.*` would
197
+ * format multiple args, but with explicit handling for Errors (stack) and
198
+ * objects (JSON).
199
+ */
200
+ function formatLogArg(value) {
201
+ if (value === undefined) {
202
+ return 'undefined';
203
+ }
204
+ if (value === null) {
205
+ return 'null';
206
+ }
207
+ if (typeof value === 'string') {
208
+ return value;
209
+ }
210
+ if (value instanceof Error) {
211
+ return value.stack ?? value.message;
212
+ }
213
+ if (typeof value === 'object') {
214
+ try {
215
+ return JSON.stringify(value);
216
+ }
217
+ catch {
218
+ return String(value);
219
+ }
220
+ }
221
+ return String(value);
222
+ }
223
+ //# sourceMappingURL=lsp-logger.js.map