@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,14 @@
|
|
|
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
|
+
export * from './normalize-empty-strings.js';
|
|
10
|
+
export * from './semantic-root-rewrite.js';
|
|
11
|
+
export * from './update-rewrite.js';
|
|
12
|
+
export * from './update-rewrite-contribution.js';
|
|
13
|
+
export * from './update-rewrite-service.js';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/langium/update-rewrite/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 UpdateRewriteContribution, type UpdateRewriteRegistry } from './update-rewrite-contribution.js';
|
|
10
|
+
/**
|
|
11
|
+
* Ready-made {@link UpdateRewriteContribution} that registers one rewrite —
|
|
12
|
+
* the `'' → unset` normalisation — and exposes the transform itself as the
|
|
13
|
+
* overridable {@link normalize} hook.
|
|
14
|
+
*
|
|
15
|
+
* **Why this exists.** An HTML form control that the user clears emits `''`,
|
|
16
|
+
* never `undefined` / absent — but a structured diff treats `''` and absent as
|
|
17
|
+
* different. Without normalisation, the same "clear the field" gesture produces
|
|
18
|
+
* two different persisted outcomes depending on the field's grammar default (a
|
|
19
|
+
* literal `field: ''` local override vs re-inheriting). Collapsing `'' → unset`
|
|
20
|
+
* makes "clear" uniformly mean "remove my local value", the only intent the
|
|
21
|
+
* form can express.
|
|
22
|
+
*
|
|
23
|
+
* **Opt-in.** The framework never binds this by default: dropping `''` encodes a
|
|
24
|
+
* grammar-specific "`''` is never meaningful" assumption, so it would silently
|
|
25
|
+
* lose data for a grammar where `''` is meaningful. Bind it under a named
|
|
26
|
+
* sub-key of your module's `updateRewrite.rewrites` group when your form
|
|
27
|
+
* transport emits `''`.
|
|
28
|
+
*
|
|
29
|
+
* **Adapt** by subclassing and overriding {@link normalize} — e.g. to preserve
|
|
30
|
+
* grammar-meaningful empties for specific keys — without touching the
|
|
31
|
+
* registration glue.
|
|
32
|
+
*/
|
|
33
|
+
export declare class NormalizeEmptyStringsContribution implements UpdateRewriteContribution {
|
|
34
|
+
registerUpdateRewrites(registry: UpdateRewriteRegistry): void;
|
|
35
|
+
/**
|
|
36
|
+
* Collapse empty-string properties to "unset" (drop the key) throughout the
|
|
37
|
+
* transfer-model graph. Override to adapt the rule (the override applies at
|
|
38
|
+
* every depth, since the walk recurses through this method).
|
|
39
|
+
*
|
|
40
|
+
* Scope of the walk:
|
|
41
|
+
* - Recurses object properties and into object elements of arrays.
|
|
42
|
+
* - Leaves **primitive array elements** untouched — e.g. reference-id
|
|
43
|
+
* strings must not have an accidental `''` turned into a hole in the array.
|
|
44
|
+
* - Leaves `$`-prefixed (Langium internals like `$type`) and `_`-prefixed
|
|
45
|
+
* (derived metadata) keys verbatim — downstream rewrites read them.
|
|
46
|
+
* - Leaves Langium `Reference` objects (`{ $refText }`) verbatim.
|
|
47
|
+
*
|
|
48
|
+
* Pure — returns a new object graph, does not mutate its input.
|
|
49
|
+
*/
|
|
50
|
+
protected normalize<T>(value: T): T;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=normalize-empty-strings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-empty-strings.d.ts","sourceRoot":"","sources":["../../../src/langium/update-rewrite/normalize-empty-strings.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,yBAAyB,EAAE,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAE9G;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,iCAAkC,YAAW,yBAAyB;IAChF,sBAAsB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAU7D;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;CAyBrC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
/**
|
|
10
|
+
* Ready-made {@link UpdateRewriteContribution} that registers one rewrite —
|
|
11
|
+
* the `'' → unset` normalisation — and exposes the transform itself as the
|
|
12
|
+
* overridable {@link normalize} hook.
|
|
13
|
+
*
|
|
14
|
+
* **Why this exists.** An HTML form control that the user clears emits `''`,
|
|
15
|
+
* never `undefined` / absent — but a structured diff treats `''` and absent as
|
|
16
|
+
* different. Without normalisation, the same "clear the field" gesture produces
|
|
17
|
+
* two different persisted outcomes depending on the field's grammar default (a
|
|
18
|
+
* literal `field: ''` local override vs re-inheriting). Collapsing `'' → unset`
|
|
19
|
+
* makes "clear" uniformly mean "remove my local value", the only intent the
|
|
20
|
+
* form can express.
|
|
21
|
+
*
|
|
22
|
+
* **Opt-in.** The framework never binds this by default: dropping `''` encodes a
|
|
23
|
+
* grammar-specific "`''` is never meaningful" assumption, so it would silently
|
|
24
|
+
* lose data for a grammar where `''` is meaningful. Bind it under a named
|
|
25
|
+
* sub-key of your module's `updateRewrite.rewrites` group when your form
|
|
26
|
+
* transport emits `''`.
|
|
27
|
+
*
|
|
28
|
+
* **Adapt** by subclassing and overriding {@link normalize} — e.g. to preserve
|
|
29
|
+
* grammar-meaningful empties for specific keys — without touching the
|
|
30
|
+
* registration glue.
|
|
31
|
+
*/
|
|
32
|
+
export class NormalizeEmptyStringsContribution {
|
|
33
|
+
registerUpdateRewrites(registry) {
|
|
34
|
+
registry.register({
|
|
35
|
+
id: 'normalize-empty-strings',
|
|
36
|
+
// Low priority so it runs before any diff-based rewrite — a
|
|
37
|
+
// reconciliation pass should see cleared fields already read as unset.
|
|
38
|
+
priority: -100,
|
|
39
|
+
rewrite: model => this.normalize(model)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Collapse empty-string properties to "unset" (drop the key) throughout the
|
|
44
|
+
* transfer-model graph. Override to adapt the rule (the override applies at
|
|
45
|
+
* every depth, since the walk recurses through this method).
|
|
46
|
+
*
|
|
47
|
+
* Scope of the walk:
|
|
48
|
+
* - Recurses object properties and into object elements of arrays.
|
|
49
|
+
* - Leaves **primitive array elements** untouched — e.g. reference-id
|
|
50
|
+
* strings must not have an accidental `''` turned into a hole in the array.
|
|
51
|
+
* - Leaves `$`-prefixed (Langium internals like `$type`) and `_`-prefixed
|
|
52
|
+
* (derived metadata) keys verbatim — downstream rewrites read them.
|
|
53
|
+
* - Leaves Langium `Reference` objects (`{ $refText }`) verbatim.
|
|
54
|
+
*
|
|
55
|
+
* Pure — returns a new object graph, does not mutate its input.
|
|
56
|
+
*/
|
|
57
|
+
normalize(value) {
|
|
58
|
+
if (value === null || typeof value !== 'object') {
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
if (Array.isArray(value)) {
|
|
62
|
+
// Recurse into object elements only; primitive elements (reference strings) pass through.
|
|
63
|
+
return value.map(item => (item !== null && typeof item === 'object' ? this.normalize(item) : item));
|
|
64
|
+
}
|
|
65
|
+
const record = value;
|
|
66
|
+
if ('$refText' in record) {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
const result = {};
|
|
70
|
+
for (const [key, entry] of Object.entries(record)) {
|
|
71
|
+
if (key.startsWith('$') || key.startsWith('_')) {
|
|
72
|
+
result[key] = entry;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (entry === '') {
|
|
76
|
+
continue; // empty-string property → treat as unset (drop the key, equivalent to absent)
|
|
77
|
+
}
|
|
78
|
+
result[key] = this.normalize(entry);
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=normalize-empty-strings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-empty-strings.js","sourceRoot":"","sources":["../../../src/langium/update-rewrite/normalize-empty-strings.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,iCAAiC;IAC3C,sBAAsB,CAAC,QAA+B;QACnD,QAAQ,CAAC,QAAQ,CAAC;YACf,EAAE,EAAE,yBAAyB;YAC7B,4DAA4D;YAC5D,uEAAuE;YACvE,QAAQ,EAAE,CAAC,GAAG;YACd,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;SACzC,CAAC,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACO,SAAS,CAAI,KAAQ;QAC5B,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC/C,OAAO,KAAK,CAAC;QAChB,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,0FAA0F;YAC1F,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAiB,CAAC;QACvH,CAAC;QACD,MAAM,MAAM,GAAG,KAAgC,CAAC;QAChD,IAAI,UAAU,IAAI,MAAM,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QAChB,CAAC;QACD,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YACjD,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9C,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;gBACpB,SAAS;YACZ,CAAC;YACD,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;gBAChB,SAAS,CAAC,8EAA8E;YAC3F,CAAC;YACD,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,MAAW,CAAC;IACtB,CAAC;CACH"}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 TransferElement } from '@hydranium/protocol';
|
|
10
|
+
/**
|
|
11
|
+
* Applies `rewrite` to the ONE populated semantic slot of a wrapper-shaped
|
|
12
|
+
* transfer root, reassembling the wrapper around the result.
|
|
13
|
+
*
|
|
14
|
+
* The transfer-side counterpart to `NameBasedKeyProvider.isSemanticRoot`'s
|
|
15
|
+
* "wrapper grammars with an unnamed root node" case: the document root is a
|
|
16
|
+
* discriminating wrapper carrying one populated slot per semantic type
|
|
17
|
+
* (`{ entity }` or `{ mapping }` or `{ diagram }`, never two), and an
|
|
18
|
+
* `UpdateRewrite` is handed that wrapper while the fields it cares about
|
|
19
|
+
* live one level down.
|
|
20
|
+
*
|
|
21
|
+
* `semanticKeys` is supplied rather than inferred: which slots a wrapper may
|
|
22
|
+
* carry is grammar knowledge, and sniffing "the single object-valued property"
|
|
23
|
+
* would silently pick up any object-valued metadata a root grows later.
|
|
24
|
+
*
|
|
25
|
+
* **Identity is the no-op signal, and it is load-bearing.** When no slot is
|
|
26
|
+
* populated, or `rewrite` hands back the same reference it was given, the
|
|
27
|
+
* ARGUMENT is returned — not a copy. An `UpdateRewrite` chain folds every
|
|
28
|
+
* rewrite over the model, so a rewrite that does not apply must be free; a
|
|
29
|
+
* defensive copy here would make every unrelated write allocate a fresh root per
|
|
30
|
+
* registered rewrite. Callers that compare with `===` to detect "nothing
|
|
31
|
+
* happened" depend on this too.
|
|
32
|
+
*
|
|
33
|
+
* Rewrites of an unwrapped grammar — where the named root element IS the
|
|
34
|
+
* semantic root — do not need this helper: their model is already the node.
|
|
35
|
+
*/
|
|
36
|
+
export declare function rewriteSemanticRoot<TTransfer extends TransferElement>(model: TTransfer, semanticKeys: readonly string[], rewrite: (semanticRoot: Record<string, unknown>, key: string) => Record<string, unknown>): TTransfer;
|
|
37
|
+
//# sourceMappingURL=semantic-root-rewrite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-root-rewrite.d.ts","sourceRoot":"","sources":["../../../src/langium/update-rewrite/semantic-root-rewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,SAAS,eAAe,EAClE,KAAK,EAAE,SAAS,EAChB,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACxF,SAAS,CAeX"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
/**
|
|
10
|
+
* Applies `rewrite` to the ONE populated semantic slot of a wrapper-shaped
|
|
11
|
+
* transfer root, reassembling the wrapper around the result.
|
|
12
|
+
*
|
|
13
|
+
* The transfer-side counterpart to `NameBasedKeyProvider.isSemanticRoot`'s
|
|
14
|
+
* "wrapper grammars with an unnamed root node" case: the document root is a
|
|
15
|
+
* discriminating wrapper carrying one populated slot per semantic type
|
|
16
|
+
* (`{ entity }` or `{ mapping }` or `{ diagram }`, never two), and an
|
|
17
|
+
* `UpdateRewrite` is handed that wrapper while the fields it cares about
|
|
18
|
+
* live one level down.
|
|
19
|
+
*
|
|
20
|
+
* `semanticKeys` is supplied rather than inferred: which slots a wrapper may
|
|
21
|
+
* carry is grammar knowledge, and sniffing "the single object-valued property"
|
|
22
|
+
* would silently pick up any object-valued metadata a root grows later.
|
|
23
|
+
*
|
|
24
|
+
* **Identity is the no-op signal, and it is load-bearing.** When no slot is
|
|
25
|
+
* populated, or `rewrite` hands back the same reference it was given, the
|
|
26
|
+
* ARGUMENT is returned — not a copy. An `UpdateRewrite` chain folds every
|
|
27
|
+
* rewrite over the model, so a rewrite that does not apply must be free; a
|
|
28
|
+
* defensive copy here would make every unrelated write allocate a fresh root per
|
|
29
|
+
* registered rewrite. Callers that compare with `===` to detect "nothing
|
|
30
|
+
* happened" depend on this too.
|
|
31
|
+
*
|
|
32
|
+
* Rewrites of an unwrapped grammar — where the named root element IS the
|
|
33
|
+
* semantic root — do not need this helper: their model is already the node.
|
|
34
|
+
*/
|
|
35
|
+
export function rewriteSemanticRoot(model, semanticKeys, rewrite) {
|
|
36
|
+
const record = model;
|
|
37
|
+
const semanticKey = semanticKeys.find(key => record[key]);
|
|
38
|
+
if (!semanticKey) {
|
|
39
|
+
return model;
|
|
40
|
+
}
|
|
41
|
+
const semanticRoot = record[semanticKey];
|
|
42
|
+
if (!semanticRoot) {
|
|
43
|
+
return model;
|
|
44
|
+
}
|
|
45
|
+
const rewritten = rewrite(semanticRoot, semanticKey);
|
|
46
|
+
if (rewritten === semanticRoot) {
|
|
47
|
+
return model;
|
|
48
|
+
}
|
|
49
|
+
return { ...record, [semanticKey]: rewritten };
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=semantic-root-rewrite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-root-rewrite.js","sourceRoot":"","sources":["../../../src/langium/update-rewrite/semantic-root-rewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,mBAAmB,CAChC,KAAgB,EAChB,YAA+B,EAC/B,OAAwF;IAExF,MAAM,MAAM,GAAG,KAA2C,CAAC;IAC3D,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,IAAI,CAAC,WAAW,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IAChB,CAAC;IACD,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,CAAwC,CAAC;IAChF,IAAI,CAAC,YAAY,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IAChB,CAAC;IACD,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IACrD,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,SAAS,EAA0B,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 Disposable } from 'vscode-languageserver';
|
|
10
|
+
import { type AstNode } from '@hydranium/langium';
|
|
11
|
+
import { type TransferElement } from '@hydranium/protocol';
|
|
12
|
+
import { type UpdateRewrite } from './update-rewrite.js';
|
|
13
|
+
/**
|
|
14
|
+
* Registry handed to an {@link UpdateRewriteContribution}. Implemented by the
|
|
15
|
+
* update-rewrite service; a contribution receives it and registers one or many
|
|
16
|
+
* rewrites. Doubles as the low-level imperative API for the rare
|
|
17
|
+
* runtime-dynamic registration case.
|
|
18
|
+
*
|
|
19
|
+
* Generic over `<TTransfer, TAst>` for the same reason {@link UpdateRewrite} and
|
|
20
|
+
* `UpdateRewriteService` are: an adopter that narrows to its own root types gets
|
|
21
|
+
* a `rewrite` callback whose `model` and `previous` are already its types, so a
|
|
22
|
+
* registration needs no cast at all. Both default to the structural bases, so
|
|
23
|
+
* every existing call site keeps compiling unchanged.
|
|
24
|
+
*/
|
|
25
|
+
export interface UpdateRewriteRegistry<TTransfer extends TransferElement = TransferElement, TAst extends AstNode = AstNode> {
|
|
26
|
+
register(rewrite: UpdateRewrite<TTransfer, TAst>): Disposable;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Declarative registration of update rewrites. Bound under the module's
|
|
30
|
+
* `updateRewrite.rewrites` contribution group (a
|
|
31
|
+
* `Record<string, UpdateRewriteContribution>`); the update-rewrite service
|
|
32
|
+
* reads its own group at construction and calls this method, handing itself in
|
|
33
|
+
* as the registry.
|
|
34
|
+
*
|
|
35
|
+
* The domain-qualified method name lets a single cross-cutting class implement
|
|
36
|
+
* several contribution interfaces (e.g. also `IntegrityRuleContribution`)
|
|
37
|
+
* without method collision — bind it once and reference it from each group.
|
|
38
|
+
*/
|
|
39
|
+
export interface UpdateRewriteContribution<TTransfer extends TransferElement = TransferElement, TAst extends AstNode = AstNode> {
|
|
40
|
+
registerUpdateRewrites(registry: UpdateRewriteRegistry<TTransfer, TAst>): void;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=update-rewrite-contribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-rewrite-contribution.d.ts","sourceRoot":"","sources":["../../../src/langium/update-rewrite/update-rewrite-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,qBAAqB,CAAC,SAAS,SAAS,eAAe,GAAG,eAAe,EAAE,IAAI,SAAS,OAAO,GAAG,OAAO;IACvH,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC;CAChE;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,yBAAyB,CAAC,SAAS,SAAS,eAAe,GAAG,eAAe,EAAE,IAAI,SAAS,OAAO,GAAG,OAAO;IAC3H,sBAAsB,CAAC,QAAQ,EAAE,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC;CACjF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=update-rewrite-contribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-rewrite-contribution.js","sourceRoot":"","sources":["../../../src/langium/update-rewrite/update-rewrite-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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 TransferElement, type Tracer } from '@hydranium/protocol';
|
|
10
|
+
import { type AstNode } from '@hydranium/langium';
|
|
11
|
+
import { type CancellationToken, type Disposable } from 'vscode-languageserver';
|
|
12
|
+
import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
13
|
+
import { type ServerLanguageServices } from '../language-module.js';
|
|
14
|
+
import { Registry } from '../../util/registry.js';
|
|
15
|
+
import { type UpdateRewriteRegistry } from './update-rewrite-contribution.js';
|
|
16
|
+
import { type UpdateRewrite } from './update-rewrite.js';
|
|
17
|
+
/**
|
|
18
|
+
* Public contract for the per-language update-rewrite runner. Extends the
|
|
19
|
+
* {@link UpdateRewriteRegistry} (the imperative `register` surface
|
|
20
|
+
* contributions use) with the {@link apply} entry point
|
|
21
|
+
* `ModelService.rewriteModel` calls on the structured write path, before
|
|
22
|
+
* serialisation.
|
|
23
|
+
*
|
|
24
|
+
* Adopter overrides go through {@link DefaultUpdateRewriteService}; the
|
|
25
|
+
* interface keeps the public API stable while internals (the registry) stay
|
|
26
|
+
* `protected` on the default class.
|
|
27
|
+
*
|
|
28
|
+
* Generic over `<TTransfer, TAst>` so each consumer plugs in their own transfer
|
|
29
|
+
* and AST root types; both default to the structural bases.
|
|
30
|
+
*/
|
|
31
|
+
export interface UpdateRewriteService<TTransfer extends TransferElement = TransferElement, TAst extends AstNode = AstNode> extends UpdateRewriteRegistry<TTransfer, TAst> {
|
|
32
|
+
/** Remove a rewrite by id. Returns `true` if a rewrite was removed. */
|
|
33
|
+
unregister(id: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Run every registered rewrite in priority order, threading the model
|
|
36
|
+
* through each, and return the rewritten transfer model. Always async (the
|
|
37
|
+
* method is called once per `update`, not per node), but a synchronous
|
|
38
|
+
* rewrite never adds a microtask — see {@link DefaultUpdateRewriteService.apply}.
|
|
39
|
+
*
|
|
40
|
+
* `cancelToken` is honoured between rewrites — material when a rewrite is
|
|
41
|
+
* async (an external lookup); a preempted update aborts the chain before the
|
|
42
|
+
* next rewrite rather than running it to completion against a doomed build.
|
|
43
|
+
*/
|
|
44
|
+
apply(model: TTransfer, previous: TAst | undefined, cancelToken?: CancellationToken): Promise<TTransfer>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Construction options for {@link DefaultUpdateRewriteService}. All fields
|
|
48
|
+
* optional — the defaults reproduce the framework's behaviour exactly.
|
|
49
|
+
*/
|
|
50
|
+
export type UpdateRewriteServiceOptions = LogNameOptions;
|
|
51
|
+
/**
|
|
52
|
+
* Default {@link UpdateRewriteService} implementation. A pure ordered registry
|
|
53
|
+
* of transfer-model transforms; the framework ships **zero** members (an empty
|
|
54
|
+
* chain is a no-op). Adopters declare rewrites via
|
|
55
|
+
* `UpdateRewriteContribution`s under the `updateRewrite.rewrites` group,
|
|
56
|
+
* or register imperatively.
|
|
57
|
+
*
|
|
58
|
+
* **Per-language service.** Bound in the per-language module and resolved by
|
|
59
|
+
* `ModelService` via `ServiceRegistry.getServices(uri)`, so multi-grammar
|
|
60
|
+
* workspaces route each write to the right rewrite set.
|
|
61
|
+
*
|
|
62
|
+
* The framework provides no comparison helper and no previous-state accessor —
|
|
63
|
+
* a diff-based rewrite owns its own representation reconciliation (see
|
|
64
|
+
* {@link UpdateRewrite}).
|
|
65
|
+
*/
|
|
66
|
+
export declare class DefaultUpdateRewriteService<TTransfer extends TransferElement = TransferElement, TAst extends AstNode = AstNode> implements UpdateRewriteService<TTransfer, TAst> {
|
|
67
|
+
protected readonly services: ServerLanguageServices;
|
|
68
|
+
/** Registry of rewrites, keyed by id, iterated in priority order. */
|
|
69
|
+
protected readonly rewrites: Registry<UpdateRewrite<TTransfer, TAst>>;
|
|
70
|
+
protected readonly tracer: Tracer;
|
|
71
|
+
constructor(services: ServerLanguageServices, options?: UpdateRewriteServiceOptions);
|
|
72
|
+
register(rewrite: UpdateRewrite<TTransfer, TAst>): Disposable;
|
|
73
|
+
unregister(id: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Fold the model through every rewrite in priority order. Mirrors the
|
|
76
|
+
* `DefaultIntegrityService.enforceIntegrity` pattern: the method is
|
|
77
|
+
* `async` (one tick per `update`, which is a per-operation call, not a
|
|
78
|
+
* per-node hot loop), and the per-rewrite {@link isPromiseLike} check skips
|
|
79
|
+
* the `await` for synchronous rewrites — the common case — so a sync chain
|
|
80
|
+
* adds no extra microtask beyond the single tick `async` already costs.
|
|
81
|
+
*
|
|
82
|
+
* `cancelToken` is checked before each rewrite (coarser than within a
|
|
83
|
+
* rewrite, finer than per-chain) so a preempted async chain interrupts
|
|
84
|
+
* cleanly — `interruptAndCheck` throws `OperationCancelled`, which aborts the
|
|
85
|
+
* `update` before any text is applied.
|
|
86
|
+
*/
|
|
87
|
+
apply(model: TTransfer, previous: TAst | undefined, cancelToken?: CancellationToken): Promise<TTransfer>;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=update-rewrite-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-rewrite-service.d.ts","sourceRoot":"","sources":["../../../src/langium/update-rewrite/update-rewrite-service.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAiB,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,KAAK,OAAO,EAAqB,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB,CAClC,SAAS,SAAS,eAAe,GAAG,eAAe,EACnD,IAAI,SAAS,OAAO,GAAG,OAAO,CAC/B,SAAQ,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC;IAC7C,uEAAuE;IACvE,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC;;;;;;;;;OASG;IACH,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,GAAG,SAAS,EAAE,WAAW,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAC3G;AAED;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC;AAEzD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,2BAA2B,CACrC,SAAS,SAAS,eAAe,GAAG,eAAe,EACnD,IAAI,SAAS,OAAO,GAAG,OAAO,CAC/B,YAAW,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC;IAM5C,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,sBAAsB;IALtD,qEAAqE;IACrE,SAAS,CAAC,QAAQ,CAAC,QAAQ,2CAAkD;IAC7E,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAGZ,QAAQ,EAAE,sBAAsB,EACnD,OAAO,GAAE,2BAAgC;IAc5C,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,UAAU;IAI7D,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAI/B;;;;;;;;;;;;OAYG;IACG,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,GAAG,SAAS,EAAE,WAAW,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;CAWhH"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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 { isPromiseLike } from '@hydranium/protocol';
|
|
10
|
+
import { interruptAndCheck } from '@hydranium/langium';
|
|
11
|
+
import { Registry } from '../../util/registry.js';
|
|
12
|
+
/**
|
|
13
|
+
* Default {@link UpdateRewriteService} implementation. A pure ordered registry
|
|
14
|
+
* of transfer-model transforms; the framework ships **zero** members (an empty
|
|
15
|
+
* chain is a no-op). Adopters declare rewrites via
|
|
16
|
+
* `UpdateRewriteContribution`s under the `updateRewrite.rewrites` group,
|
|
17
|
+
* or register imperatively.
|
|
18
|
+
*
|
|
19
|
+
* **Per-language service.** Bound in the per-language module and resolved by
|
|
20
|
+
* `ModelService` via `ServiceRegistry.getServices(uri)`, so multi-grammar
|
|
21
|
+
* workspaces route each write to the right rewrite set.
|
|
22
|
+
*
|
|
23
|
+
* The framework provides no comparison helper and no previous-state accessor —
|
|
24
|
+
* a diff-based rewrite owns its own representation reconciliation (see
|
|
25
|
+
* {@link UpdateRewrite}).
|
|
26
|
+
*/
|
|
27
|
+
export class DefaultUpdateRewriteService {
|
|
28
|
+
services;
|
|
29
|
+
/** Registry of rewrites, keyed by id, iterated in priority order. */
|
|
30
|
+
rewrites = new Registry();
|
|
31
|
+
tracer;
|
|
32
|
+
constructor(services, options = {}) {
|
|
33
|
+
this.services = services;
|
|
34
|
+
this.tracer = services.shared.Tracer.for(options.logName ?? 'UpdateRewrite').trace('instantiated');
|
|
35
|
+
// Read the language's UpdateRewriteContribution group and let each
|
|
36
|
+
// contribution register one or many rewrites through this service.
|
|
37
|
+
// Optional chaining tolerates incomplete test stubs; production wiring
|
|
38
|
+
// always provides the slot via `createServerLanguageModule`.
|
|
39
|
+
const contributions = services.updateRewrite?.rewrites ?? {};
|
|
40
|
+
for (const contribution of Object.values(contributions)) {
|
|
41
|
+
contribution.registerUpdateRewrites(this);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
register(rewrite) {
|
|
45
|
+
return this.rewrites.register(rewrite);
|
|
46
|
+
}
|
|
47
|
+
unregister(id) {
|
|
48
|
+
return this.rewrites.unregister(id);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Fold the model through every rewrite in priority order. Mirrors the
|
|
52
|
+
* `DefaultIntegrityService.enforceIntegrity` pattern: the method is
|
|
53
|
+
* `async` (one tick per `update`, which is a per-operation call, not a
|
|
54
|
+
* per-node hot loop), and the per-rewrite {@link isPromiseLike} check skips
|
|
55
|
+
* the `await` for synchronous rewrites — the common case — so a sync chain
|
|
56
|
+
* adds no extra microtask beyond the single tick `async` already costs.
|
|
57
|
+
*
|
|
58
|
+
* `cancelToken` is checked before each rewrite (coarser than within a
|
|
59
|
+
* rewrite, finer than per-chain) so a preempted async chain interrupts
|
|
60
|
+
* cleanly — `interruptAndCheck` throws `OperationCancelled`, which aborts the
|
|
61
|
+
* `update` before any text is applied.
|
|
62
|
+
*/
|
|
63
|
+
async apply(model, previous, cancelToken) {
|
|
64
|
+
let current = model;
|
|
65
|
+
for (const rewrite of this.rewrites.all()) {
|
|
66
|
+
if (cancelToken !== undefined) {
|
|
67
|
+
await interruptAndCheck(cancelToken);
|
|
68
|
+
}
|
|
69
|
+
const result = rewrite.rewrite(current, previous);
|
|
70
|
+
current = (isPromiseLike(result) ? await result : result);
|
|
71
|
+
}
|
|
72
|
+
return current;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=update-rewrite-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-rewrite-service.js","sourceRoot":"","sources":["../../../src/langium/update-rewrite/update-rewrite-service.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAqC,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAgB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAIrE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AA2ClD;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,2BAA2B;IASf;IALtB,qEAAqE;IAClD,QAAQ,GAAG,IAAI,QAAQ,EAAkC,CAAC;IAC1D,MAAM,CAAS;IAElC,YACsB,QAAgC,EACnD,UAAuC,EAAE;QADtB,aAAQ,GAAR,QAAQ,CAAwB;QAGnD,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,eAAe,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAEnG,mEAAmE;QACnE,mEAAmE;QACnE,uEAAuE;QACvE,6DAA6D;QAC7D,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,EAAE,QAAQ,IAAI,EAAE,CAAC;QAC7D,KAAK,MAAM,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;YACvD,YAAY,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,OAAuC;QAC7C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,KAAK,CAAC,KAAgB,EAAE,QAA0B,EAAE,WAA+B;QACtF,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC;YACzC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC7B,MAAM,iBAAiB,CAAC,WAAW,CAAC,CAAC;YACxC,CAAC;YACD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAClD,OAAO,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,MAAM,CAAc,CAAC;QAC1E,CAAC;QACD,OAAO,OAAO,CAAC;IAClB,CAAC;CACH"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 MaybePromise, type TransferElement } from '@hydranium/protocol';
|
|
10
|
+
import { type AstNode } from '@hydranium/langium';
|
|
11
|
+
import { type RegistryItem } from '../../util/registry.js';
|
|
12
|
+
/**
|
|
13
|
+
* A single transform applied to the incoming transfer model on the structured
|
|
14
|
+
* (object) write path of `ModelService.update` / `ModelService.save`, before
|
|
15
|
+
* serialisation. The RPC-update-stage sibling of `IntegrityRule` /
|
|
16
|
+
* `AstExtension` / `ValidationCheck` — same id-keyed,
|
|
17
|
+
* priority-ordered registry shape, but it runs on the transfer model rather
|
|
18
|
+
* than the built AST, and only on structured writes (never the LSP text path).
|
|
19
|
+
*
|
|
20
|
+
* **Two representations.** The contract is deliberately asymmetric — `model`
|
|
21
|
+
* and `previous` are NOT the same shape, and the types say so:
|
|
22
|
+
*
|
|
23
|
+
* - `model` (and the return) is a **transfer model**: cross-references are
|
|
24
|
+
* flattened to `$refText` strings, derived `_*` properties are folded in as
|
|
25
|
+
* *enumerable* fields, and there are no `$container` back-pointers. It is the
|
|
26
|
+
* plain JSON that arrived over RPC from the form / diagram.
|
|
27
|
+
* - `previous` is a live **AST root** (`document.parseResult.value`): real
|
|
28
|
+
* `Reference` objects, `$container`, and `_*` attached *non-enumerably* by the
|
|
29
|
+
* AST-extension service. It is `undefined` for a not-yet-built document.
|
|
30
|
+
*
|
|
31
|
+
* A rewrite that needs to diff against the previous state owns the
|
|
32
|
+
* representation reconciliation itself (text-vs-`Reference`, enumerable-vs-not).
|
|
33
|
+
* The framework provides no comparison helper — comparison is grammar-specific
|
|
34
|
+
* policy.
|
|
35
|
+
*
|
|
36
|
+
* **Ordering** is by {@link RegistryItem.priority} ascending, ties broken by
|
|
37
|
+
* registration order — so a normalisation pass (low priority) reliably runs
|
|
38
|
+
* before a diff-based reconciliation (higher priority).
|
|
39
|
+
*
|
|
40
|
+
* **Sync fast path.** `rewrite` may return a promise (mirrors
|
|
41
|
+
* `IntegrityRule.enforce`) so an adopter rewrite that consults an external
|
|
42
|
+
* system isn't forced sync; the service keeps purely-sync rewrites — the common
|
|
43
|
+
* case — off the microtask queue.
|
|
44
|
+
*
|
|
45
|
+
* Generic over `<TTransfer, TAst>` so each adopter narrows to its own transfer
|
|
46
|
+
* and AST root types; both default to the structural bases.
|
|
47
|
+
*/
|
|
48
|
+
export interface UpdateRewrite<TTransfer extends TransferElement = TransferElement, TAst extends AstNode = AstNode> extends RegistryItem {
|
|
49
|
+
/**
|
|
50
|
+
* Rewrite the incoming transfer model. Return the input unchanged when the
|
|
51
|
+
* rewrite does not apply (the common no-op case).
|
|
52
|
+
*
|
|
53
|
+
* `previous` is the AST as it stood before this update — read-only; never
|
|
54
|
+
* mutate it. It is `undefined` for a brand-new document, which a diff-based
|
|
55
|
+
* rewrite should treat as "every field is new" (the maximal change case).
|
|
56
|
+
*/
|
|
57
|
+
rewrite(model: TTransfer, previous: TAst | undefined): MaybePromise<TTransfer>;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=update-rewrite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-rewrite.d.ts","sourceRoot":"","sources":["../../../src/langium/update-rewrite/update-rewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,WAAW,aAAa,CAAC,SAAS,SAAS,eAAe,GAAG,eAAe,EAAE,IAAI,SAAS,OAAO,GAAG,OAAO,CAAE,SAAQ,YAAY;IACrI;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,GAAG,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;CACjF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=update-rewrite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-rewrite.js","sourceRoot":"","sources":["../../../src/langium/update-rewrite/update-rewrite.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF"}
|