@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.
- package/LICENSE +21 -0
- package/README.md +100 -0
- package/lib/documents/ast-document-manager.d.ts +243 -0
- package/lib/documents/ast-document-manager.d.ts.map +1 -0
- package/lib/documents/ast-document-manager.js +302 -0
- package/lib/documents/ast-document-manager.js.map +1 -0
- package/lib/documents/client-ids.d.ts +30 -0
- package/lib/documents/client-ids.d.ts.map +1 -0
- package/lib/documents/client-ids.js +30 -0
- package/lib/documents/client-ids.js.map +1 -0
- package/lib/documents/hydranium-text-documents.d.ts +490 -0
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -0
- package/lib/documents/hydranium-text-documents.js +893 -0
- package/lib/documents/hydranium-text-documents.js.map +1 -0
- package/lib/documents/index.d.ts +14 -0
- package/lib/documents/index.d.ts.map +1 -0
- package/lib/documents/index.js +14 -0
- package/lib/documents/index.js.map +1 -0
- package/lib/documents/language-client-text-shadow.d.ts +101 -0
- package/lib/documents/language-client-text-shadow.d.ts.map +1 -0
- package/lib/documents/language-client-text-shadow.js +156 -0
- package/lib/documents/language-client-text-shadow.js.map +1 -0
- package/lib/documents/self-save-registry.d.ts +55 -0
- package/lib/documents/self-save-registry.d.ts.map +1 -0
- package/lib/documents/self-save-registry.js +68 -0
- package/lib/documents/self-save-registry.js.map +1 -0
- package/lib/index.d.ts +38 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +39 -0
- package/lib/index.js.map +1 -0
- package/lib/langium/ast-extension/ast-extension-contribution.d.ts +33 -0
- package/lib/langium/ast-extension/ast-extension-contribution.d.ts.map +1 -0
- package/lib/langium/ast-extension/ast-extension-contribution.js +10 -0
- package/lib/langium/ast-extension/ast-extension-contribution.js.map +1 -0
- package/lib/langium/ast-extension/ast-extension-service.d.ts +212 -0
- package/lib/langium/ast-extension/ast-extension-service.d.ts.map +1 -0
- package/lib/langium/ast-extension/ast-extension-service.js +181 -0
- package/lib/langium/ast-extension/ast-extension-service.js.map +1 -0
- package/lib/langium/ast-extension/ast-node-builder.d.ts +90 -0
- package/lib/langium/ast-extension/ast-node-builder.d.ts.map +1 -0
- package/lib/langium/ast-extension/ast-node-builder.js +61 -0
- package/lib/langium/ast-extension/ast-node-builder.js.map +1 -0
- package/lib/langium/ast-extension/index.d.ts +12 -0
- package/lib/langium/ast-extension/index.d.ts.map +1 -0
- package/lib/langium/ast-extension/index.js +12 -0
- package/lib/langium/ast-extension/index.js.map +1 -0
- package/lib/langium/bootstrap.d.ts +224 -0
- package/lib/langium/bootstrap.d.ts.map +1 -0
- package/lib/langium/bootstrap.js +512 -0
- package/lib/langium/bootstrap.js.map +1 -0
- package/lib/langium/build-phase-pass/build-phase-pass-service.d.ts +77 -0
- package/lib/langium/build-phase-pass/build-phase-pass-service.d.ts.map +1 -0
- package/lib/langium/build-phase-pass/build-phase-pass-service.js +102 -0
- package/lib/langium/build-phase-pass/build-phase-pass-service.js.map +1 -0
- package/lib/langium/build-phase-pass/build-phase-pass.d.ts +106 -0
- package/lib/langium/build-phase-pass/build-phase-pass.d.ts.map +1 -0
- package/lib/langium/build-phase-pass/build-phase-pass.js +43 -0
- package/lib/langium/build-phase-pass/build-phase-pass.js.map +1 -0
- package/lib/langium/build-phase-pass/index.d.ts +11 -0
- package/lib/langium/build-phase-pass/index.d.ts.map +1 -0
- package/lib/langium/build-phase-pass/index.js +11 -0
- package/lib/langium/build-phase-pass/index.js.map +1 -0
- package/lib/langium/config/index.d.ts +10 -0
- package/lib/langium/config/index.d.ts.map +1 -0
- package/lib/langium/config/index.js +10 -0
- package/lib/langium/config/index.js.map +1 -0
- package/lib/langium/config/settings.d.ts +173 -0
- package/lib/langium/config/settings.d.ts.map +1 -0
- package/lib/langium/config/settings.js +196 -0
- package/lib/langium/config/settings.js.map +1 -0
- package/lib/langium/diagnostics/hydranium-langium-profiler.d.ts +109 -0
- package/lib/langium/diagnostics/hydranium-langium-profiler.d.ts.map +1 -0
- package/lib/langium/diagnostics/hydranium-langium-profiler.js +153 -0
- package/lib/langium/diagnostics/hydranium-langium-profiler.js.map +1 -0
- package/lib/langium/diagnostics/index.d.ts +14 -0
- package/lib/langium/diagnostics/index.d.ts.map +1 -0
- package/lib/langium/diagnostics/index.js +19 -0
- package/lib/langium/diagnostics/index.js.map +1 -0
- package/lib/langium/diagnostics/log-file-token.d.ts +16 -0
- package/lib/langium/diagnostics/log-file-token.d.ts.map +1 -0
- package/lib/langium/diagnostics/log-file-token.js +25 -0
- package/lib/langium/diagnostics/log-file-token.js.map +1 -0
- package/lib/langium/diagnostics/log-preamble.d.ts +42 -0
- package/lib/langium/diagnostics/log-preamble.d.ts.map +1 -0
- package/lib/langium/diagnostics/log-preamble.js +57 -0
- package/lib/langium/diagnostics/log-preamble.js.map +1 -0
- package/lib/langium/diagnostics/logger.d.ts +104 -0
- package/lib/langium/diagnostics/logger.d.ts.map +1 -0
- package/lib/langium/diagnostics/logger.js +178 -0
- package/lib/langium/diagnostics/logger.js.map +1 -0
- package/lib/langium/diagnostics/lsp-logger.d.ts +76 -0
- package/lib/langium/diagnostics/lsp-logger.d.ts.map +1 -0
- package/lib/langium/diagnostics/lsp-logger.js +223 -0
- package/lib/langium/diagnostics/lsp-logger.js.map +1 -0
- package/lib/langium/diagnostics/server-tracer.d.ts +27 -0
- package/lib/langium/diagnostics/server-tracer.d.ts.map +1 -0
- package/lib/langium/diagnostics/server-tracer.js +66 -0
- package/lib/langium/diagnostics/server-tracer.js.map +1 -0
- package/lib/langium/document-builder/build-pipeline-integration.d.ts +88 -0
- package/lib/langium/document-builder/build-pipeline-integration.d.ts.map +1 -0
- package/lib/langium/document-builder/build-pipeline-integration.js +151 -0
- package/lib/langium/document-builder/build-pipeline-integration.js.map +1 -0
- package/lib/langium/document-builder/document-builder.d.ts +405 -0
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -0
- package/lib/langium/document-builder/document-builder.js +729 -0
- package/lib/langium/document-builder/document-builder.js.map +1 -0
- package/lib/langium/document-builder/index.d.ts +12 -0
- package/lib/langium/document-builder/index.d.ts.map +1 -0
- package/lib/langium/document-builder/index.js +12 -0
- package/lib/langium/document-builder/index.js.map +1 -0
- package/lib/langium/document-builder/labeled-phase-listener.d.ts +21 -0
- package/lib/langium/document-builder/labeled-phase-listener.d.ts.map +1 -0
- package/lib/langium/document-builder/labeled-phase-listener.js +15 -0
- package/lib/langium/document-builder/labeled-phase-listener.js.map +1 -0
- package/lib/langium/documentation/comment-provider.d.ts +31 -0
- package/lib/langium/documentation/comment-provider.d.ts.map +1 -0
- package/lib/langium/documentation/comment-provider.js +36 -0
- package/lib/langium/documentation/comment-provider.js.map +1 -0
- package/lib/langium/documentation/index.d.ts +10 -0
- package/lib/langium/documentation/index.d.ts.map +1 -0
- package/lib/langium/documentation/index.js +10 -0
- package/lib/langium/documentation/index.js.map +1 -0
- package/lib/langium/integration-services.d.ts +200 -0
- package/lib/langium/integration-services.d.ts.map +1 -0
- package/lib/langium/integration-services.js +65 -0
- package/lib/langium/integration-services.js.map +1 -0
- package/lib/langium/integrity/index.d.ts +12 -0
- package/lib/langium/integrity/index.d.ts.map +1 -0
- package/lib/langium/integrity/index.js +12 -0
- package/lib/langium/integrity/index.js.map +1 -0
- package/lib/langium/integrity/integrity-contribution.d.ts +42 -0
- package/lib/langium/integrity/integrity-contribution.d.ts.map +1 -0
- package/lib/langium/integrity/integrity-contribution.js +10 -0
- package/lib/langium/integrity/integrity-contribution.js.map +1 -0
- package/lib/langium/integrity/integrity-rule.d.ts +82 -0
- package/lib/langium/integrity/integrity-rule.d.ts.map +1 -0
- package/lib/langium/integrity/integrity-rule.js +52 -0
- package/lib/langium/integrity/integrity-rule.js.map +1 -0
- package/lib/langium/integrity/integrity-service.d.ts +221 -0
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -0
- package/lib/langium/integrity/integrity-service.js +328 -0
- package/lib/langium/integrity/integrity-service.js.map +1 -0
- package/lib/langium/keys/default-element-key-provider.d.ts +19 -0
- package/lib/langium/keys/default-element-key-provider.d.ts.map +1 -0
- package/lib/langium/keys/default-element-key-provider.js +18 -0
- package/lib/langium/keys/default-element-key-provider.js.map +1 -0
- package/lib/langium/keys/element-key-provider.d.ts +106 -0
- package/lib/langium/keys/element-key-provider.d.ts.map +1 -0
- package/lib/langium/keys/element-key-provider.js +25 -0
- package/lib/langium/keys/element-key-provider.js.map +1 -0
- package/lib/langium/keys/index.d.ts +13 -0
- package/lib/langium/keys/index.d.ts.map +1 -0
- package/lib/langium/keys/index.js +13 -0
- package/lib/langium/keys/index.js.map +1 -0
- package/lib/langium/keys/name-based-key-provider.d.ts +99 -0
- package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -0
- package/lib/langium/keys/name-based-key-provider.js +134 -0
- package/lib/langium/keys/name-based-key-provider.js.map +1 -0
- package/lib/langium/keys/positional-key-provider.d.ts +41 -0
- package/lib/langium/keys/positional-key-provider.d.ts.map +1 -0
- package/lib/langium/keys/positional-key-provider.js +48 -0
- package/lib/langium/keys/positional-key-provider.js.map +1 -0
- package/lib/langium/labeling/index.d.ts +10 -0
- package/lib/langium/labeling/index.d.ts.map +1 -0
- package/lib/langium/labeling/index.js +10 -0
- package/lib/langium/labeling/index.js.map +1 -0
- package/lib/langium/labeling/label-provider.d.ts +79 -0
- package/lib/langium/labeling/label-provider.d.ts.map +1 -0
- package/lib/langium/labeling/label-provider.js +44 -0
- package/lib/langium/labeling/label-provider.js.map +1 -0
- package/lib/langium/language-module.d.ts +281 -0
- package/lib/langium/language-module.d.ts.map +1 -0
- package/lib/langium/language-module.js +103 -0
- package/lib/langium/language-module.js.map +1 -0
- package/lib/langium/language-types.d.ts +85 -0
- package/lib/langium/language-types.d.ts.map +1 -0
- package/lib/langium/language-types.js +173 -0
- package/lib/langium/language-types.js.map +1 -0
- package/lib/langium/model-service/index.d.ts +10 -0
- package/lib/langium/model-service/index.d.ts.map +1 -0
- package/lib/langium/model-service/index.js +10 -0
- package/lib/langium/model-service/index.js.map +1 -0
- package/lib/langium/model-service/model-service.d.ts +598 -0
- package/lib/langium/model-service/model-service.d.ts.map +1 -0
- package/lib/langium/model-service/model-service.js +889 -0
- package/lib/langium/model-service/model-service.js.map +1 -0
- package/lib/langium/module.d.ts +308 -0
- package/lib/langium/module.d.ts.map +1 -0
- package/lib/langium/module.js +165 -0
- package/lib/langium/module.js.map +1 -0
- package/lib/langium/naming/index.d.ts +11 -0
- package/lib/langium/naming/index.d.ts.map +1 -0
- package/lib/langium/naming/index.js +11 -0
- package/lib/langium/naming/index.js.map +1 -0
- package/lib/langium/naming/name-provider.d.ts +360 -0
- package/lib/langium/naming/name-provider.d.ts.map +1 -0
- package/lib/langium/naming/name-provider.js +240 -0
- package/lib/langium/naming/name-provider.js.map +1 -0
- package/lib/langium/naming/name-separator-validation.d.ts +47 -0
- package/lib/langium/naming/name-separator-validation.d.ts.map +1 -0
- package/lib/langium/naming/name-separator-validation.js +61 -0
- package/lib/langium/naming/name-separator-validation.js.map +1 -0
- package/lib/langium/project/abstract-project-manager.d.ts +242 -0
- package/lib/langium/project/abstract-project-manager.d.ts.map +1 -0
- package/lib/langium/project/abstract-project-manager.js +545 -0
- package/lib/langium/project/abstract-project-manager.js.map +1 -0
- package/lib/langium/project/index.d.ts +13 -0
- package/lib/langium/project/index.d.ts.map +1 -0
- package/lib/langium/project/index.js +13 -0
- package/lib/langium/project/index.js.map +1 -0
- package/lib/langium/project/project-change-event.d.ts +64 -0
- package/lib/langium/project/project-change-event.d.ts.map +1 -0
- package/lib/langium/project/project-change-event.js +10 -0
- package/lib/langium/project/project-change-event.js.map +1 -0
- package/lib/langium/project/project-manager.d.ts +196 -0
- package/lib/langium/project/project-manager.d.ts.map +1 -0
- package/lib/langium/project/project-manager.js +10 -0
- package/lib/langium/project/project-manager.js.map +1 -0
- package/lib/langium/project/single-project-manager.d.ts +69 -0
- package/lib/langium/project/single-project-manager.d.ts.map +1 -0
- package/lib/langium/project/single-project-manager.js +104 -0
- package/lib/langium/project/single-project-manager.js.map +1 -0
- package/lib/langium/residency/cst-residency-service.d.ts +214 -0
- package/lib/langium/residency/cst-residency-service.d.ts.map +1 -0
- package/lib/langium/residency/cst-residency-service.js +349 -0
- package/lib/langium/residency/cst-residency-service.js.map +1 -0
- package/lib/langium/residency/index.d.ts +10 -0
- package/lib/langium/residency/index.d.ts.map +1 -0
- package/lib/langium/residency/index.js +10 -0
- package/lib/langium/residency/index.js.map +1 -0
- package/lib/langium/scope/ast-node-description-provider.d.ts +122 -0
- package/lib/langium/scope/ast-node-description-provider.d.ts.map +1 -0
- package/lib/langium/scope/ast-node-description-provider.js +115 -0
- package/lib/langium/scope/ast-node-description-provider.js.map +1 -0
- package/lib/langium/scope/hydranium-scope-computation.d.ts +163 -0
- package/lib/langium/scope/hydranium-scope-computation.d.ts.map +1 -0
- package/lib/langium/scope/hydranium-scope-computation.js +220 -0
- package/lib/langium/scope/hydranium-scope-computation.js.map +1 -0
- package/lib/langium/scope/hydranium-scope-provider.d.ts +411 -0
- package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -0
- package/lib/langium/scope/hydranium-scope-provider.js +543 -0
- package/lib/langium/scope/hydranium-scope-provider.js.map +1 -0
- package/lib/langium/scope/index.d.ts +18 -0
- package/lib/langium/scope/index.d.ts.map +1 -0
- package/lib/langium/scope/index.js +18 -0
- package/lib/langium/scope/index.js.map +1 -0
- package/lib/langium/scope/reference-builder.d.ts +125 -0
- package/lib/langium/scope/reference-builder.d.ts.map +1 -0
- package/lib/langium/scope/reference-builder.js +115 -0
- package/lib/langium/scope/reference-builder.js.map +1 -0
- package/lib/langium/scope/reference-candidate-provider.d.ts +228 -0
- package/lib/langium/scope/reference-candidate-provider.d.ts.map +1 -0
- package/lib/langium/scope/reference-candidate-provider.js +185 -0
- package/lib/langium/scope/reference-candidate-provider.js.map +1 -0
- package/lib/langium/scope/scope-extension-contribution.d.ts +32 -0
- package/lib/langium/scope/scope-extension-contribution.d.ts.map +1 -0
- package/lib/langium/scope/scope-extension-contribution.js +10 -0
- package/lib/langium/scope/scope-extension-contribution.js.map +1 -0
- package/lib/langium/scope/scope-extension-service.d.ts +149 -0
- package/lib/langium/scope/scope-extension-service.d.ts.map +1 -0
- package/lib/langium/scope/scope-extension-service.js +94 -0
- package/lib/langium/scope/scope-extension-service.js.map +1 -0
- package/lib/langium/scope/scoped-ast-node-description.d.ts +160 -0
- package/lib/langium/scope/scoped-ast-node-description.d.ts.map +1 -0
- package/lib/langium/scope/scoped-ast-node-description.js +98 -0
- package/lib/langium/scope/scoped-ast-node-description.js.map +1 -0
- package/lib/langium/scope/tier-specificity.d.ts +47 -0
- package/lib/langium/scope/tier-specificity.d.ts.map +1 -0
- package/lib/langium/scope/tier-specificity.js +83 -0
- package/lib/langium/scope/tier-specificity.js.map +1 -0
- package/lib/langium/serialization/abstract-serializer.d.ts +316 -0
- package/lib/langium/serialization/abstract-serializer.d.ts.map +1 -0
- package/lib/langium/serialization/abstract-serializer.js +351 -0
- package/lib/langium/serialization/abstract-serializer.js.map +1 -0
- package/lib/langium/serialization/index.d.ts +14 -0
- package/lib/langium/serialization/index.d.ts.map +1 -0
- package/lib/langium/serialization/index.js +14 -0
- package/lib/langium/serialization/index.js.map +1 -0
- package/lib/langium/serialization/json-serializer.d.ts +106 -0
- package/lib/langium/serialization/json-serializer.d.ts.map +1 -0
- package/lib/langium/serialization/json-serializer.js +198 -0
- package/lib/langium/serialization/json-serializer.js.map +1 -0
- package/lib/langium/serialization/serialization-util.d.ts +29 -0
- package/lib/langium/serialization/serialization-util.d.ts.map +1 -0
- package/lib/langium/serialization/serialization-util.js +37 -0
- package/lib/langium/serialization/serialization-util.js.map +1 -0
- package/lib/langium/serialization/serializer.d.ts +66 -0
- package/lib/langium/serialization/serializer.d.ts.map +1 -0
- package/lib/langium/serialization/serializer.js +10 -0
- package/lib/langium/serialization/serializer.js.map +1 -0
- package/lib/langium/serialization/yaml-serializer.d.ts +166 -0
- package/lib/langium/serialization/yaml-serializer.d.ts.map +1 -0
- package/lib/langium/serialization/yaml-serializer.js +228 -0
- package/lib/langium/serialization/yaml-serializer.js.map +1 -0
- package/lib/langium/service-registry.d.ts +220 -0
- package/lib/langium/service-registry.d.ts.map +1 -0
- package/lib/langium/service-registry.js +258 -0
- package/lib/langium/service-registry.js.map +1 -0
- package/lib/langium/shared-services.d.ts +98 -0
- package/lib/langium/shared-services.d.ts.map +1 -0
- package/lib/langium/shared-services.js +30 -0
- package/lib/langium/shared-services.js.map +1 -0
- package/lib/langium/transfer/index.d.ts +10 -0
- package/lib/langium/transfer/index.d.ts.map +1 -0
- package/lib/langium/transfer/index.js +10 -0
- package/lib/langium/transfer/index.js.map +1 -0
- package/lib/langium/transfer/transfer-encoder.d.ts +294 -0
- package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -0
- package/lib/langium/transfer/transfer-encoder.js +328 -0
- package/lib/langium/transfer/transfer-encoder.js.map +1 -0
- package/lib/langium/update-rewrite/index.d.ts +14 -0
- package/lib/langium/update-rewrite/index.d.ts.map +1 -0
- package/lib/langium/update-rewrite/index.js +14 -0
- package/lib/langium/update-rewrite/index.js.map +1 -0
- package/lib/langium/update-rewrite/normalize-empty-strings.d.ts +52 -0
- package/lib/langium/update-rewrite/normalize-empty-strings.d.ts.map +1 -0
- package/lib/langium/update-rewrite/normalize-empty-strings.js +83 -0
- package/lib/langium/update-rewrite/normalize-empty-strings.js.map +1 -0
- package/lib/langium/update-rewrite/semantic-root-rewrite.d.ts +37 -0
- package/lib/langium/update-rewrite/semantic-root-rewrite.d.ts.map +1 -0
- package/lib/langium/update-rewrite/semantic-root-rewrite.js +51 -0
- package/lib/langium/update-rewrite/semantic-root-rewrite.js.map +1 -0
- package/lib/langium/update-rewrite/update-rewrite-contribution.d.ts +42 -0
- package/lib/langium/update-rewrite/update-rewrite-contribution.d.ts.map +1 -0
- package/lib/langium/update-rewrite/update-rewrite-contribution.js +10 -0
- package/lib/langium/update-rewrite/update-rewrite-contribution.js.map +1 -0
- package/lib/langium/update-rewrite/update-rewrite-service.d.ts +89 -0
- package/lib/langium/update-rewrite/update-rewrite-service.d.ts.map +1 -0
- package/lib/langium/update-rewrite/update-rewrite-service.js +75 -0
- package/lib/langium/update-rewrite/update-rewrite-service.js.map +1 -0
- package/lib/langium/update-rewrite/update-rewrite.d.ts +59 -0
- package/lib/langium/update-rewrite/update-rewrite.d.ts.map +1 -0
- package/lib/langium/update-rewrite/update-rewrite.js +10 -0
- package/lib/langium/update-rewrite/update-rewrite.js.map +1 -0
- package/lib/langium/validation/document-validator.d.ts +106 -0
- package/lib/langium/validation/document-validator.d.ts.map +1 -0
- package/lib/langium/validation/document-validator.js +118 -0
- package/lib/langium/validation/document-validator.js.map +1 -0
- package/lib/langium/validation/index.d.ts +12 -0
- package/lib/langium/validation/index.d.ts.map +1 -0
- package/lib/langium/validation/index.js +12 -0
- package/lib/langium/validation/index.js.map +1 -0
- package/lib/langium/validation/validation-contribution-collector.d.ts +34 -0
- package/lib/langium/validation/validation-contribution-collector.d.ts.map +1 -0
- package/lib/langium/validation/validation-contribution-collector.js +51 -0
- package/lib/langium/validation/validation-contribution-collector.js.map +1 -0
- package/lib/langium/validation/validation-contribution.d.ts +36 -0
- package/lib/langium/validation/validation-contribution.d.ts.map +1 -0
- package/lib/langium/validation/validation-contribution.js +10 -0
- package/lib/langium/validation/validation-contribution.js.map +1 -0
- package/lib/langium/workspace/additional-document-contribution.d.ts +68 -0
- package/lib/langium/workspace/additional-document-contribution.d.ts.map +1 -0
- package/lib/langium/workspace/additional-document-contribution.js +23 -0
- package/lib/langium/workspace/additional-document-contribution.js.map +1 -0
- package/lib/langium/workspace/document-uri-policy.d.ts +151 -0
- package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -0
- package/lib/langium/workspace/document-uri-policy.js +121 -0
- package/lib/langium/workspace/document-uri-policy.js.map +1 -0
- package/lib/langium/workspace/file-system-provider.d.ts +30 -0
- package/lib/langium/workspace/file-system-provider.d.ts.map +1 -0
- package/lib/langium/workspace/file-system-provider.js +41 -0
- package/lib/langium/workspace/file-system-provider.js.map +1 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts +45 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.js +64 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -0
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts +31 -0
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts.map +1 -0
- package/lib/langium/workspace/hydranium-workspace-lock.js +33 -0
- package/lib/langium/workspace/hydranium-workspace-lock.js.map +1 -0
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts +232 -0
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -0
- package/lib/langium/workspace/hydranium-workspace-manager.js +368 -0
- package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -0
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts +127 -0
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -0
- package/lib/langium/workspace/in-memory-file-system-provider.js +195 -0
- package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -0
- package/lib/langium/workspace/index-manager.d.ts +142 -0
- package/lib/langium/workspace/index-manager.d.ts.map +1 -0
- package/lib/langium/workspace/index-manager.js +245 -0
- package/lib/langium/workspace/index-manager.js.map +1 -0
- package/lib/langium/workspace/index.d.ts +23 -0
- package/lib/langium/workspace/index.d.ts.map +1 -0
- package/lib/langium/workspace/index.js +23 -0
- package/lib/langium/workspace/index.js.map +1 -0
- package/lib/langium/workspace/initialize-workspace.d.ts +63 -0
- package/lib/langium/workspace/initialize-workspace.d.ts.map +1 -0
- package/lib/langium/workspace/initialize-workspace.js +88 -0
- package/lib/langium/workspace/initialize-workspace.js.map +1 -0
- package/lib/langium/workspace/langium-documents.d.ts +47 -0
- package/lib/langium/workspace/langium-documents.d.ts.map +1 -0
- package/lib/langium/workspace/langium-documents.js +85 -0
- package/lib/langium/workspace/langium-documents.js.map +1 -0
- package/lib/langium/workspace/persistent-file-system-provider.d.ts +207 -0
- package/lib/langium/workspace/persistent-file-system-provider.d.ts.map +1 -0
- package/lib/langium/workspace/persistent-file-system-provider.js +208 -0
- package/lib/langium/workspace/persistent-file-system-provider.js.map +1 -0
- package/lib/langium/workspace/synthetic.d.ts +38 -0
- package/lib/langium/workspace/synthetic.d.ts.map +1 -0
- package/lib/langium/workspace/synthetic.js +58 -0
- package/lib/langium/workspace/synthetic.js.map +1 -0
- package/lib/langium/workspace/virtual-document.d.ts +78 -0
- package/lib/langium/workspace/virtual-document.d.ts.map +1 -0
- package/lib/langium/workspace/virtual-document.js +89 -0
- package/lib/langium/workspace/virtual-document.js.map +1 -0
- package/lib/langium/workspace/write-lock-scope.d.ts +69 -0
- package/lib/langium/workspace/write-lock-scope.d.ts.map +1 -0
- package/lib/langium/workspace/write-lock-scope.js +54 -0
- package/lib/langium/workspace/write-lock-scope.js.map +1 -0
- package/lib/launcher/index.d.ts +10 -0
- package/lib/launcher/index.d.ts.map +1 -0
- package/lib/launcher/index.js +12 -0
- package/lib/launcher/index.js.map +1 -0
- package/lib/launcher/integrated-server.d.ts +28 -0
- package/lib/launcher/integrated-server.d.ts.map +1 -0
- package/lib/launcher/integrated-server.js +10 -0
- package/lib/launcher/integrated-server.js.map +1 -0
- package/lib/lsp/completion/hydranium-completion-provider.d.ts +89 -0
- package/lib/lsp/completion/hydranium-completion-provider.d.ts.map +1 -0
- package/lib/lsp/completion/hydranium-completion-provider.js +123 -0
- package/lib/lsp/completion/hydranium-completion-provider.js.map +1 -0
- package/lib/lsp/hydranium-document-update-handler.d.ts +204 -0
- package/lib/lsp/hydranium-document-update-handler.d.ts.map +1 -0
- package/lib/lsp/hydranium-document-update-handler.js +288 -0
- package/lib/lsp/hydranium-document-update-handler.js.map +1 -0
- package/lib/lsp/index.d.ts +23 -0
- package/lib/lsp/index.d.ts.map +1 -0
- package/lib/lsp/index.js +23 -0
- package/lib/lsp/index.js.map +1 -0
- package/lib/lsp/instrument-connection.d.ts +36 -0
- package/lib/lsp/instrument-connection.d.ts.map +1 -0
- package/lib/lsp/instrument-connection.js +62 -0
- package/lib/lsp/instrument-connection.js.map +1 -0
- package/lib/lsp/language-module.d.ts +53 -0
- package/lib/lsp/language-module.d.ts.map +1 -0
- package/lib/lsp/language-module.js +28 -0
- package/lib/lsp/language-module.js.map +1 -0
- package/lib/lsp/semantic-token-provider.d.ts +131 -0
- package/lib/lsp/semantic-token-provider.d.ts.map +1 -0
- package/lib/lsp/semantic-token-provider.js +148 -0
- package/lib/lsp/semantic-token-provider.js.map +1 -0
- package/lib/lsp/shared-module.d.ts +76 -0
- package/lib/lsp/shared-module.d.ts.map +1 -0
- package/lib/lsp/shared-module.js +33 -0
- package/lib/lsp/shared-module.js.map +1 -0
- package/lib/lsp/start-language-server.d.ts +43 -0
- package/lib/lsp/start-language-server.d.ts.map +1 -0
- package/lib/lsp/start-language-server.js +60 -0
- package/lib/lsp/start-language-server.js.map +1 -0
- package/lib/node/ast-ground-truth.d.ts +57 -0
- package/lib/node/ast-ground-truth.d.ts.map +1 -0
- package/lib/node/ast-ground-truth.js +46 -0
- package/lib/node/ast-ground-truth.js.map +1 -0
- package/lib/node/event-loop-monitor.d.ts +40 -0
- package/lib/node/event-loop-monitor.d.ts.map +1 -0
- package/lib/node/event-loop-monitor.js +62 -0
- package/lib/node/event-loop-monitor.js.map +1 -0
- package/lib/node/index.d.ts +29 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +50 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/latency-from-env.d.ts +32 -0
- package/lib/node/latency-from-env.d.ts.map +1 -0
- package/lib/node/latency-from-env.js +36 -0
- package/lib/node/latency-from-env.js.map +1 -0
- package/lib/node/lint-grammar.d.ts +87 -0
- package/lib/node/lint-grammar.d.ts.map +1 -0
- package/lib/node/lint-grammar.js +124 -0
- package/lib/node/lint-grammar.js.map +1 -0
- package/lib/node/log-file-sink.d.ts +22 -0
- package/lib/node/log-file-sink.d.ts.map +1 -0
- package/lib/node/log-file-sink.js +43 -0
- package/lib/node/log-file-sink.js.map +1 -0
- package/lib/node/log-preamble-node.d.ts +28 -0
- package/lib/node/log-preamble-node.d.ts.map +1 -0
- package/lib/node/log-preamble-node.js +55 -0
- package/lib/node/log-preamble-node.js.map +1 -0
- package/lib/node/measure-memory.d.ts +86 -0
- package/lib/node/measure-memory.d.ts.map +1 -0
- package/lib/node/measure-memory.js +128 -0
- package/lib/node/measure-memory.js.map +1 -0
- package/lib/node/memory-monitor.d.ts +42 -0
- package/lib/node/memory-monitor.d.ts.map +1 -0
- package/lib/node/memory-monitor.js +83 -0
- package/lib/node/memory-monitor.js.map +1 -0
- package/lib/node/node-file-system-provider.d.ts +112 -0
- package/lib/node/node-file-system-provider.d.ts.map +1 -0
- package/lib/node/node-file-system-provider.js +230 -0
- package/lib/node/node-file-system-provider.js.map +1 -0
- package/lib/node/process-memory.d.ts +66 -0
- package/lib/node/process-memory.d.ts.map +1 -0
- package/lib/node/process-memory.js +252 -0
- package/lib/node/process-memory.js.map +1 -0
- package/lib/node/profile-capture.d.ts +118 -0
- package/lib/node/profile-capture.d.ts.map +1 -0
- package/lib/node/profile-capture.js +315 -0
- package/lib/node/profile-capture.js.map +1 -0
- package/lib/node/profile-digest.d.ts +49 -0
- package/lib/node/profile-digest.d.ts.map +1 -0
- package/lib/node/profile-digest.js +74 -0
- package/lib/node/profile-digest.js.map +1 -0
- package/lib/node/profiling-run.d.ts +80 -0
- package/lib/node/profiling-run.d.ts.map +1 -0
- package/lib/node/profiling-run.js +183 -0
- package/lib/node/profiling-run.js.map +1 -0
- package/lib/node/reflect-grammar.d.ts +109 -0
- package/lib/node/reflect-grammar.d.ts.map +1 -0
- package/lib/node/reflect-grammar.js +96 -0
- package/lib/node/reflect-grammar.js.map +1 -0
- package/lib/node/server-diagnostics.d.ts +43 -0
- package/lib/node/server-diagnostics.d.ts.map +1 -0
- package/lib/node/server-diagnostics.js +46 -0
- package/lib/node/server-diagnostics.js.map +1 -0
- package/lib/node/server-state-snapshot.d.ts +48 -0
- package/lib/node/server-state-snapshot.d.ts.map +1 -0
- package/lib/node/server-state-snapshot.js +139 -0
- package/lib/node/server-state-snapshot.js.map +1 -0
- package/lib/node/socket-launcher.d.ts +106 -0
- package/lib/node/socket-launcher.d.ts.map +1 -0
- package/lib/node/socket-launcher.js +138 -0
- package/lib/node/socket-launcher.js.map +1 -0
- package/lib/node/stdio-launcher.d.ts +88 -0
- package/lib/node/stdio-launcher.d.ts.map +1 -0
- package/lib/node/stdio-launcher.js +83 -0
- package/lib/node/stdio-launcher.js.map +1 -0
- package/lib/node/validate-workspace.d.ts +80 -0
- package/lib/node/validate-workspace.d.ts.map +1 -0
- package/lib/node/validate-workspace.js +72 -0
- package/lib/node/validate-workspace.js.map +1 -0
- package/lib/node/write-lock-scope-node.d.ts +27 -0
- package/lib/node/write-lock-scope-node.d.ts.map +1 -0
- package/lib/node/write-lock-scope-node.js +38 -0
- package/lib/node/write-lock-scope-node.js.map +1 -0
- package/lib/testing/ast-snapshot.d.ts +38 -0
- package/lib/testing/ast-snapshot.d.ts.map +1 -0
- package/lib/testing/ast-snapshot.js +78 -0
- package/lib/testing/ast-snapshot.js.map +1 -0
- package/lib/testing/document-uri-policy-conformance.d.ts +65 -0
- package/lib/testing/document-uri-policy-conformance.d.ts.map +1 -0
- package/lib/testing/document-uri-policy-conformance.js +69 -0
- package/lib/testing/document-uri-policy-conformance.js.map +1 -0
- package/lib/testing/fake-description.d.ts +35 -0
- package/lib/testing/fake-description.d.ts.map +1 -0
- package/lib/testing/fake-description.js +38 -0
- package/lib/testing/fake-description.js.map +1 -0
- package/lib/testing/fake-document.d.ts +71 -0
- package/lib/testing/fake-document.d.ts.map +1 -0
- package/lib/testing/fake-document.js +85 -0
- package/lib/testing/fake-document.js.map +1 -0
- package/lib/testing/fake-reflection.d.ts +29 -0
- package/lib/testing/fake-reflection.d.ts.map +1 -0
- package/lib/testing/fake-reflection.js +30 -0
- package/lib/testing/fake-reflection.js.map +1 -0
- package/lib/testing/index.d.ts +44 -0
- package/lib/testing/index.d.ts.map +1 -0
- package/lib/testing/index.js +44 -0
- package/lib/testing/index.js.map +1 -0
- package/lib/testing/langium-test-helpers.d.ts +26 -0
- package/lib/testing/langium-test-helpers.d.ts.map +1 -0
- package/lib/testing/langium-test-helpers.js +26 -0
- package/lib/testing/langium-test-helpers.js.map +1 -0
- package/lib/testing/make-noop-language-services.d.ts +39 -0
- package/lib/testing/make-noop-language-services.d.ts.map +1 -0
- package/lib/testing/make-noop-language-services.js +30 -0
- package/lib/testing/make-noop-language-services.js.map +1 -0
- package/lib/testing/make-noop-shared-services.d.ts +61 -0
- package/lib/testing/make-noop-shared-services.d.ts.map +1 -0
- package/lib/testing/make-noop-shared-services.js +49 -0
- package/lib/testing/make-noop-shared-services.js.map +1 -0
- package/lib/testing/make-test-services.d.ts +217 -0
- package/lib/testing/make-test-services.d.ts.map +1 -0
- package/lib/testing/make-test-services.js +128 -0
- package/lib/testing/make-test-services.js.map +1 -0
- package/lib/testing/make-test-tracer.d.ts +67 -0
- package/lib/testing/make-test-tracer.d.ts.map +1 -0
- package/lib/testing/make-test-tracer.js +68 -0
- package/lib/testing/make-test-tracer.js.map +1 -0
- package/lib/testing/node/generated-workspace.d.ts +95 -0
- package/lib/testing/node/generated-workspace.d.ts.map +1 -0
- package/lib/testing/node/generated-workspace.js +134 -0
- package/lib/testing/node/generated-workspace.js.map +1 -0
- package/lib/testing/node/golden-corpus.d.ts +50 -0
- package/lib/testing/node/golden-corpus.d.ts.map +1 -0
- package/lib/testing/node/golden-corpus.js +80 -0
- package/lib/testing/node/golden-corpus.js.map +1 -0
- package/lib/testing/node/index.d.ts +28 -0
- package/lib/testing/node/index.d.ts.map +1 -0
- package/lib/testing/node/index.js +28 -0
- package/lib/testing/node/index.js.map +1 -0
- package/lib/testing/node/lsp-harness.d.ts +139 -0
- package/lib/testing/node/lsp-harness.d.ts.map +1 -0
- package/lib/testing/node/lsp-harness.js +119 -0
- package/lib/testing/node/lsp-harness.js.map +1 -0
- package/lib/testing/node/lsp-server-connection.d.ts +232 -0
- package/lib/testing/node/lsp-server-connection.d.ts.map +1 -0
- package/lib/testing/node/lsp-server-connection.js +304 -0
- package/lib/testing/node/lsp-server-connection.js.map +1 -0
- package/lib/testing/node/scratch-workspace.d.ts +60 -0
- package/lib/testing/node/scratch-workspace.d.ts.map +1 -0
- package/lib/testing/node/scratch-workspace.js +87 -0
- package/lib/testing/node/scratch-workspace.js.map +1 -0
- package/lib/testing/node/spawned-server.d.ts +170 -0
- package/lib/testing/node/spawned-server.d.ts.map +1 -0
- package/lib/testing/node/spawned-server.js +265 -0
- package/lib/testing/node/spawned-server.js.map +1 -0
- package/lib/testing/parse-semantic-root.d.ts +83 -0
- package/lib/testing/parse-semantic-root.d.ts.map +1 -0
- package/lib/testing/parse-semantic-root.js +119 -0
- package/lib/testing/parse-semantic-root.js.map +1 -0
- package/lib/testing/playwright/browser-capture-bridge.d.ts +80 -0
- package/lib/testing/playwright/browser-capture-bridge.d.ts.map +1 -0
- package/lib/testing/playwright/browser-capture-bridge.js +161 -0
- package/lib/testing/playwright/browser-capture-bridge.js.map +1 -0
- package/lib/testing/playwright/e2e-profiling.d.ts +132 -0
- package/lib/testing/playwright/e2e-profiling.d.ts.map +1 -0
- package/lib/testing/playwright/e2e-profiling.js +270 -0
- package/lib/testing/playwright/e2e-profiling.js.map +1 -0
- package/lib/testing/playwright/index.d.ts +13 -0
- package/lib/testing/playwright/index.d.ts.map +1 -0
- package/lib/testing/playwright/index.js +16 -0
- package/lib/testing/playwright/index.js.map +1 -0
- package/lib/testing/playwright/server-log-capture.d.ts +230 -0
- package/lib/testing/playwright/server-log-capture.d.ts.map +1 -0
- package/lib/testing/playwright/server-log-capture.js +336 -0
- package/lib/testing/playwright/server-log-capture.js.map +1 -0
- package/lib/testing/playwright/server-log-fixture.d.ts +36 -0
- package/lib/testing/playwright/server-log-fixture.d.ts.map +1 -0
- package/lib/testing/playwright/server-log-fixture.js +38 -0
- package/lib/testing/playwright/server-log-fixture.js.map +1 -0
- package/lib/testing/playwright/server-log-rename-reporter.d.ts +22 -0
- package/lib/testing/playwright/server-log-rename-reporter.d.ts.map +1 -0
- package/lib/testing/playwright/server-log-rename-reporter.js +26 -0
- package/lib/testing/playwright/server-log-rename-reporter.js.map +1 -0
- package/lib/testing/run-update-pipeline.d.ts +99 -0
- package/lib/testing/run-update-pipeline.d.ts.map +1 -0
- package/lib/testing/run-update-pipeline.js +24 -0
- package/lib/testing/run-update-pipeline.js.map +1 -0
- package/lib/testing/stub-ast-document-manager.d.ts +82 -0
- package/lib/testing/stub-ast-document-manager.d.ts.map +1 -0
- package/lib/testing/stub-ast-document-manager.js +125 -0
- package/lib/testing/stub-ast-document-manager.js.map +1 -0
- package/lib/testing/stub-document-builder.d.ts +99 -0
- package/lib/testing/stub-document-builder.d.ts.map +1 -0
- package/lib/testing/stub-document-builder.js +142 -0
- package/lib/testing/stub-document-builder.js.map +1 -0
- package/lib/testing/stub-hydranium-text-documents.d.ts +125 -0
- package/lib/testing/stub-hydranium-text-documents.d.ts.map +1 -0
- package/lib/testing/stub-hydranium-text-documents.js +164 -0
- package/lib/testing/stub-hydranium-text-documents.js.map +1 -0
- package/lib/testing/stub-index-manager.d.ts +40 -0
- package/lib/testing/stub-index-manager.d.ts.map +1 -0
- package/lib/testing/stub-index-manager.js +38 -0
- package/lib/testing/stub-index-manager.js.map +1 -0
- package/lib/testing/stub-langium-documents.d.ts +53 -0
- package/lib/testing/stub-langium-documents.d.ts.map +1 -0
- package/lib/testing/stub-langium-documents.js +62 -0
- package/lib/testing/stub-langium-documents.js.map +1 -0
- package/lib/testing/stub-model-service.d.ts +31 -0
- package/lib/testing/stub-model-service.d.ts.map +1 -0
- package/lib/testing/stub-model-service.js +45 -0
- package/lib/testing/stub-model-service.js.map +1 -0
- package/lib/testing/stub-project-manager.d.ts +43 -0
- package/lib/testing/stub-project-manager.d.ts.map +1 -0
- package/lib/testing/stub-project-manager.js +125 -0
- package/lib/testing/stub-project-manager.js.map +1 -0
- package/lib/testing/stub-self-save-registry.d.ts +31 -0
- package/lib/testing/stub-self-save-registry.d.ts.map +1 -0
- package/lib/testing/stub-self-save-registry.js +23 -0
- package/lib/testing/stub-self-save-registry.js.map +1 -0
- package/lib/testing/stub-service-registry.d.ts +95 -0
- package/lib/testing/stub-service-registry.d.ts.map +1 -0
- package/lib/testing/stub-service-registry.js +108 -0
- package/lib/testing/stub-service-registry.js.map +1 -0
- package/lib/testing/stub-writable-file-system.d.ts +42 -0
- package/lib/testing/stub-writable-file-system.d.ts.map +1 -0
- package/lib/testing/stub-writable-file-system.js +26 -0
- package/lib/testing/stub-writable-file-system.js.map +1 -0
- package/lib/util/connection-liveness.d.ts +25 -0
- package/lib/util/connection-liveness.d.ts.map +1 -0
- package/lib/util/connection-liveness.js +46 -0
- package/lib/util/connection-liveness.js.map +1 -0
- package/lib/util/environment.d.ts +53 -0
- package/lib/util/environment.d.ts.map +1 -0
- package/lib/util/environment.js +78 -0
- package/lib/util/environment.js.map +1 -0
- package/lib/util/index.d.ts +13 -0
- package/lib/util/index.d.ts.map +1 -0
- package/lib/util/index.js +18 -0
- package/lib/util/index.js.map +1 -0
- package/lib/util/registry.d.ts +88 -0
- package/lib/util/registry.d.ts.map +1 -0
- package/lib/util/registry.js +105 -0
- package/lib/util/registry.js.map +1 -0
- package/package.json +134 -0
- package/src/documents/ast-document-manager.ts +455 -0
- package/src/documents/client-ids.ts +33 -0
- package/src/documents/hydranium-text-documents.ts +1142 -0
- package/src/documents/index.ts +14 -0
- package/src/documents/language-client-text-shadow.ts +175 -0
- package/src/documents/self-save-registry.ts +81 -0
- package/src/index.ts +39 -0
- package/src/langium/ast-extension/ast-extension-contribution.ts +35 -0
- package/src/langium/ast-extension/ast-extension-service.ts +311 -0
- package/src/langium/ast-extension/ast-node-builder.ts +125 -0
- package/src/langium/ast-extension/index.ts +12 -0
- package/src/langium/bootstrap.ts +600 -0
- package/src/langium/build-phase-pass/build-phase-pass-service.ts +141 -0
- package/src/langium/build-phase-pass/build-phase-pass.ts +123 -0
- package/src/langium/build-phase-pass/index.ts +11 -0
- package/src/langium/config/index.ts +10 -0
- package/src/langium/config/settings.ts +353 -0
- package/src/langium/diagnostics/hydranium-langium-profiler.ts +187 -0
- package/src/langium/diagnostics/index.ts +19 -0
- package/src/langium/diagnostics/log-file-token.ts +26 -0
- package/src/langium/diagnostics/log-preamble.ts +87 -0
- package/src/langium/diagnostics/logger.ts +246 -0
- package/src/langium/diagnostics/lsp-logger.ts +277 -0
- package/src/langium/diagnostics/server-tracer.ts +73 -0
- package/src/langium/document-builder/build-pipeline-integration.ts +193 -0
- package/src/langium/document-builder/document-builder.ts +839 -0
- package/src/langium/document-builder/index.ts +12 -0
- package/src/langium/document-builder/labeled-phase-listener.ts +26 -0
- package/src/langium/documentation/comment-provider.ts +37 -0
- package/src/langium/documentation/index.ts +10 -0
- package/src/langium/integration-services.ts +281 -0
- package/src/langium/integrity/index.ts +12 -0
- package/src/langium/integrity/integrity-contribution.ts +44 -0
- package/src/langium/integrity/integrity-rule.ts +100 -0
- package/src/langium/integrity/integrity-service.ts +423 -0
- package/src/langium/keys/default-element-key-provider.ts +20 -0
- package/src/langium/keys/element-key-provider.ts +114 -0
- package/src/langium/keys/index.ts +13 -0
- package/src/langium/keys/name-based-key-provider.ts +146 -0
- package/src/langium/keys/positional-key-provider.ts +57 -0
- package/src/langium/labeling/index.ts +10 -0
- package/src/langium/labeling/label-provider.ts +110 -0
- package/src/langium/language-module.ts +367 -0
- package/src/langium/language-types.ts +214 -0
- package/src/langium/model-service/index.ts +10 -0
- package/src/langium/model-service/model-service.ts +1051 -0
- package/src/langium/module.ts +446 -0
- package/src/langium/naming/index.ts +11 -0
- package/src/langium/naming/name-provider.ts +533 -0
- package/src/langium/naming/name-separator-validation.ts +73 -0
- package/src/langium/project/abstract-project-manager.ts +630 -0
- package/src/langium/project/index.ts +13 -0
- package/src/langium/project/project-change-event.ts +66 -0
- package/src/langium/project/project-manager.ts +221 -0
- package/src/langium/project/single-project-manager.ts +126 -0
- package/src/langium/residency/cst-residency-service.ts +412 -0
- package/src/langium/residency/index.ts +10 -0
- package/src/langium/scope/ast-node-description-provider.ts +141 -0
- package/src/langium/scope/hydranium-scope-computation.ts +246 -0
- package/src/langium/scope/hydranium-scope-provider.ts +659 -0
- package/src/langium/scope/index.ts +18 -0
- package/src/langium/scope/reference-builder.ts +194 -0
- package/src/langium/scope/reference-candidate-provider.ts +314 -0
- package/src/langium/scope/scope-extension-contribution.ts +34 -0
- package/src/langium/scope/scope-extension-service.ts +207 -0
- package/src/langium/scope/scoped-ast-node-description.ts +174 -0
- package/src/langium/scope/tier-specificity.ts +89 -0
- package/src/langium/serialization/abstract-serializer.ts +474 -0
- package/src/langium/serialization/index.ts +14 -0
- package/src/langium/serialization/json-serializer.ts +264 -0
- package/src/langium/serialization/serialization-util.ts +40 -0
- package/src/langium/serialization/serializer.ts +68 -0
- package/src/langium/serialization/yaml-serializer.ts +348 -0
- package/src/langium/service-registry.ts +323 -0
- package/src/langium/shared-services.ts +107 -0
- package/src/langium/transfer/index.ts +10 -0
- package/src/langium/transfer/transfer-encoder.ts +434 -0
- package/src/langium/update-rewrite/index.ts +14 -0
- package/src/langium/update-rewrite/normalize-empty-strings.ts +86 -0
- package/src/langium/update-rewrite/semantic-root-rewrite.ts +57 -0
- package/src/langium/update-rewrite/update-rewrite-contribution.ts +44 -0
- package/src/langium/update-rewrite/update-rewrite-service.ts +129 -0
- package/src/langium/update-rewrite/update-rewrite.ts +60 -0
- package/src/langium/validation/document-validator.ts +188 -0
- package/src/langium/validation/index.ts +12 -0
- package/src/langium/validation/validation-contribution-collector.ts +61 -0
- package/src/langium/validation/validation-contribution.ts +38 -0
- package/src/langium/workspace/additional-document-contribution.ts +80 -0
- package/src/langium/workspace/document-uri-policy.ts +187 -0
- package/src/langium/workspace/file-system-provider.ts +52 -0
- package/src/langium/workspace/hydranium-langium-document-factory.ts +78 -0
- package/src/langium/workspace/hydranium-workspace-lock.ts +35 -0
- package/src/langium/workspace/hydranium-workspace-manager.ts +412 -0
- package/src/langium/workspace/in-memory-file-system-provider.ts +241 -0
- package/src/langium/workspace/index-manager.ts +266 -0
- package/src/langium/workspace/index.ts +23 -0
- package/src/langium/workspace/initialize-workspace.ts +102 -0
- package/src/langium/workspace/langium-documents.ts +94 -0
- package/src/langium/workspace/persistent-file-system-provider.ts +287 -0
- package/src/langium/workspace/synthetic.ts +63 -0
- package/src/langium/workspace/virtual-document.ts +94 -0
- package/src/langium/workspace/write-lock-scope.ts +88 -0
- package/src/launcher/index.ts +12 -0
- package/src/launcher/integrated-server.ts +28 -0
- package/src/lsp/completion/hydranium-completion-provider.ts +132 -0
- package/src/lsp/hydranium-document-update-handler.ts +345 -0
- package/src/lsp/index.ts +24 -0
- package/src/lsp/instrument-connection.ts +66 -0
- package/src/lsp/language-module.ts +64 -0
- package/src/lsp/semantic-token-provider.ts +215 -0
- package/src/lsp/shared-module.ts +88 -0
- package/src/lsp/start-language-server.ts +68 -0
- package/src/node/ast-ground-truth.ts +76 -0
- package/src/node/event-loop-monitor.ts +89 -0
- package/src/node/index.ts +53 -0
- package/src/node/latency-from-env.ts +39 -0
- package/src/node/lint-grammar.ts +189 -0
- package/src/node/log-file-sink.ts +43 -0
- package/src/node/log-preamble-node.ts +63 -0
- package/src/node/measure-memory.ts +196 -0
- package/src/node/memory-monitor.ts +103 -0
- package/src/node/node-file-system-provider.ts +252 -0
- package/src/node/process-memory.ts +299 -0
- package/src/node/profile-capture.ts +377 -0
- package/src/node/profile-digest.ts +112 -0
- package/src/node/profiling-run.ts +236 -0
- package/src/node/reflect-grammar.ts +182 -0
- package/src/node/server-diagnostics.ts +63 -0
- package/src/node/server-state-snapshot.ts +192 -0
- package/src/node/socket-launcher.ts +210 -0
- package/src/node/stdio-launcher.ts +150 -0
- package/src/node/validate-workspace.ts +133 -0
- package/src/node/write-lock-scope-node.ts +41 -0
- package/src/testing/ast-snapshot.ts +88 -0
- package/src/testing/document-uri-policy-conformance.ts +104 -0
- package/src/testing/fake-description.ts +52 -0
- package/src/testing/fake-document.ts +120 -0
- package/src/testing/fake-reflection.ts +39 -0
- package/src/testing/index.ts +45 -0
- package/src/testing/langium-test-helpers.ts +26 -0
- package/src/testing/make-noop-language-services.ts +47 -0
- package/src/testing/make-noop-shared-services.ts +78 -0
- package/src/testing/make-test-services.ts +356 -0
- package/src/testing/make-test-tracer.ts +92 -0
- package/src/testing/node/generated-workspace.ts +222 -0
- package/src/testing/node/golden-corpus.ts +114 -0
- package/src/testing/node/index.ts +29 -0
- package/src/testing/node/lsp-harness.ts +230 -0
- package/src/testing/node/lsp-server-connection.ts +575 -0
- package/src/testing/node/scratch-workspace.ts +137 -0
- package/src/testing/node/spawned-server.ts +447 -0
- package/src/testing/parse-semantic-root.ts +150 -0
- package/src/testing/playwright/browser-capture-bridge.ts +258 -0
- package/src/testing/playwright/e2e-profiling.ts +362 -0
- package/src/testing/playwright/index.ts +16 -0
- package/src/testing/playwright/server-log-capture.ts +433 -0
- package/src/testing/playwright/server-log-fixture.ts +57 -0
- package/src/testing/playwright/server-log-rename-reporter.ts +29 -0
- package/src/testing/run-update-pipeline.ts +113 -0
- package/src/testing/stub-ast-document-manager.ts +224 -0
- package/src/testing/stub-document-builder.ts +242 -0
- package/src/testing/stub-hydranium-text-documents.ts +270 -0
- package/src/testing/stub-index-manager.ts +79 -0
- package/src/testing/stub-langium-documents.ts +104 -0
- package/src/testing/stub-model-service.ts +72 -0
- package/src/testing/stub-project-manager.ts +161 -0
- package/src/testing/stub-self-save-registry.ts +43 -0
- package/src/testing/stub-service-registry.ts +192 -0
- package/src/testing/stub-writable-file-system.ts +58 -0
- package/src/util/connection-liveness.ts +47 -0
- package/src/util/environment.ts +88 -0
- package/src/util/index.ts +18 -0
- package/src/util/registry.ts +129 -0
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { type AstNode, type LangiumCoreServices, type Module } from '@hydranium/langium';
|
|
10
|
+
import { type LangiumServices, type PartialLangiumServices } from '@hydranium/langium/lsp';
|
|
11
|
+
import { type AstExtensionContribution } from './ast-extension/ast-extension-contribution.js';
|
|
12
|
+
import { type AstExtensionService } from './ast-extension/ast-extension-service.js';
|
|
13
|
+
import { type IntegrityRuleContribution } from './integrity/integrity-contribution.js';
|
|
14
|
+
import { type IntegrityService } from './integrity/integrity-service.js';
|
|
15
|
+
import { type ElementKeyProvider } from './keys/element-key-provider.js';
|
|
16
|
+
import { type LabelProvider } from './labeling/label-provider.js';
|
|
17
|
+
import { type NameProvider } from './naming/name-provider.js';
|
|
18
|
+
import { HydraniumAstNodeDescriptionProvider } from './scope/ast-node-description-provider.js';
|
|
19
|
+
import { type ReferenceCandidateProvider } from './scope/reference-candidate-provider.js';
|
|
20
|
+
import { HydraniumScopeComputation } from './scope/hydranium-scope-computation.js';
|
|
21
|
+
import { HydraniumScopeProvider } from './scope/hydranium-scope-provider.js';
|
|
22
|
+
import { type ReferenceBuilder } from './scope/reference-builder.js';
|
|
23
|
+
import { type ScopeExtensionContribution } from './scope/scope-extension-contribution.js';
|
|
24
|
+
import { type ScopeExtensionService } from './scope/scope-extension-service.js';
|
|
25
|
+
import { type Serializer } from './serialization/serializer.js';
|
|
26
|
+
import { type UpdateRewriteContribution } from './update-rewrite/update-rewrite-contribution.js';
|
|
27
|
+
import { type UpdateRewriteService } from './update-rewrite/update-rewrite-service.js';
|
|
28
|
+
import { type ValidationCheckContribution } from './validation/validation-contribution.js';
|
|
29
|
+
import { ValidationContributionCollector } from './validation/validation-contribution-collector.js';
|
|
30
|
+
import { type ServerModuleContext, type ServerSharedServices } from './module.js';
|
|
31
|
+
/**
|
|
32
|
+
* Language-level slots contributed by `@hydranium/core`. Bound by
|
|
33
|
+
* {@link createServerLanguageModule}; consumer modules layered after
|
|
34
|
+
* it can override any slot (later-wins, same composition idiom as the
|
|
35
|
+
* shared-module side).
|
|
36
|
+
*
|
|
37
|
+
* Only contains slots every protocol head shares. LSP-textual-specific
|
|
38
|
+
* bindings (e.g. `lsp.CompletionProvider`) belong to
|
|
39
|
+
* `@hydranium/core/lsp`; GLSP-, data-, and other-head-specific
|
|
40
|
+
* bindings live in their respective head packages.
|
|
41
|
+
*/
|
|
42
|
+
export interface ServerAddedServices {
|
|
43
|
+
references: {
|
|
44
|
+
ScopeComputation: HydraniumScopeComputation;
|
|
45
|
+
ScopeProvider: HydraniumScopeProvider;
|
|
46
|
+
/**
|
|
47
|
+
* Cross-reference candidate provider — owns the candidate-side
|
|
48
|
+
* completion pipeline (filter / dedupe / sort / build wire DTO).
|
|
49
|
+
* Adopters subclass {@link DefaultReferenceCandidateProvider}
|
|
50
|
+
* to override grammar-specific filters or label/value shaping.
|
|
51
|
+
* Default binding registers
|
|
52
|
+
* {@link DefaultReferenceCandidateProvider}.
|
|
53
|
+
*/
|
|
54
|
+
CandidateProvider: ReferenceCandidateProvider;
|
|
55
|
+
/**
|
|
56
|
+
* The naming axis — names that change on rename. A re-typed extension
|
|
57
|
+
* of Langium's `references.NameProvider` slot, bound by default to a
|
|
58
|
+
* {@link DefaultNameProvider} exposing the framework's three
|
|
59
|
+
* qualification levels ({@link NameProvider.getOwnName} /
|
|
60
|
+
* {@link NameProvider.getDocumentQualifiedName} /
|
|
61
|
+
* {@link NameProvider.getProjectQualifiedName}). Langium's linker and
|
|
62
|
+
* scope read `getName` through this slot, which defaults to
|
|
63
|
+
* `getProjectQualifiedName` (workspace-unique). Override to customise
|
|
64
|
+
* naming; identity that must survive a rename belongs to
|
|
65
|
+
* {@link ElementKeyProvider} instead.
|
|
66
|
+
*/
|
|
67
|
+
NameProvider: NameProvider;
|
|
68
|
+
/**
|
|
69
|
+
* The identity axis — stable identifiers that do NOT change on rename
|
|
70
|
+
* (GModel ids, UI selection persistence). Exposes
|
|
71
|
+
* {@link ElementKeyProvider.getElementKey} plus the hooks of the
|
|
72
|
+
* resolving walk. A framework-only slot kept separate from
|
|
73
|
+
* {@link NameProvider} so an adopter customises one axis without
|
|
74
|
+
* disturbing the other.
|
|
75
|
+
*/
|
|
76
|
+
ElementKeyProvider: ElementKeyProvider;
|
|
77
|
+
/**
|
|
78
|
+
* Labeling service — the UI axis (human-readable display strings),
|
|
79
|
+
* sibling to {@link NameProvider} (the identifier axis). Read by the
|
|
80
|
+
* candidate provider for completion labels and by adopter GModel
|
|
81
|
+
* factories for diagram text. Default binding registers
|
|
82
|
+
* {@link DefaultLabelProvider} (reads `labelProperties: ['name']`).
|
|
83
|
+
*/
|
|
84
|
+
LabelProvider: LabelProvider;
|
|
85
|
+
/**
|
|
86
|
+
* Reference-construction service — turns (target, source) into the
|
|
87
|
+
* `$refText` an author would type / a Langium `Reference`. The
|
|
88
|
+
* construction dual of `ScopeProvider` / `CandidateProvider`
|
|
89
|
+
* (which resolve references); reads names from {@link NameProvider} and
|
|
90
|
+
* visibility from `ProjectManager`. Default binding registers
|
|
91
|
+
* {@link DefaultReferenceBuilder}; adopters override
|
|
92
|
+
* {@link DefaultReferenceBuilder.encodeRefText} for `$refText` escaping.
|
|
93
|
+
*/
|
|
94
|
+
ReferenceBuilder: ReferenceBuilder;
|
|
95
|
+
/**
|
|
96
|
+
* Per-language dynamic scope contributions — extra resolvable
|
|
97
|
+
* descriptions layered on top of the scope `getScope` computes. Read
|
|
98
|
+
* by {@link HydraniumScopeProvider.getScope}; lives here alongside the
|
|
99
|
+
* other scope-resolution services. The service reads its
|
|
100
|
+
* `scopes` contribution group at construction.
|
|
101
|
+
*/
|
|
102
|
+
ScopeExtensionService: ScopeExtensionService;
|
|
103
|
+
/**
|
|
104
|
+
* Declarative {@link ScopeExtensionContribution} group. Each sub-key
|
|
105
|
+
* binds a contribution; the {@link ScopeExtensionService} iterates this
|
|
106
|
+
* group at construction and calls each contribution's
|
|
107
|
+
* `registerScopeExtensions(registry)`. Distinct sub-keys accumulate
|
|
108
|
+
* across framework + adopter modules via Langium's deep-merge.
|
|
109
|
+
* Same-keyed entries last-wins; the framework binds its own
|
|
110
|
+
* contributions under a `framework` sub-key — adopters MUST avoid
|
|
111
|
+
* that literal key.
|
|
112
|
+
*/
|
|
113
|
+
scopes: Record<string, ScopeExtensionContribution>;
|
|
114
|
+
};
|
|
115
|
+
workspace: {
|
|
116
|
+
AstNodeDescriptionProvider: HydraniumAstNodeDescriptionProvider;
|
|
117
|
+
};
|
|
118
|
+
ast: {
|
|
119
|
+
/**
|
|
120
|
+
* Per-language build-phase AST enrichment (computed / synthetic
|
|
121
|
+
* properties). Driven by the shared `BuildPipelineIntegration`
|
|
122
|
+
* via `extendDocument`. The service reads its `extensions`
|
|
123
|
+
* contribution group at construction.
|
|
124
|
+
*
|
|
125
|
+
* Lives in a purpose-named `ast` group rather than under `workspace`
|
|
126
|
+
* (which holds Langium lifecycle concerns: WorkspaceManager,
|
|
127
|
+
* DocumentBuilder, FileSystemProvider, AstNodeDescriptionProvider).
|
|
128
|
+
* Matches the convention set by `references.ScopeExtensionService`
|
|
129
|
+
* and `integrity.IntegrityService` — each registry lives in a group
|
|
130
|
+
* named for its purpose.
|
|
131
|
+
*/
|
|
132
|
+
AstExtensionService: AstExtensionService;
|
|
133
|
+
/**
|
|
134
|
+
* Declarative {@link AstExtensionContribution} group. Each sub-key
|
|
135
|
+
* binds a contribution; the {@link AstExtensionService} iterates this
|
|
136
|
+
* group at construction and calls each contribution's
|
|
137
|
+
* `registerAstExtensions(registry)`. Distinct sub-keys accumulate
|
|
138
|
+
* across framework + adopter modules via Langium's deep-merge.
|
|
139
|
+
*/
|
|
140
|
+
extensions: Record<string, AstExtensionContribution>;
|
|
141
|
+
};
|
|
142
|
+
serializer: {
|
|
143
|
+
/**
|
|
144
|
+
* Typed home for grammar-specific round-trip serialisers.
|
|
145
|
+
* `ModelService.serialize` resolves it via
|
|
146
|
+
* `services.ServiceRegistry.getServices(uri).serializer.Serializer`, so
|
|
147
|
+
* multi-grammar workspaces route to the right serializer per file. The
|
|
148
|
+
* framework default throws a clear "no Serializer registered" error;
|
|
149
|
+
* adopters bind their own per-language subclass to enable
|
|
150
|
+
* `ModelService.update` / `ModelService.save`.
|
|
151
|
+
*/
|
|
152
|
+
Serializer: Serializer;
|
|
153
|
+
};
|
|
154
|
+
integrity: {
|
|
155
|
+
/**
|
|
156
|
+
* Build-phase AST-integrity rule runner for this language. Framework
|
|
157
|
+
* default is a no-op (zero rules registered) — adopters declare
|
|
158
|
+
* their rules via {@link IntegrityRuleContribution}s under
|
|
159
|
+
* `rules`, or via an `IntegrityService` subclass for
|
|
160
|
+
* grammar-typed access (`IntegrityService<MyRoot>` is covariant in
|
|
161
|
+
* `TRoot`, so the narrower subclass assigns to the
|
|
162
|
+
* `IntegrityService<AstNode>` slot without a cast). The service
|
|
163
|
+
* reads its `rules` contribution group at construction.
|
|
164
|
+
* Driven by the shared `BuildPipelineIntegration`, which routes
|
|
165
|
+
* each document to its own language's instance.
|
|
166
|
+
*/
|
|
167
|
+
IntegrityService: IntegrityService<AstNode>;
|
|
168
|
+
/**
|
|
169
|
+
* Declarative {@link IntegrityRuleContribution} group. Each sub-key
|
|
170
|
+
* binds a contribution; the {@link IntegrityService} iterates this
|
|
171
|
+
* group at construction and calls each contribution's
|
|
172
|
+
* `registerIntegrityRules(registry)`. Distinct sub-keys accumulate
|
|
173
|
+
* across framework + adopter modules via Langium's deep-merge.
|
|
174
|
+
*/
|
|
175
|
+
rules: Record<string, IntegrityRuleContribution>;
|
|
176
|
+
};
|
|
177
|
+
updateRewrite: {
|
|
178
|
+
/**
|
|
179
|
+
* Per-language runner for transfer-model rewrites applied on the
|
|
180
|
+
* structured write path of `ModelService.update` / `save`, before
|
|
181
|
+
* serialisation. The RPC-update-stage sibling of the
|
|
182
|
+
* {@link IntegrityService} / {@link AstExtensionService} registries.
|
|
183
|
+
* Framework default is a no-op (zero rewrites registered) — adopters
|
|
184
|
+
* declare theirs via {@link UpdateRewriteContribution}s under
|
|
185
|
+
* `rewrites`. Resolved per-URI by `ModelService`, so
|
|
186
|
+
* multi-grammar workspaces route each write to the right rewrite set.
|
|
187
|
+
*/
|
|
188
|
+
UpdateRewriteService: UpdateRewriteService;
|
|
189
|
+
/**
|
|
190
|
+
* Declarative {@link UpdateRewriteContribution} group. Each sub-key binds
|
|
191
|
+
* a contribution; the {@link UpdateRewriteService} iterates this group at
|
|
192
|
+
* construction and calls each contribution's
|
|
193
|
+
* `registerUpdateRewrites(registry)`. Distinct sub-keys accumulate across
|
|
194
|
+
* framework + adopter modules via Langium's deep-merge.
|
|
195
|
+
*
|
|
196
|
+
* The framework ships no member by default — notably
|
|
197
|
+
* `NormalizeEmptyStringsContribution` is opt-in (it encodes a
|
|
198
|
+
* grammar-specific "`''` means unset" assumption), registered by the
|
|
199
|
+
* adopter under a named sub-key only when its form transport emits `''`.
|
|
200
|
+
*/
|
|
201
|
+
rewrites: Record<string, UpdateRewriteContribution>;
|
|
202
|
+
};
|
|
203
|
+
validation: {
|
|
204
|
+
/**
|
|
205
|
+
* Per-language eager service that wires
|
|
206
|
+
* {@link ValidationCheckContribution}s under `checks` into
|
|
207
|
+
* Langium's `ValidationRegistry` at construction time. Constructed
|
|
208
|
+
* on first per-language services access (typically forced by
|
|
209
|
+
* `BuildPipelineIntegration`'s per-language routing helper
|
|
210
|
+
* touching this slot before the first `Validated`-phase fire).
|
|
211
|
+
*/
|
|
212
|
+
ValidationContributionCollector: ValidationContributionCollector;
|
|
213
|
+
/**
|
|
214
|
+
* Declarative {@link ValidationCheckContribution} group. Each sub-key
|
|
215
|
+
* binds a contribution; the {@link ValidationContributionCollector}
|
|
216
|
+
* iterates this group at construction and calls each contribution's
|
|
217
|
+
* `registerValidationChecks(registry)`, where `registry` is a thin
|
|
218
|
+
* adapter over Langium's `ValidationRegistry`. The framework binds
|
|
219
|
+
* its own {@link NameSeparatorCheckContribution} under `framework`;
|
|
220
|
+
* adopters bind their own contributions under named sub-keys. Two
|
|
221
|
+
* contributions registering a check for the same node type both
|
|
222
|
+
* fire — Langium's `ValidationRegistry` stores entries in a MultiMap.
|
|
223
|
+
*/
|
|
224
|
+
checks: Record<string, ValidationCheckContribution>;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Minimum per-language services tree every framework-bound class accepts
|
|
229
|
+
* via its `services` constructor parameter.
|
|
230
|
+
*
|
|
231
|
+
* Langium's `LangiumCoreServices` (the LSP-free core surface) with two
|
|
232
|
+
* framework refinements: `.shared` narrowed to {@link ServerSharedServices},
|
|
233
|
+
* and the framework's own per-language additions
|
|
234
|
+
* ({@link ServerAddedServices}). Bound classes therefore read framework
|
|
235
|
+
* per-language slots like `this.services.ast.AstExtensionService` and
|
|
236
|
+
* `this.services.references.NameProvider.getDocumentQualifiedName`
|
|
237
|
+
* without a per-callsite cast.
|
|
238
|
+
*
|
|
239
|
+
* The only thing this type omits versus {@link ServerLanguageServices} is the
|
|
240
|
+
* LSP-enabled `LangiumServices` surface — so use this narrower type when the
|
|
241
|
+
* bound class does not consume LSP slots (the framework's own services are
|
|
242
|
+
* NOT LSP slots and belong here).
|
|
243
|
+
*
|
|
244
|
+
* Adopters declaring per-language services trees should extend this, and
|
|
245
|
+
* intersect their own narrower `shared`, so the framework's
|
|
246
|
+
* `(services, options)` constructor surface accepts their service shape
|
|
247
|
+
* without manual `.shared` casts.
|
|
248
|
+
*/
|
|
249
|
+
export type HydraniumLanguageServices = LangiumCoreServices & ServerAddedServices & {
|
|
250
|
+
shared: ServerSharedServices;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Full language-service surface contributed by `createServerLanguageModule`.
|
|
254
|
+
*
|
|
255
|
+
* Extends {@link HydraniumLanguageServices} with the LSP-enabled
|
|
256
|
+
* `LangiumServices` surface. The narrowed `.shared: ServerSharedServices` flows through from
|
|
257
|
+
* `HydraniumLanguageServices` so framework-bound classes constructed at
|
|
258
|
+
* the binding site (e.g. `services => new HydraniumScopeProvider(services)`)
|
|
259
|
+
* see the framework-extended shared tree without a cast.
|
|
260
|
+
*
|
|
261
|
+
* Adopters whose per-language type intersects `LangiumServices &
|
|
262
|
+
* ServerAddedServices & ...` must add `& { shared: <YourSharedServices> }`
|
|
263
|
+
* so the type is assignable to `ServerLanguageServices` and the
|
|
264
|
+
* framework's bound-class constructors accept it. An adopter does this
|
|
265
|
+
* via a `/* override *\/ shared: <YourSharedServices>` declaration on its
|
|
266
|
+
* per-language added-services interface.
|
|
267
|
+
*/
|
|
268
|
+
export type ServerLanguageServices = LangiumServices & ServerAddedServices & {
|
|
269
|
+
shared: ServerSharedServices;
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* `@hydranium/core`'s default language module. Provides the head-neutral
|
|
273
|
+
* bindings declared by {@link ServerAddedServices}; each protocol head
|
|
274
|
+
* package layers its own language module after this one, as does the
|
|
275
|
+
* adopter's.
|
|
276
|
+
*
|
|
277
|
+
* Order matters — `createServerLanguageModule` provides framework
|
|
278
|
+
* defaults; later modules override (later-wins).
|
|
279
|
+
*/
|
|
280
|
+
export declare function createServerLanguageModule(_context: ServerModuleContext): Module<ServerLanguageServices, PartialLangiumServices & ServerAddedServices>;
|
|
281
|
+
//# sourceMappingURL=language-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-module.d.ts","sourceRoot":"","sources":["../../src/langium/language-module.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { DefaultAstExtensionService } from './ast-extension/ast-extension-service.js';
|
|
10
|
+
import { HydraniumCommentProvider } from './documentation/comment-provider.js';
|
|
11
|
+
import { DefaultIntegrityService } from './integrity/integrity-service.js';
|
|
12
|
+
import { DefaultElementKeyProvider } from './keys/default-element-key-provider.js';
|
|
13
|
+
import { DefaultLabelProvider } from './labeling/label-provider.js';
|
|
14
|
+
import { DefaultNameProvider } from './naming/name-provider.js';
|
|
15
|
+
import { NameSeparatorCheckContribution } from './naming/name-separator-validation.js';
|
|
16
|
+
import { HydraniumAstNodeDescriptionProvider } from './scope/ast-node-description-provider.js';
|
|
17
|
+
import { DefaultReferenceCandidateProvider } from './scope/reference-candidate-provider.js';
|
|
18
|
+
import { HydraniumScopeComputation } from './scope/hydranium-scope-computation.js';
|
|
19
|
+
import { HydraniumScopeProvider } from './scope/hydranium-scope-provider.js';
|
|
20
|
+
import { DefaultReferenceBuilder } from './scope/reference-builder.js';
|
|
21
|
+
import { DefaultScopeExtensionService } from './scope/scope-extension-service.js';
|
|
22
|
+
import { DefaultUpdateRewriteService } from './update-rewrite/update-rewrite-service.js';
|
|
23
|
+
import { HydraniumDocumentValidator } from './validation/document-validator.js';
|
|
24
|
+
import { ValidationContributionCollector } from './validation/validation-contribution-collector.js';
|
|
25
|
+
/** Framework default — throws when either serializer entry point is invoked without an adopter binding. */
|
|
26
|
+
class UnboundSerializer {
|
|
27
|
+
serializeAst(_model) {
|
|
28
|
+
throw new Error('No Serializer registered at services.serializer.Serializer — bind a Serializer<TAst, TTransfer> in your per-language module before calling ModelService.update / ModelService.save.');
|
|
29
|
+
}
|
|
30
|
+
serializeTransfer(_model) {
|
|
31
|
+
throw new Error('No Serializer registered at services.serializer.Serializer — bind a Serializer<TAst, TTransfer> in your per-language module before calling ModelService.update / ModelService.save.');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* `@hydranium/core`'s default language module. Provides the head-neutral
|
|
36
|
+
* bindings declared by {@link ServerAddedServices}; each protocol head
|
|
37
|
+
* package layers its own language module after this one, as does the
|
|
38
|
+
* adopter's.
|
|
39
|
+
*
|
|
40
|
+
* Order matters — `createServerLanguageModule` provides framework
|
|
41
|
+
* defaults; later modules override (later-wins).
|
|
42
|
+
*/
|
|
43
|
+
export function createServerLanguageModule(_context) {
|
|
44
|
+
return {
|
|
45
|
+
references: {
|
|
46
|
+
ScopeComputation: services => new HydraniumScopeComputation(services),
|
|
47
|
+
ScopeProvider: services => new HydraniumScopeProvider(services),
|
|
48
|
+
CandidateProvider: services => new DefaultReferenceCandidateProvider(services),
|
|
49
|
+
NameProvider: services => new DefaultNameProvider(services),
|
|
50
|
+
ElementKeyProvider: services => new DefaultElementKeyProvider(services),
|
|
51
|
+
LabelProvider: services => new DefaultLabelProvider(services),
|
|
52
|
+
ReferenceBuilder: services => new DefaultReferenceBuilder(services),
|
|
53
|
+
ScopeExtensionService: services => new DefaultScopeExtensionService(services),
|
|
54
|
+
scopes: {}
|
|
55
|
+
},
|
|
56
|
+
documentation: {
|
|
57
|
+
// Read-side CST rehydration for hover/completion docs — a shed
|
|
58
|
+
// target's preceding comment is resolved from its `$cstNode`, which
|
|
59
|
+
// this provider restores on demand.
|
|
60
|
+
CommentProvider: services => new HydraniumCommentProvider(services)
|
|
61
|
+
},
|
|
62
|
+
workspace: {
|
|
63
|
+
AstNodeDescriptionProvider: services => new HydraniumAstNodeDescriptionProvider(services)
|
|
64
|
+
},
|
|
65
|
+
ast: {
|
|
66
|
+
AstExtensionService: services => new DefaultAstExtensionService(services),
|
|
67
|
+
extensions: {}
|
|
68
|
+
},
|
|
69
|
+
serializer: {
|
|
70
|
+
Serializer: () => new UnboundSerializer()
|
|
71
|
+
},
|
|
72
|
+
// The per-URI serialise / re-parse path only fires when a rule mutates,
|
|
73
|
+
// so the no-op default is safe even before adopters bind a real
|
|
74
|
+
// serializer / parser.
|
|
75
|
+
integrity: {
|
|
76
|
+
IntegrityService: services => new DefaultIntegrityService(services),
|
|
77
|
+
rules: {}
|
|
78
|
+
},
|
|
79
|
+
updateRewrite: {
|
|
80
|
+
UpdateRewriteService: services => new DefaultUpdateRewriteService(services),
|
|
81
|
+
rewrites: {}
|
|
82
|
+
},
|
|
83
|
+
validation: {
|
|
84
|
+
// The framework validator on Langium's stock slot: it is what makes
|
|
85
|
+
// `element`/`property` (the field a form client attaches an error to),
|
|
86
|
+
// the `$synthetic` node skip and the virtual-document skip real.
|
|
87
|
+
// Left at framework defaults on purpose — an adopter wanting other
|
|
88
|
+
// option values rebinds the slot with its own `new
|
|
89
|
+
// HydraniumDocumentValidator(services, { … })`.
|
|
90
|
+
DocumentValidator: services => new HydraniumDocumentValidator(services),
|
|
91
|
+
ValidationContributionCollector: services => new ValidationContributionCollector(services),
|
|
92
|
+
checks: {
|
|
93
|
+
// Flags name-bearing nodes whose name value contains the
|
|
94
|
+
// configured name separator, so qualified names can never collide
|
|
95
|
+
// with literal names. Adopters MUST avoid the `framework` sub-key
|
|
96
|
+
// for their own contributions — Langium's deep-merge is last-wins
|
|
97
|
+
// on same-key leaves, so replacing it drops this check.
|
|
98
|
+
framework: services => new NameSeparatorCheckContribution(services)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=language-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-module.js","sourceRoot":"","sources":["../../src/langium/language-module.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { type Grammar, type LanguageMetaData } from '@hydranium/langium';
|
|
10
|
+
/**
|
|
11
|
+
* The two slots {@link buildLanguageTypeIndex} reads off a registered language.
|
|
12
|
+
* Narrowed to exactly this rather than taking `LangiumCoreServices` so the
|
|
13
|
+
* index is testable against a grammar plus an id, and so the signature states
|
|
14
|
+
* what it actually touches. A real service tree satisfies it structurally.
|
|
15
|
+
*/
|
|
16
|
+
export interface TypedLanguage {
|
|
17
|
+
readonly Grammar: Grammar;
|
|
18
|
+
readonly LanguageMetaData: LanguageMetaData;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Which registered language can produce a given AST `$type`.
|
|
22
|
+
*
|
|
23
|
+
* **Why this exists.** Langium routes languages by file extension, so a request
|
|
24
|
+
* that names no document — an element id, or a synthetic node addressing a
|
|
25
|
+
* directory URI during a create-element flow — has no URI to route by. What it
|
|
26
|
+
* does carry is an AST type. The obvious resolver, `AstReflection`, cannot help:
|
|
27
|
+
* Langium declares it in `LangiumGeneratedSharedCoreServices`, i.e. ONE
|
|
28
|
+
* reflection per project covering every grammar, with no language attribution.
|
|
29
|
+
* `Grammar`, on the other hand, is a per-language service — so the attribution
|
|
30
|
+
* is recoverable from the grammars themselves.
|
|
31
|
+
*
|
|
32
|
+
* Build it once (grammar walks are not cheap) and query per request; the
|
|
33
|
+
* registered set is fixed after bootstrap.
|
|
34
|
+
*/
|
|
35
|
+
export interface LanguageTypeIndex<TLanguage extends TypedLanguage = TypedLanguage> {
|
|
36
|
+
/**
|
|
37
|
+
* Languages whose grammar can produce `type`, in registration order.
|
|
38
|
+
* Empty when no grammar produces it; more than one when several do (types
|
|
39
|
+
* reached through a shared imported grammar), which is the caller's signal
|
|
40
|
+
* that the type alone does not identify a language.
|
|
41
|
+
*/
|
|
42
|
+
languagesFor(type: string): readonly TLanguage[];
|
|
43
|
+
/** Every AST `$type` the language with this id can produce. */
|
|
44
|
+
typesOf(languageId: string): ReadonlySet<string>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The AST `$type`s a grammar can actually produce — the types of the parser
|
|
48
|
+
* rules a document of the language can reach, plus the types assigned by
|
|
49
|
+
* `{infer X}` / `{X}` actions inside those rules.
|
|
50
|
+
*
|
|
51
|
+
* **Produced, not mentioned.** A grammar that only cross-references a type
|
|
52
|
+
* carries that type in its serialised grammar without any rule producing it —
|
|
53
|
+
* a document of that language can never contain such a node. Collecting
|
|
54
|
+
* mentions instead would report every language that merely links to a type,
|
|
55
|
+
* which for a grammar pair that cross-references is most of them.
|
|
56
|
+
*
|
|
57
|
+
* Three rule kinds are skipped because none yields an AST node type:
|
|
58
|
+
* - **fragments** (`fragment Foo: …`), which splice their assignments into the
|
|
59
|
+
* calling rule's object. `langium-cli` generates no type for them, so
|
|
60
|
+
* counting the rule name would invent types the `AstReflection` has never
|
|
61
|
+
* heard of — and a fragment shared through an imported grammar would be
|
|
62
|
+
* attributed to every language that imports it.
|
|
63
|
+
* - **data-type rules** (`QualifiedName returns string: …`), which produce a
|
|
64
|
+
* primitive value rather than a node.
|
|
65
|
+
* - **rules returning a declared literal-union type** — the
|
|
66
|
+
* `type OpKind = '=' | '!='; OpKind returns OpKind: '=' | '!=';` idiom.
|
|
67
|
+
* `langium-cli` emits these as TypeScript string-union aliases, never as
|
|
68
|
+
* reflected node types, so counting them made `assertReflectionCoversLanguages`
|
|
69
|
+
* warn on every boot of any grammar using the idiom, and put phantom entries
|
|
70
|
+
* in this index for types no document can ever contain. Such a rule's
|
|
71
|
+
* `dataType` is NOT set — the return type is a declared union, not a
|
|
72
|
+
* primitive — so the data-type skip does not catch it, and
|
|
73
|
+
* {@link isLiteralOnlyType} decides it instead.
|
|
74
|
+
*
|
|
75
|
+
* A declared type that unions AST node types (`type Expr = Binary | Unary`) is
|
|
76
|
+
* deliberately still counted: `langium-cli` reflects those, so dropping them
|
|
77
|
+
* would hide real coverage gaps rather than false ones.
|
|
78
|
+
*/
|
|
79
|
+
export declare function collectProducibleTypes(grammar: Grammar | undefined): Set<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Build a {@link LanguageTypeIndex} over the registered languages. Pure over
|
|
82
|
+
* its input so it unit-tests against hand-built grammars without a boot.
|
|
83
|
+
*/
|
|
84
|
+
export declare function buildLanguageTypeIndex<TLanguage extends TypedLanguage>(languages: readonly TLanguage[]): LanguageTypeIndex<TLanguage>;
|
|
85
|
+
//# sourceMappingURL=language-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-types.d.ts","sourceRoot":"","sources":["../../src/langium/language-types.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAwB,KAAK,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE/F;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC9C;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,iBAAiB,CAAC,SAAS,SAAS,aAAa,GAAG,aAAa;IAC/E;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,SAAS,EAAE,CAAC;IACjD,+DAA+D;IAC/D,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;CACnD;AA4ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CA8BhF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,SAAS,aAAa,EAAE,SAAS,EAAE,SAAS,SAAS,EAAE,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAqBrI"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { AstUtils, GrammarAST } from '@hydranium/langium';
|
|
10
|
+
/**
|
|
11
|
+
* Parser rules a document of this language can actually reach — the entry rule
|
|
12
|
+
* and everything transitively rule-called from it, fragments included (they are
|
|
13
|
+
* traversed for their own calls even though they contribute no type).
|
|
14
|
+
*
|
|
15
|
+
* **Reachability, not mere presence.** Langium grammar imports pull the
|
|
16
|
+
* imported grammar's rules into the importing grammar wholesale, so a grammar
|
|
17
|
+
* that imports another purely for a cross-reference target ends up
|
|
18
|
+
* *containing* all of that grammar's rules — including rules no document of
|
|
19
|
+
* the importing language can hold. Walking from the entry rule is what
|
|
20
|
+
* separates "this grammar mentions the rule" from "a document of this
|
|
21
|
+
* language can contain such a node".
|
|
22
|
+
*
|
|
23
|
+
* Cross-references are deliberately NOT followed: a `[Target:ID]` assignment
|
|
24
|
+
* names a link target, not containment.
|
|
25
|
+
*
|
|
26
|
+
* Falls back to every parser rule when the grammar declares no entry rule —
|
|
27
|
+
* a grammar fragment used only through imports, where reachability is
|
|
28
|
+
* undefined and over-reporting is safer than reporting nothing.
|
|
29
|
+
*/
|
|
30
|
+
function reachableParserRules(grammar) {
|
|
31
|
+
const parserRules = (grammar?.rules ?? []).filter(GrammarAST.isParserRule);
|
|
32
|
+
const entry = parserRules.find(rule => rule.entry);
|
|
33
|
+
if (!entry) {
|
|
34
|
+
return parserRules;
|
|
35
|
+
}
|
|
36
|
+
const visited = new Set();
|
|
37
|
+
const queue = [entry];
|
|
38
|
+
while (queue.length > 0) {
|
|
39
|
+
const rule = queue.pop();
|
|
40
|
+
if (visited.has(rule)) {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
visited.add(rule);
|
|
44
|
+
for (const node of AstUtils.streamAllContents(rule)) {
|
|
45
|
+
// A rule call inside a cross-reference is the link's token, not
|
|
46
|
+
// containment — `streamAllContents` would otherwise walk into it.
|
|
47
|
+
if (GrammarAST.isRuleCall(node) && !GrammarAST.isCrossReference(node.$container)) {
|
|
48
|
+
const called = node.rule.ref;
|
|
49
|
+
if (called && GrammarAST.isParserRule(called)) {
|
|
50
|
+
queue.push(called);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return [...visited];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Whether a declared grammar `type` resolves to literals and primitives only —
|
|
59
|
+
* `type OpKind = '=' | '!='` — as opposed to unioning AST node types.
|
|
60
|
+
*
|
|
61
|
+
* Decided on the leaves: every `SimpleType` in the definition tree carries
|
|
62
|
+
* exactly one of `stringType` (a keyword literal), `primitiveType`, or
|
|
63
|
+
* `typeRef` (a reference to another grammar type). A single `typeRef` anywhere
|
|
64
|
+
* means the type can denote a node, so it is not literal-only.
|
|
65
|
+
*
|
|
66
|
+
* Returns `false` when the definition has no `SimpleType` leaf at all, so a
|
|
67
|
+
* shape this decision does not recognise leaves the rule counted rather than
|
|
68
|
+
* silently dropped.
|
|
69
|
+
*/
|
|
70
|
+
function isLiteralOnlyType(declared) {
|
|
71
|
+
let sawLeaf = false;
|
|
72
|
+
for (const node of [declared.type, ...AstUtils.streamAllContents(declared.type)]) {
|
|
73
|
+
if (GrammarAST.isSimpleType(node)) {
|
|
74
|
+
if (node.typeRef) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
sawLeaf = true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return sawLeaf;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The AST `$type`s a grammar can actually produce — the types of the parser
|
|
84
|
+
* rules a document of the language can reach, plus the types assigned by
|
|
85
|
+
* `{infer X}` / `{X}` actions inside those rules.
|
|
86
|
+
*
|
|
87
|
+
* **Produced, not mentioned.** A grammar that only cross-references a type
|
|
88
|
+
* carries that type in its serialised grammar without any rule producing it —
|
|
89
|
+
* a document of that language can never contain such a node. Collecting
|
|
90
|
+
* mentions instead would report every language that merely links to a type,
|
|
91
|
+
* which for a grammar pair that cross-references is most of them.
|
|
92
|
+
*
|
|
93
|
+
* Three rule kinds are skipped because none yields an AST node type:
|
|
94
|
+
* - **fragments** (`fragment Foo: …`), which splice their assignments into the
|
|
95
|
+
* calling rule's object. `langium-cli` generates no type for them, so
|
|
96
|
+
* counting the rule name would invent types the `AstReflection` has never
|
|
97
|
+
* heard of — and a fragment shared through an imported grammar would be
|
|
98
|
+
* attributed to every language that imports it.
|
|
99
|
+
* - **data-type rules** (`QualifiedName returns string: …`), which produce a
|
|
100
|
+
* primitive value rather than a node.
|
|
101
|
+
* - **rules returning a declared literal-union type** — the
|
|
102
|
+
* `type OpKind = '=' | '!='; OpKind returns OpKind: '=' | '!=';` idiom.
|
|
103
|
+
* `langium-cli` emits these as TypeScript string-union aliases, never as
|
|
104
|
+
* reflected node types, so counting them made `assertReflectionCoversLanguages`
|
|
105
|
+
* warn on every boot of any grammar using the idiom, and put phantom entries
|
|
106
|
+
* in this index for types no document can ever contain. Such a rule's
|
|
107
|
+
* `dataType` is NOT set — the return type is a declared union, not a
|
|
108
|
+
* primitive — so the data-type skip does not catch it, and
|
|
109
|
+
* {@link isLiteralOnlyType} decides it instead.
|
|
110
|
+
*
|
|
111
|
+
* A declared type that unions AST node types (`type Expr = Binary | Unary`) is
|
|
112
|
+
* deliberately still counted: `langium-cli` reflects those, so dropping them
|
|
113
|
+
* would hide real coverage gaps rather than false ones.
|
|
114
|
+
*/
|
|
115
|
+
export function collectProducibleTypes(grammar) {
|
|
116
|
+
const types = new Set();
|
|
117
|
+
// A real language always binds `Grammar` (Langium requires it in
|
|
118
|
+
// `LangiumGeneratedCoreServices`, and `assertCoreSlotsBound` fails the boot
|
|
119
|
+
// without it). Tolerated here anyway so a routing lookup degrades to "this
|
|
120
|
+
// language produces nothing" rather than throwing a TypeError mid-request.
|
|
121
|
+
for (const rule of reachableParserRules(grammar)) {
|
|
122
|
+
if (rule.fragment || rule.dataType !== undefined) {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
const returnedType = rule.returnType?.ref;
|
|
126
|
+
if (returnedType && GrammarAST.isType(returnedType) && isLiteralOnlyType(returnedType)) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
// A parser rule's type: an explicit `returns X`, an `infer X`, else the
|
|
130
|
+
// rule name (Langium's default inferred type).
|
|
131
|
+
const declared = rule.returnType?.ref?.name ?? rule.inferredType?.name ?? rule.name;
|
|
132
|
+
types.add(declared);
|
|
133
|
+
// Actions rewrite the current object's type mid-rule, so they produce
|
|
134
|
+
// types no rule signature mentions.
|
|
135
|
+
for (const node of AstUtils.streamAllContents(rule)) {
|
|
136
|
+
if (GrammarAST.isAction(node)) {
|
|
137
|
+
const actionType = node.inferredType?.name ?? node.type?.ref?.name;
|
|
138
|
+
if (actionType) {
|
|
139
|
+
types.add(actionType);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return types;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Build a {@link LanguageTypeIndex} over the registered languages. Pure over
|
|
148
|
+
* its input so it unit-tests against hand-built grammars without a boot.
|
|
149
|
+
*/
|
|
150
|
+
export function buildLanguageTypeIndex(languages) {
|
|
151
|
+
const byType = new Map();
|
|
152
|
+
const byLanguage = new Map();
|
|
153
|
+
for (const language of languages) {
|
|
154
|
+
const types = collectProducibleTypes(language.Grammar);
|
|
155
|
+
byLanguage.set(language.LanguageMetaData.languageId, types);
|
|
156
|
+
for (const type of types) {
|
|
157
|
+
const owners = byType.get(type);
|
|
158
|
+
if (owners) {
|
|
159
|
+
owners.push(language);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
byType.set(type, [language]);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const none = [];
|
|
167
|
+
const empty = new Set();
|
|
168
|
+
return {
|
|
169
|
+
languagesFor: type => byType.get(type) ?? none,
|
|
170
|
+
typesOf: languageId => byLanguage.get(languageId) ?? empty
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=language-types.js.map
|