@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,729 @@
|
|
|
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 { ObservableValue } from '@hydranium/protocol';
|
|
10
|
+
import { DefaultDocumentBuilder, DocumentState, OperationCancelled, UriUtils, interruptAndCheck, isOperationCancelled } from '@hydranium/langium';
|
|
11
|
+
import { CancellationToken } from 'vscode-languageserver-protocol';
|
|
12
|
+
import { CST_REHYDRATION_RESET_STATE, isCstShed } from '../residency/cst-residency-service.js';
|
|
13
|
+
import { labelPhaseListener } from './labeled-phase-listener.js';
|
|
14
|
+
/** Document states a phase-reached line is emitted for by default — every built phase. */
|
|
15
|
+
export const DEFAULT_LOGGED_PHASES = [
|
|
16
|
+
DocumentState.Parsed,
|
|
17
|
+
DocumentState.IndexedContent,
|
|
18
|
+
DocumentState.ComputedScopes,
|
|
19
|
+
DocumentState.Linked,
|
|
20
|
+
DocumentState.IndexedReferences,
|
|
21
|
+
DocumentState.Validated
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Consecutive re-queued builds that leave a waited-on document at the same state
|
|
25
|
+
* before {@link HydraniumDocumentBuilder.awaitDocumentState} stops re-queuing it.
|
|
26
|
+
* A backstop against spinning builds for a document the builder will never carry
|
|
27
|
+
* to the requested state, not a tuning knob — the first re-queue resolves the
|
|
28
|
+
* case this exists for.
|
|
29
|
+
*/
|
|
30
|
+
const MAX_STALLED_REQUEUES = 3;
|
|
31
|
+
/**
|
|
32
|
+
* Extends Langium's {@link DefaultDocumentBuilder} with:
|
|
33
|
+
*
|
|
34
|
+
* - **Bug-fixes** (always on): an {@link awaitDocumentState} that waits where
|
|
35
|
+
* the default rejects, a {@link prepareBuild} that keeps a cancelled
|
|
36
|
+
* non-validating build from suppressing validation, and a
|
|
37
|
+
* {@link shouldRelink} that never judges a document unaffected on an index
|
|
38
|
+
* that does not describe it.
|
|
39
|
+
* - **URI handling** (always on): directory-aware flattening and cascade
|
|
40
|
+
* deletes in {@link update}, plus the CST-rehydration and cross-document
|
|
41
|
+
* refresh resets in {@link resetToState}.
|
|
42
|
+
* - **In-place rebuild helpers** — {@link reparse} and
|
|
43
|
+
* {@link reparseAndRelink} — for a build-phase listener that mutated a
|
|
44
|
+
* document's AST and must reconcile it within the same build.
|
|
45
|
+
* - **Diagnostic dedupe** at `Validated` ({@link dedupeDiagnostics}).
|
|
46
|
+
* - **Logging instrumentation** (default on, opt-out via `logLevel: 'off'`):
|
|
47
|
+
* phase-reached lines, slow-listener breakdowns on `notifyDocumentPhase`,
|
|
48
|
+
* and slow-build-phase totals on `notifyBuildPhase`.
|
|
49
|
+
*
|
|
50
|
+
* Adopters extend this class — the configuration knobs cover what most
|
|
51
|
+
* adopters need; the `format*Line` methods, `formatUri`, and
|
|
52
|
+
* `collectDeletedURIs` are protected so subclasses can customise wording or
|
|
53
|
+
* domain-aware cascades without re-implementing surrounding logic.
|
|
54
|
+
*/
|
|
55
|
+
export class HydraniumDocumentBuilder extends DefaultDocumentBuilder {
|
|
56
|
+
tracer;
|
|
57
|
+
/** Plain — read once at construction to gate phase-listener registration. */
|
|
58
|
+
logLevel;
|
|
59
|
+
/** Plain — read once at construction; drives which phases get a listener. */
|
|
60
|
+
loggedPhases;
|
|
61
|
+
/** Live slow-phase-total threshold; read `.value` per phase. */
|
|
62
|
+
slowPhaseMs;
|
|
63
|
+
/** Live per-listener threshold; read `.value` per phase. */
|
|
64
|
+
slowListenerMs;
|
|
65
|
+
/** Live slow-build-phase-total threshold; read `.value` per phase. */
|
|
66
|
+
slowBuildMs;
|
|
67
|
+
uriPolicy;
|
|
68
|
+
clock;
|
|
69
|
+
/** Narrower handle on the same registry as the inherited `serviceRegistry`, for {@link ExtendedServiceRegistry.registrations}. */
|
|
70
|
+
languageRegistry;
|
|
71
|
+
languageFileExtensions = [];
|
|
72
|
+
/** {@link ExtendedServiceRegistry.registrations} {@link languageFileExtensions} was built at; `-1` until first built. */
|
|
73
|
+
cachedRegistrations = -1;
|
|
74
|
+
lastPhaseMs = 0;
|
|
75
|
+
/** Resolved from {@link DocumentBuilderOptions.refreshCrossDocumentComputedScopes}. */
|
|
76
|
+
refreshCrossDocumentComputedScopes;
|
|
77
|
+
/** LSP event name (e.g. `'didChangeWatchedFiles'`) staged for the next `update()` call. */
|
|
78
|
+
pendingUpdateReason;
|
|
79
|
+
constructor(services, options = {}) {
|
|
80
|
+
super(services);
|
|
81
|
+
this.languageRegistry = services.ServiceRegistry;
|
|
82
|
+
this.uriPolicy = services.workspace.DocumentUriPolicy;
|
|
83
|
+
this.clock = services.Clock;
|
|
84
|
+
this.tracer = services.Tracer.for(options.logName ?? 'DocumentBuilder').trace('instantiated');
|
|
85
|
+
this.logLevel = options.logLevel ?? 'debug';
|
|
86
|
+
this.loggedPhases = options.loggedPhases ?? DEFAULT_LOGGED_PHASES;
|
|
87
|
+
this.slowPhaseMs = ObservableValue.from(options.slowPhaseMs ?? 25);
|
|
88
|
+
this.slowListenerMs = ObservableValue.from(options.slowListenerMs ?? 5);
|
|
89
|
+
this.slowBuildMs = ObservableValue.from(options.slowBuildMs ?? 25);
|
|
90
|
+
this.refreshCrossDocumentComputedScopes = options.refreshCrossDocumentComputedScopes ?? false;
|
|
91
|
+
if (this.logLevel !== 'off') {
|
|
92
|
+
this.registerPhaseListeners();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
// ============================================================
|
|
96
|
+
// Public API — observability primitives
|
|
97
|
+
// ============================================================
|
|
98
|
+
/**
|
|
99
|
+
* Stage an LSP event name for the next `update()` call. Adopters call before
|
|
100
|
+
* the update fires; `HydraniumDocumentUpdateHandler` does it for the
|
|
101
|
+
* four LSP events.
|
|
102
|
+
*
|
|
103
|
+
* The framework stages the value and never reads it back. The consumer is a
|
|
104
|
+
* subclass overriding the build logging, which takes
|
|
105
|
+
* {@link pendingUpdateReason}, clears it, and tags its build line with the
|
|
106
|
+
* event that caused the build. So a grep of this repo alone shows a write
|
|
107
|
+
* with no read — that is the seam working, not a dead field.
|
|
108
|
+
*/
|
|
109
|
+
markNextReason(reason) {
|
|
110
|
+
this.pendingUpdateReason = reason;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Diagnostic snapshot for use in timeout/error messages around document
|
|
114
|
+
* state.
|
|
115
|
+
*
|
|
116
|
+
* Public rather than `protected`, against the default for a `format*`
|
|
117
|
+
* helper: the GLSP head reads it off the shared services tree to build its
|
|
118
|
+
* own diagnostics, and a cross-package caller cannot reach a `protected`
|
|
119
|
+
* member. Narrowing it would move that formatting into the caller and
|
|
120
|
+
* duplicate what this already knows.
|
|
121
|
+
*/
|
|
122
|
+
formatBuildStatus(uri) {
|
|
123
|
+
// Canonicalize at the door (like every other document-lookup): a caller may
|
|
124
|
+
// hold a divergent spelling (e.g. a GLSP state's symlink `_sourceUri`) while
|
|
125
|
+
// the document is keyed by its real path.
|
|
126
|
+
const doc = this.langiumDocuments.getDocument(UriUtils.toUri(this.uriPolicy.canonicalUri(uri)));
|
|
127
|
+
const docState = doc ? DocumentState[doc.state] : 'unknown (document not loaded)';
|
|
128
|
+
const lastPhase = this.lastPhaseMs > 0 ? `${Math.round(performance.now() - this.lastPhaseMs)}ms ago` : 'no phase observed';
|
|
129
|
+
return `current state: '${docState}', last phase: ${lastPhase}`;
|
|
130
|
+
}
|
|
131
|
+
// ============================================================
|
|
132
|
+
// Bug-fixes (always on)
|
|
133
|
+
// ============================================================
|
|
134
|
+
/**
|
|
135
|
+
* Two edge cases the default Langium implementation rejects on:
|
|
136
|
+
* - Document below target state with no build active (newly-created file):
|
|
137
|
+
* wait for the next build instead of rejecting with "workspace state
|
|
138
|
+
* already Validated".
|
|
139
|
+
* - Document at target state but build active and state may regress: wait
|
|
140
|
+
* for phase notification instead of resolving immediately on stale state.
|
|
141
|
+
*
|
|
142
|
+
* When the document is already at target state and no regression is in
|
|
143
|
+
* progress, resolves immediately — avoids deadlocks where callers inside
|
|
144
|
+
* `onDocumentPhase` callbacks would block the active build otherwise.
|
|
145
|
+
*
|
|
146
|
+
* Replacing Langium's rejection with a wait makes the wait's liveness this
|
|
147
|
+
* class's responsibility: a listener can only fire if some build is still
|
|
148
|
+
* going to reach `state`. Both re-queue sites below exist for that, and they
|
|
149
|
+
* differ only in when the orphaning is observed — {@link isOrphaned} at
|
|
150
|
+
* registration time, the `onBuildPhase` branch for a build cancelled after
|
|
151
|
+
* the wait was already armed. Re-queuing stops after
|
|
152
|
+
* {@link MAX_STALLED_REQUEUES} builds that fail to advance the document, so a
|
|
153
|
+
* document the builder will never carry to `state` degrades to a pending wait
|
|
154
|
+
* plus a warning rather than an endless build loop.
|
|
155
|
+
*/
|
|
156
|
+
awaitDocumentState(state, uri, cancelToken) {
|
|
157
|
+
const document = this.langiumDocuments.getDocument(uri);
|
|
158
|
+
if (!document) {
|
|
159
|
+
return super.awaitDocumentState(state, uri, cancelToken);
|
|
160
|
+
}
|
|
161
|
+
if (document.state >= state) {
|
|
162
|
+
return Promise.resolve(uri);
|
|
163
|
+
}
|
|
164
|
+
return new Promise((resolve, reject) => {
|
|
165
|
+
// Re-queues since the document last advanced. A re-queue is only ever
|
|
166
|
+
// worth repeating if the previous one made progress: repeating it for a
|
|
167
|
+
// document the builder will never carry to `state` — an adopter
|
|
168
|
+
// narrowing `shouldValidate`, say — would spin builds forever, since
|
|
169
|
+
// each build's own completion is what re-triggers the branch below.
|
|
170
|
+
// Bounded rather than one-shot because a re-queue legitimately fails to
|
|
171
|
+
// land while a busy workspace keeps cancelling builds.
|
|
172
|
+
let stalledRequeues = 0;
|
|
173
|
+
let lastRequeueState;
|
|
174
|
+
const requeue = (reason) => {
|
|
175
|
+
if (document.state === lastRequeueState) {
|
|
176
|
+
if (++stalledRequeues > MAX_STALLED_REQUEUES) {
|
|
177
|
+
this.tracer
|
|
178
|
+
.withUri(uri.toString())
|
|
179
|
+
.warn(`Giving up re-queuing ${this.formatUri(uri)}: stuck at '${DocumentState[document.state]}', needs ` +
|
|
180
|
+
`'${DocumentState[state]}' after ${stalledRequeues} builds that did not advance it. ` +
|
|
181
|
+
'The wait now depends on its cancellation token.');
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
stalledRequeues = 0;
|
|
187
|
+
lastRequeueState = document.state;
|
|
188
|
+
}
|
|
189
|
+
this.requeueOrphaned(document, state, reason);
|
|
190
|
+
};
|
|
191
|
+
const phaseDisposable = this.onDocumentPhase(state, labelPhaseListener((doc) => {
|
|
192
|
+
if (UriUtils.equals(doc.uri, uri)) {
|
|
193
|
+
cleanup();
|
|
194
|
+
resolve(doc.uri);
|
|
195
|
+
}
|
|
196
|
+
}, 'awaitDocumentState'));
|
|
197
|
+
const buildDisposable = this.onBuildPhase(DocumentState.Validated, () => {
|
|
198
|
+
if (document.state >= state) {
|
|
199
|
+
cleanup();
|
|
200
|
+
resolve(uri);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
// Orphaned by a cancelled build — re-queue so the next build catches it up.
|
|
204
|
+
requeue('cancelled build');
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
const cancelDisposable = cancelToken.onCancellationRequested(() => {
|
|
208
|
+
cleanup();
|
|
209
|
+
reject(OperationCancelled);
|
|
210
|
+
});
|
|
211
|
+
const cleanup = () => {
|
|
212
|
+
phaseDisposable.dispose();
|
|
213
|
+
buildDisposable.dispose();
|
|
214
|
+
cancelDisposable.dispose();
|
|
215
|
+
};
|
|
216
|
+
// Orphaned BEFORE the wait was armed: the build that would have
|
|
217
|
+
// advanced this document has already finished, so neither listener
|
|
218
|
+
// above can ever fire. Re-queue now — the listeners are registered, so
|
|
219
|
+
// the resulting build resolves this wait.
|
|
220
|
+
if (this.isOrphaned(document, state)) {
|
|
221
|
+
requeue('quiescent builder');
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Whether no build will advance `document` to `state`, so a wait on it can
|
|
227
|
+
* only be resolved by starting one.
|
|
228
|
+
*
|
|
229
|
+
* `currentState` is the target phase the builder last *completed*, and both
|
|
230
|
+
* `build` and `update` reset it to `Changed` before stepping the phases — so
|
|
231
|
+
* `currentState >= state` means the workspace has already passed `state`
|
|
232
|
+
* without carrying this document along, rather than being on its way there.
|
|
233
|
+
* That is precisely the condition Langium's `awaitDocumentState` rejects on;
|
|
234
|
+
* this class waits instead, and therefore has to schedule the build itself.
|
|
235
|
+
*
|
|
236
|
+
* The common cause is benign: workspace initialization builds with Langium's
|
|
237
|
+
* default `initialBuildOptions`, whose `validation` is unset, which
|
|
238
|
+
* leaves every document at `IndexedReferences` while the builder's own
|
|
239
|
+
* `currentState` still advances to `Validated` (the validation phase runs
|
|
240
|
+
* over an empty document list). Any first read that wants diagnostics — a
|
|
241
|
+
* one-shot data-head read, a CLI query, `ModelService.validated` — lands
|
|
242
|
+
* here.
|
|
243
|
+
*/
|
|
244
|
+
isOrphaned(document, state) {
|
|
245
|
+
return document.state < state && this.currentState >= state;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Schedule a build for a document no in-flight build will advance. Deliberately
|
|
249
|
+
* fire-and-forget: the caller is a waiter that resolves off the resulting phase
|
|
250
|
+
* notification, so awaiting here would invert the dependency. A rejection is
|
|
251
|
+
* logged rather than swallowed — it leaves the waiter pending until its own
|
|
252
|
+
* cancellation token fires, which is worth a line in the log.
|
|
253
|
+
*/
|
|
254
|
+
requeueOrphaned(document, state, reason) {
|
|
255
|
+
const tracer = this.tracer.withUri(document.uri.toString());
|
|
256
|
+
tracer.info(`Re-queuing orphaned document (at '${DocumentState[document.state]}', needs '${DocumentState[state]}'): ${reason}`);
|
|
257
|
+
this.update([document.uri], []).catch((err) => {
|
|
258
|
+
if (!isOperationCancelled(err)) {
|
|
259
|
+
tracer.error(`Re-queue build failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Don't let a cancelled non-validating build suppress validation forever.
|
|
265
|
+
*
|
|
266
|
+
* Langium's `prepareBuild` deliberately RETAINS the previous build options
|
|
267
|
+
* for a document whose previous build did not complete, so a cancelled
|
|
268
|
+
* build resumes with the options it started under. That is right in
|
|
269
|
+
* general and wrong for exactly one case: the initial workspace build runs
|
|
270
|
+
* with `initialBuildOptions` (`{}` — validation OFF), so if it is cancelled
|
|
271
|
+
* partway, every document it had not yet finished keeps `validation: false`.
|
|
272
|
+
* The next build inherits that, `shouldValidate` returns false, and
|
|
273
|
+
* `buildDocuments` marks those documents COMPLETED without ever validating
|
|
274
|
+
* them — no diagnostics computed, none published, and nothing in the log.
|
|
275
|
+
*
|
|
276
|
+
* A write arriving during workspace startup is enough to trigger it, since
|
|
277
|
+
* `WorkspaceLock.write` cancels the in-flight initial build. Measured: the
|
|
278
|
+
* cross-grammar dependents of an edited document silently never publish.
|
|
279
|
+
*
|
|
280
|
+
* So when the incoming build asks for validation and a retained, incomplete
|
|
281
|
+
* state does not, upgrade that state's validation option. Resuming
|
|
282
|
+
* behaviour is otherwise untouched — the retained state, its phase and its
|
|
283
|
+
* prior result all still stand.
|
|
284
|
+
*/
|
|
285
|
+
prepareBuild(documents, options) {
|
|
286
|
+
super.prepareBuild(documents, options);
|
|
287
|
+
if (!options.validation) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
for (const document of documents) {
|
|
291
|
+
const key = document.uri.toString();
|
|
292
|
+
const state = this.buildState.get(key);
|
|
293
|
+
if (state && !state.completed && !state.options.validation) {
|
|
294
|
+
this.buildState.set(key, { ...state, options: { ...state.options, validation: options.validation } });
|
|
295
|
+
this.tracer.withUri(key).debug('Upgraded a retained incomplete build state to validate (was carrying validation:false)');
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Never judge a document unaffected on an index that does not describe it.
|
|
301
|
+
*
|
|
302
|
+
* Langium's `shouldRelink` asks `IndexManager.isAffected`, which reads the
|
|
303
|
+
* REFERENCE index — populated at `DocumentState.IndexedReferences`. A
|
|
304
|
+
* document that has not reached that phase has no entries there, so
|
|
305
|
+
* `isAffected` returns false for every change: not "unaffected", merely
|
|
306
|
+
* unknown. It is then left at `Linked`, and because `runCancelable` only
|
|
307
|
+
* processes documents whose state is BELOW its target, the next build does
|
|
308
|
+
* not re-link it either — it advances to `Validated` carrying links resolved
|
|
309
|
+
* against the OLD content, and validates clean.
|
|
310
|
+
*
|
|
311
|
+
* An interrupted initial build is enough to produce that state: the workspace
|
|
312
|
+
* build is a `WorkspaceLock.write` action, so any write arriving during
|
|
313
|
+
* startup cancels it, typically between `Linked` and `IndexedReferences`.
|
|
314
|
+
* Measured: the edited document's cross-grammar dependents keep stale,
|
|
315
|
+
* successfully-resolved references and report no diagnostics at all.
|
|
316
|
+
*
|
|
317
|
+
* Treating an un-indexed document as affected is the conservative reading and
|
|
318
|
+
* costs nothing in steady state — documents sit at `Validated` there, so this
|
|
319
|
+
* branch is only taken for documents an interrupted build left behind.
|
|
320
|
+
*/
|
|
321
|
+
shouldRelink(document, changedUris) {
|
|
322
|
+
if (document.state < DocumentState.IndexedReferences) {
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
325
|
+
return super.shouldRelink(document, changedUris);
|
|
326
|
+
}
|
|
327
|
+
// ============================================================
|
|
328
|
+
// URI handling — directory flattening + cascade deletes (always on)
|
|
329
|
+
// ============================================================
|
|
330
|
+
update(changed, deleted, cancelToken) {
|
|
331
|
+
this.ensureLanguageFileExtensions();
|
|
332
|
+
const changedURIs = changed.flatMap(uri => this.flattenAndAdaptURI(uri));
|
|
333
|
+
const deletedURIs = deleted.flatMap(uri => this.collectDeletedURIs(uri));
|
|
334
|
+
return super.update(changedURIs, deletedURIs, cancelToken);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Refresh cross-document `ComputedScopes` derivations on cascade, when
|
|
338
|
+
* {@link refreshCrossDocumentComputedScopes} is set (default off).
|
|
339
|
+
*
|
|
340
|
+
* An `AstExtension` registered at `ComputedScopes` whose `compute` resolves
|
|
341
|
+
* a cross-document reference and reads the target's data depends on another
|
|
342
|
+
* document's content. Langium resets a
|
|
343
|
+
* cascade-affected (referencing) document TO `ComputedScopes` and rebuilds it
|
|
344
|
+
* from `Linked` — so the `ComputedScopes` phase is never re-emitted for it and
|
|
345
|
+
* those derivations keep a stale projection of the referenced document. The
|
|
346
|
+
* symptom: a document whose computed projection of the referenced document
|
|
347
|
+
* — the projection that feeds its scope during `Linked` — does not pick up a
|
|
348
|
+
* member added there until the referencing document is re-parsed.
|
|
349
|
+
*
|
|
350
|
+
* When enabled, reset such documents one phase lower, to `IndexedContent`, so `ComputedScopes`
|
|
351
|
+
* (and its AST-extension pass) re-executes before the document's own link.
|
|
352
|
+
* `IndexedContent` — not `Parsed` — is the minimal reset: the document is left
|
|
353
|
+
* AT `IndexedContent`, so the build's `IndexedContent` pass skips it (no
|
|
354
|
+
* redundant own-symbol re-index) while the `ComputedScopes` pass re-runs
|
|
355
|
+
* `collectLocalSymbols` + the extension refresh. `ComputedScopes` is passed here
|
|
356
|
+
* only for the relink set (changed documents reset to `Changed`,
|
|
357
|
+
* supersession resets to `IndexedReferences`), so this is scoped to exactly the
|
|
358
|
+
* cascade-affected documents. Cost: one extra `collectLocalSymbols` per affected
|
|
359
|
+
* document per cascade.
|
|
360
|
+
*/
|
|
361
|
+
resetToState(document, state) {
|
|
362
|
+
// Rehydrate-on-re-entry after CST shedding. A document whose CST was shed to
|
|
363
|
+
// reclaim memory (its `parseResult.value.$cstNode` nulled while the AST stays
|
|
364
|
+
// resident) cannot be relinked or re-indexed in place: Langium's
|
|
365
|
+
// `DefaultReferenceDescriptionProvider` derives the reference index — and thus
|
|
366
|
+
// `IndexManager.isAffected`, plus the `segment` used by rename / find-references —
|
|
367
|
+
// from each `reference.$refNode`. Re-running `IndexedReferences` with a shed CST
|
|
368
|
+
// drops the document's cross-references from the index (the provider skips any
|
|
369
|
+
// reference whose `$refNode` is missing), so its dependents silently stop being
|
|
370
|
+
// relinked when a referenced document changes, and they keep stale `.ref`s.
|
|
371
|
+
//
|
|
372
|
+
// So any re-entry into the build for a shed document must start from a full
|
|
373
|
+
// re-parse, which rebuilds the CST (and every `$refNode`). The residency
|
|
374
|
+
// feature owns both the "is shed" predicate and the recovery reset state
|
|
375
|
+
// (`CST_REHYDRATION_RESET_STATE`, necessarily `Changed`); this
|
|
376
|
+
// supersedes the `IndexedContent` cascade reset below — a re-parse re-runs
|
|
377
|
+
// every phase regardless.
|
|
378
|
+
if (isCstShed(document)) {
|
|
379
|
+
this.tracer.debug(`rehydrating CST of ${this.formatUri(document.uri)} (re-entered build while shed)`);
|
|
380
|
+
super.resetToState(document, CST_REHYDRATION_RESET_STATE);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
const targetState = this.refreshCrossDocumentComputedScopes && state === DocumentState.ComputedScopes ? DocumentState.IndexedContent : state;
|
|
384
|
+
super.resetToState(document, targetState);
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Re-parse a single document in place from its *current text* (the synced
|
|
388
|
+
* store, else disk), advancing it to `Parsed`. A thin wrapper over Langium's
|
|
389
|
+
* document factory so a caller already holding the write lock — e.g. the
|
|
390
|
+
* integrity service, which updated the document text after mutating its AST —
|
|
391
|
+
* can re-derive a fresh, consistent CST/AST without a full `update()` cycle.
|
|
392
|
+
*
|
|
393
|
+
* Reads the canonical source the build itself parses (not a passed-in
|
|
394
|
+
* string), so the CST cannot drift from the synced text; callers must update
|
|
395
|
+
* the text before calling.
|
|
396
|
+
*/
|
|
397
|
+
async reparse(document, cancelToken = CancellationToken.None) {
|
|
398
|
+
await this.langiumDocumentFactory.update(document, cancelToken);
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Re-run the parse → index-content → local-scopes → link phases (0–3) for a
|
|
402
|
+
* single already-built document, in place — re-firing the per-document phase
|
|
403
|
+
* notifications (`onDocumentPhase`, e.g. AST-extension refresh) but NOT the
|
|
404
|
+
* batch `onBuildPhase` notifications.
|
|
405
|
+
*
|
|
406
|
+
* For a build-phase listener (e.g. the integrity service) that mutated a
|
|
407
|
+
* document's AST *after* it was linked — and updated its text to match — and
|
|
408
|
+
* must reconcile the document within the SAME build. A bare AST mutation
|
|
409
|
+
* leaves the CST stale, which makes Langium's re-parse gate
|
|
410
|
+
* (`DefaultLangiumDocumentFactory.update`, keyed on the CST's `fullText`)
|
|
411
|
+
* skip the re-parse on a later build and strand the mutated AST (a corrected
|
|
412
|
+
* edge never returns on reopen). Re-running the document through
|
|
413
|
+
* {@link buildDocuments} would re-fire `onBuildPhase` and re-enter the
|
|
414
|
+
* listener (recursion), so this mirrors {@link runCancelable}'s per-document
|
|
415
|
+
* progression (op → set state → `notifyDocumentPhase`) for phases 0–3 while
|
|
416
|
+
* deliberately omitting `notifyBuildPhase`.
|
|
417
|
+
*
|
|
418
|
+
* Re-firing `onDocumentPhase` matters: per-document derivations such as
|
|
419
|
+
* AST-extension computed properties are wired there, and the freshly
|
|
420
|
+
* re-parsed AST would otherwise lack them. The caller
|
|
421
|
+
* runs inside the `Linked` build phase; the build carries the document
|
|
422
|
+
* through IndexedReferences + Validation (and their `onDocumentPhase`) next.
|
|
423
|
+
*/
|
|
424
|
+
async reparseAndRelink(document, cancelToken = CancellationToken.None) {
|
|
425
|
+
const languageServices = this.serviceRegistry.getServices(document.uri);
|
|
426
|
+
// Phase 0 — Parse (the factory sets state to `Parsed` itself).
|
|
427
|
+
await this.reparse(document, cancelToken);
|
|
428
|
+
await this.notifyDocumentPhase(document, DocumentState.Parsed, cancelToken);
|
|
429
|
+
// Phase 1 — Index content.
|
|
430
|
+
await this.indexManager.updateContent(document, cancelToken);
|
|
431
|
+
document.state = DocumentState.IndexedContent;
|
|
432
|
+
await this.notifyDocumentPhase(document, DocumentState.IndexedContent, cancelToken);
|
|
433
|
+
// Phase 2 — Local scopes.
|
|
434
|
+
document.localSymbols = await languageServices.references.ScopeComputation.collectLocalSymbols(document, cancelToken);
|
|
435
|
+
document.state = DocumentState.ComputedScopes;
|
|
436
|
+
await this.notifyDocumentPhase(document, DocumentState.ComputedScopes, cancelToken);
|
|
437
|
+
// Phase 3 — Linking.
|
|
438
|
+
await languageServices.references.Linker.link(document, cancelToken);
|
|
439
|
+
document.state = DocumentState.Linked;
|
|
440
|
+
await this.notifyDocumentPhase(document, DocumentState.Linked, cancelToken);
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Cached on first access — language registration completes after
|
|
444
|
+
* construction — and refreshed on every registration since.
|
|
445
|
+
*
|
|
446
|
+
* The refresh matters because the cache is otherwise held for the process
|
|
447
|
+
* lifetime: a language registered after the first directory expansion would
|
|
448
|
+
* be silently excluded from it, so files of that language would never build
|
|
449
|
+
* on a watched-directory change.
|
|
450
|
+
*
|
|
451
|
+
* Keyed on the registry's monotonic `registrations` counter, not on
|
|
452
|
+
* `all.length`: `register` writes into a map keyed by language id, so
|
|
453
|
+
* REPLACING a registered id leaves the length unchanged and a
|
|
454
|
+
* count-keyed cache would keep the replaced language's extensions. One
|
|
455
|
+
* integer comparison per call, and the "registration must be finished
|
|
456
|
+
* before the first expansion" precondition is gone rather than narrowed.
|
|
457
|
+
*/
|
|
458
|
+
ensureLanguageFileExtensions() {
|
|
459
|
+
const registrations = this.languageRegistry.registrations;
|
|
460
|
+
if (this.cachedRegistrations !== registrations) {
|
|
461
|
+
this.languageFileExtensions = this.languageRegistry.all.flatMap(service => service.LanguageMetaData.fileExtensions);
|
|
462
|
+
this.cachedRegistrations = registrations;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Expand a changed URI to the registered-language files it covers, keyed
|
|
467
|
+
* canonically. A file resolves to itself (when its extension is registered);
|
|
468
|
+
* a directory expands to every registered language file beneath it.
|
|
469
|
+
*
|
|
470
|
+
* The expansion goes through the `FileSystemProvider` so it is
|
|
471
|
+
* platform-agnostic and discovers on-disk files that are *not yet loaded as
|
|
472
|
+
* documents*: the Node provider walks the real filesystem (a freshly added
|
|
473
|
+
* directory or never-opened file still builds), while a browser / empty
|
|
474
|
+
* provider yields nothing. `uriPolicy.loadUri` first maps the URI to its
|
|
475
|
+
* load identity — `undefined` (no on-disk content) short-circuits to `[]`
|
|
476
|
+
* rather than a doomed read, and a symlink resolves to its real path so the
|
|
477
|
+
* built documents key the same way every other layer does.
|
|
478
|
+
*/
|
|
479
|
+
flattenAndAdaptURI(uri) {
|
|
480
|
+
const resolved = this.uriPolicy.loadUri(uri);
|
|
481
|
+
return resolved ? this.collectLanguageFiles(resolved) : [];
|
|
482
|
+
}
|
|
483
|
+
/** Recurse `uri` through the `FileSystemProvider`, gathering registered
|
|
484
|
+
* language files. A directory's entries carry their own `isDirectory`, so
|
|
485
|
+
* the walk stats each node once (via `readDirectorySync`). */
|
|
486
|
+
collectLanguageFiles(uri) {
|
|
487
|
+
if (!this.isDirectory(uri)) {
|
|
488
|
+
return this.isLanguageFile(uri) ? [uri] : [];
|
|
489
|
+
}
|
|
490
|
+
return this.fileSystemProvider.readDirectorySync(uri).flatMap(entry => {
|
|
491
|
+
if (entry.isDirectory) {
|
|
492
|
+
return this.collectLanguageFiles(entry.uri);
|
|
493
|
+
}
|
|
494
|
+
return this.isLanguageFile(entry.uri) ? [entry.uri] : [];
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
/** A path the provider cannot stat as a directory (missing / unreadable / a
|
|
498
|
+
* plain file) is treated as a non-directory; `collectLanguageFiles` then
|
|
499
|
+
* filters it by extension. */
|
|
500
|
+
isDirectory(uri) {
|
|
501
|
+
try {
|
|
502
|
+
return this.fileSystemProvider.statSync(uri).isDirectory;
|
|
503
|
+
}
|
|
504
|
+
catch {
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
/** True when `uri`'s extension matches one of the registered language extensions. */
|
|
509
|
+
isLanguageFile(uri) {
|
|
510
|
+
return this.languageFileExtensions.includes(UriUtils.extname(uri));
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* Collect URIs to delete when `uri` is deleted. Default: if `uri` is a
|
|
514
|
+
* file, return `[uri]`; if it's a directory, return all documents under
|
|
515
|
+
* that path. Override for domain-aware cascades (e.g. when deleting a
|
|
516
|
+
* project descriptor should cascade to all its members).
|
|
517
|
+
*/
|
|
518
|
+
collectDeletedURIs(uri) {
|
|
519
|
+
if (UriUtils.extname(uri)) {
|
|
520
|
+
return [uri];
|
|
521
|
+
}
|
|
522
|
+
return [
|
|
523
|
+
...this.langiumDocuments.all
|
|
524
|
+
.filter(doc => UriUtils.contains(uri, doc.uri))
|
|
525
|
+
.map(doc => doc.uri)
|
|
526
|
+
.toArray(),
|
|
527
|
+
uri
|
|
528
|
+
];
|
|
529
|
+
}
|
|
530
|
+
// ============================================================
|
|
531
|
+
// Logging — phase-reached listeners
|
|
532
|
+
// ============================================================
|
|
533
|
+
registerPhaseListeners() {
|
|
534
|
+
for (const state of this.loggedPhases) {
|
|
535
|
+
this.onBuildPhase(state, documents => this.onPhaseReached(state, documents));
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
/** Called once per phase-reached event. Override to add custom side-effects beyond logging. */
|
|
539
|
+
onPhaseReached(state, documents) {
|
|
540
|
+
const now = performance.now();
|
|
541
|
+
const elapsedMs = Math.round(now - this.lastPhaseMs);
|
|
542
|
+
this.lastPhaseMs = now;
|
|
543
|
+
this.log(this.phaseReachedLine(state, documents, elapsedMs));
|
|
544
|
+
}
|
|
545
|
+
/** Format the phase-reached log line. Override to customise wording. */
|
|
546
|
+
phaseReachedLine(state, documents, elapsedMs) {
|
|
547
|
+
const docInfo = documents.length === 1 ? this.formatUri(documents[0].uri) : `${documents.length} docs`;
|
|
548
|
+
return `Reached phase '${DocumentState[state]}' [${docInfo}, ${elapsedMs}ms since previous phase]`;
|
|
549
|
+
}
|
|
550
|
+
// ============================================================
|
|
551
|
+
// Logging — slow-listener breakdown on notifyDocumentPhase
|
|
552
|
+
// ============================================================
|
|
553
|
+
async notifyDocumentPhase(document, state, cancelToken) {
|
|
554
|
+
// Before the listeners, one of which is Langium's diagnostics publisher.
|
|
555
|
+
// Running first is NOT the same as running atomically with them: the loop
|
|
556
|
+
// below awaits, Langium's validate PUSHES onto the live array rather than
|
|
557
|
+
// replacing it, and the publisher reads that array when it is invoked. A
|
|
558
|
+
// build settling inside that window therefore appends after this call has
|
|
559
|
+
// already deduped, and the appended duplicate is published by the listener
|
|
560
|
+
// of the build that deduped. Only `serializeBuilds` closes the window.
|
|
561
|
+
if (state === DocumentState.Validated) {
|
|
562
|
+
this.dedupeDiagnostics(document);
|
|
563
|
+
}
|
|
564
|
+
if (this.logLevel === 'off') {
|
|
565
|
+
return super.notifyDocumentPhase(document, state, cancelToken);
|
|
566
|
+
}
|
|
567
|
+
const listeners = this.documentPhaseListeners.get(state).slice();
|
|
568
|
+
if (listeners.length === 0) {
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
const perListenerMs = [];
|
|
572
|
+
let cancelledListeners = 0;
|
|
573
|
+
const { elapsedMs: totalMs } = await this.clock.measure(async () => {
|
|
574
|
+
for (const listener of listeners) {
|
|
575
|
+
const { elapsedMs } = await this.clock.measure(async () => {
|
|
576
|
+
try {
|
|
577
|
+
await interruptAndCheck(cancelToken);
|
|
578
|
+
await listener(document, cancelToken);
|
|
579
|
+
}
|
|
580
|
+
catch (err) {
|
|
581
|
+
if (!isOperationCancelled(err)) {
|
|
582
|
+
throw err;
|
|
583
|
+
}
|
|
584
|
+
cancelledListeners++;
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
perListenerMs.push(elapsedMs);
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
if (cancelledListeners > 0) {
|
|
591
|
+
this.tracer
|
|
592
|
+
.withUri(document.uri.toString())
|
|
593
|
+
.info(this.cancelledDocumentPhaseLine(document, state, cancelledListeners, listeners.length));
|
|
594
|
+
}
|
|
595
|
+
if (totalMs >= this.slowPhaseMs.value) {
|
|
596
|
+
this.log(this.slowDocumentPhaseLine(document, state, listeners, perListenerMs, totalMs));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Format the skipped-listener line.
|
|
601
|
+
*
|
|
602
|
+
* Worth `info` rather than `debug` because of what the skip costs: Langium's
|
|
603
|
+
* `runCancelable` assigns `document.state = targetState` BEFORE calling
|
|
604
|
+
* `notifyDocumentPhase`, so a token that cancels here leaves the document AT
|
|
605
|
+
* the phase with its listeners never run — and the next build's
|
|
606
|
+
* `document.state < targetState` guard then skips it, so nothing re-notifies.
|
|
607
|
+
* At `DocumentState.Validated` the skipped listener is Langium's diagnostics
|
|
608
|
+
* publisher, so the client silently never receives those diagnostics.
|
|
609
|
+
*/
|
|
610
|
+
cancelledDocumentPhaseLine(document, state, cancelled, total) {
|
|
611
|
+
return (`notifyDocumentPhase '${DocumentState[state]}' [${this.formatUri(document.uri)}]: ` +
|
|
612
|
+
`${cancelled} of ${total} listeners skipped by cancellation — the document is AT this phase but they did not run`);
|
|
613
|
+
}
|
|
614
|
+
/** Format the slow-listener breakdown line. Override to customise wording. */
|
|
615
|
+
slowDocumentPhaseLine(document, state, listeners, perListenerMs, totalMs) {
|
|
616
|
+
const slow = perListenerMs
|
|
617
|
+
.map((ms, i) => ({ ms, i }))
|
|
618
|
+
.filter(x => x.ms >= this.slowListenerMs.value)
|
|
619
|
+
.sort((a, b) => b.ms - a.ms)
|
|
620
|
+
.map(x => `${this.formatListener(listeners[x.i], x.i)}:${x.ms.toFixed(0)}ms`);
|
|
621
|
+
const breakdown = slow.length > 0 ? ` — slow listeners: [${slow.join(', ')}]` : '';
|
|
622
|
+
return `notifyDocumentPhase '${DocumentState[state]}' [${this.formatUri(document.uri)}]: ${listeners.length} listeners in ${totalMs.toFixed(0)}ms${breakdown}`;
|
|
623
|
+
}
|
|
624
|
+
// ============================================================
|
|
625
|
+
// Logging — slow build-phase total on notifyBuildPhase
|
|
626
|
+
// ============================================================
|
|
627
|
+
async notifyBuildPhase(documents, state, cancelToken) {
|
|
628
|
+
if (this.logLevel === 'off') {
|
|
629
|
+
return super.notifyBuildPhase(documents, state, cancelToken);
|
|
630
|
+
}
|
|
631
|
+
const listeners = this.buildPhaseListeners.get(state);
|
|
632
|
+
if (documents.length === 0 || listeners.length === 0) {
|
|
633
|
+
return super.notifyBuildPhase(documents, state, cancelToken);
|
|
634
|
+
}
|
|
635
|
+
const { elapsedMs: totalMs } = await this.clock.measure(() => super.notifyBuildPhase(documents, state, cancelToken));
|
|
636
|
+
if (totalMs >= this.slowBuildMs.value) {
|
|
637
|
+
this.log(this.slowBuildPhaseLine(state, listeners.length, documents, totalMs));
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
/** Format the slow build-phase line. Override to customise wording. */
|
|
641
|
+
slowBuildPhaseLine(state, listenerCount, documents, totalMs) {
|
|
642
|
+
return `notifyBuildPhase '${DocumentState[state]}': ${listenerCount} listeners, ${documents.length} docs in ${totalMs.toFixed(0)}ms`;
|
|
643
|
+
}
|
|
644
|
+
// ============================================================
|
|
645
|
+
// Shared formatting hooks
|
|
646
|
+
// ============================================================
|
|
647
|
+
/** Format a URI for inclusion in log lines. Default: `uri.toString()`. Override for workspace-relative paths. */
|
|
648
|
+
formatUri(uri) {
|
|
649
|
+
return uri.toString();
|
|
650
|
+
}
|
|
651
|
+
/** Get a human-readable identifier for a phase listener. Falls back to `function.name` or `#index`. */
|
|
652
|
+
formatListener(listener, index) {
|
|
653
|
+
const labeled = listener;
|
|
654
|
+
return labeled.displayName ?? (listener.name && listener.name !== 'anonymous' ? listener.name : `#${index}`);
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Collapse byte-identical duplicate diagnostics on `document`, in place.
|
|
658
|
+
*
|
|
659
|
+
* Two unserialised validation passes over one document report everything
|
|
660
|
+
* twice: Langium's validate appends to `document.diagnostics` when they are
|
|
661
|
+
* already set — deliberately, so a category-partitioned pass keeps the earlier
|
|
662
|
+
* category's findings — and a repeated FULL pass therefore doubles the list.
|
|
663
|
+
* `ModelServiceOptions.serializeBuilds` prevents that at the source; this is
|
|
664
|
+
* the net for configurations that allow concurrent builds anyway.
|
|
665
|
+
*
|
|
666
|
+
* Clearing the list before a pass is NOT an alternative: the append happens at
|
|
667
|
+
* pass completion, so two interleaved passes both clear, both finish, and the
|
|
668
|
+
* second still appends onto the first.
|
|
669
|
+
*
|
|
670
|
+
* **Equality is structural over the WHOLE diagnostic**, not a chosen subset of
|
|
671
|
+
* fields. That matters: `Diagnostic` carries `data` (which drives quick fixes),
|
|
672
|
+
* `relatedInformation`, `tags` and `source` besides the obvious range/message,
|
|
673
|
+
* so keying on a subset could collapse two findings that differ only in a
|
|
674
|
+
* code action. Duplicates produced by re-running the same checks over the same
|
|
675
|
+
* AST are identical in every field, so full structural equality removes
|
|
676
|
+
* exactly those. The one behavioural difference from a single pass: if a
|
|
677
|
+
* single pass ever emitted two byte-identical diagnostics, the count drops to
|
|
678
|
+
* one — indistinguishable to any consumer, since nothing can tell the two
|
|
679
|
+
* apart.
|
|
680
|
+
*
|
|
681
|
+
* Cost is kept off the common path. Each diagnostic contributes one short
|
|
682
|
+
* range key; a diagnostic is serialised ONLY when something else already
|
|
683
|
+
* occupies its range, so a document whose diagnostics are all at distinct
|
|
684
|
+
* ranges — every document, whenever builds are serialised — is walked without
|
|
685
|
+
* serialising anything.
|
|
686
|
+
*/
|
|
687
|
+
dedupeDiagnostics(document) {
|
|
688
|
+
const diagnostics = document.diagnostics;
|
|
689
|
+
if (!diagnostics || diagnostics.length < 2) {
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
const byRange = new Map();
|
|
693
|
+
const unique = [];
|
|
694
|
+
for (const diagnostic of diagnostics) {
|
|
695
|
+
const { start, end } = diagnostic.range;
|
|
696
|
+
const range = `${start.line}:${start.character}-${end.line}:${end.character}`;
|
|
697
|
+
const bucket = byRange.get(range);
|
|
698
|
+
if (!bucket) {
|
|
699
|
+
// First at this range: no candidate to compare against, so no
|
|
700
|
+
// serialisation. This is the whole list when nothing is duplicated,
|
|
701
|
+
// which is the default configuration's every call.
|
|
702
|
+
byRange.set(range, [diagnostic]);
|
|
703
|
+
unique.push(diagnostic);
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
// Same range as something already kept — now it is worth comparing, and
|
|
707
|
+
// the comparison is over the WHOLE diagnostic so two findings differing
|
|
708
|
+
// only in `data` (a quick-fix payload) or `relatedInformation` survive.
|
|
709
|
+
const serialised = JSON.stringify(diagnostic);
|
|
710
|
+
if (bucket.some(kept => JSON.stringify(kept) === serialised)) {
|
|
711
|
+
continue;
|
|
712
|
+
}
|
|
713
|
+
bucket.push(diagnostic);
|
|
714
|
+
unique.push(diagnostic);
|
|
715
|
+
}
|
|
716
|
+
if (unique.length !== diagnostics.length) {
|
|
717
|
+
this.tracer.debug(`collapsed ${diagnostics.length - unique.length} duplicate diagnostic(s) on ${this.formatUri(document.uri)}`);
|
|
718
|
+
document.diagnostics = unique;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
// ============================================================
|
|
722
|
+
// Internal helpers
|
|
723
|
+
// ============================================================
|
|
724
|
+
/** Dispatch a log line at the configured log level; a no-op when `logLevel === 'off'`. */
|
|
725
|
+
log(message) {
|
|
726
|
+
this.tracer.logAt(this.logLevel, message);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
//# sourceMappingURL=document-builder.js.map
|