@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,57 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { DEFER_START_MS } from '@hydranium/protocol';
|
|
10
|
+
const DIVIDER = '───────────────────────────────────────────────────────────────────';
|
|
11
|
+
/**
|
|
12
|
+
* Emits session info and log format conventions. The body is portable
|
|
13
|
+
* (browser-safe); Node-specific runtime details and monitor conventions are
|
|
14
|
+
* injected via {@link LogPreambleOptions.systemInfoLines} /
|
|
15
|
+
* {@link LogPreambleOptions.conventionLines} (see `@hydranium/core/node`).
|
|
16
|
+
*/
|
|
17
|
+
export function logPreamble(logger, options) {
|
|
18
|
+
logSessionInfo(logger, options.productName, options.version, options.systemInfoLines ?? []);
|
|
19
|
+
logFormatConventions(logger, options.phaseDetailThresholdMs ?? 50, options.conventionLines ?? []);
|
|
20
|
+
}
|
|
21
|
+
function logSessionInfo(logger, productName, version, systemInfoLines) {
|
|
22
|
+
const now = new Date();
|
|
23
|
+
const dateStr = now.toISOString().slice(0, 10); // YYYY-MM-DD, unambiguous across midnight
|
|
24
|
+
const lines = [
|
|
25
|
+
DIVIDER,
|
|
26
|
+
`${productName} server session`,
|
|
27
|
+
DIVIDER,
|
|
28
|
+
`date ${dateStr}`,
|
|
29
|
+
`version ${version}`,
|
|
30
|
+
...systemInfoLines,
|
|
31
|
+
DIVIDER
|
|
32
|
+
];
|
|
33
|
+
for (const line of lines) {
|
|
34
|
+
logger.info(line);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function logFormatConventions(logger, phaseDetailThresholdMs, conventionLines) {
|
|
38
|
+
const lines = [
|
|
39
|
+
'Log format conventions',
|
|
40
|
+
DIVIDER,
|
|
41
|
+
'• Timing pairs: "<op> [#N start]" -> "<op> [#N done|cancelled|failed, Nms]"',
|
|
42
|
+
'• Rebuild tags: contextual metadata lives inside the status brackets, e.g.',
|
|
43
|
+
' "[#N start, event: didChangeContent, cancels #M]"',
|
|
44
|
+
`• Quiet ops: operations under ${DEFER_START_MS}ms are silent; lifecycle ops (save, load) always log`,
|
|
45
|
+
' (failures/cancels always log, even below the threshold - in that case',
|
|
46
|
+
' [start] is emitted retroactively so timestamps may be back-to-back while',
|
|
47
|
+
' the reported Nms is the real elapsed time)',
|
|
48
|
+
`• Phase detail: Parsed/IndexedContent/.../Validated shown only for rebuilds >=${phaseDetailThresholdMs}ms;`,
|
|
49
|
+
' workspace init always emits per-phase lines live',
|
|
50
|
+
...conventionLines,
|
|
51
|
+
DIVIDER
|
|
52
|
+
];
|
|
53
|
+
for (const line of lines) {
|
|
54
|
+
logger.info(line);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=log-preamble.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-preamble.js","sourceRoot":"","sources":["../../../src/langium/diagnostics/log-preamble.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,cAAc,EAAe,MAAM,qBAAqB,CAAC;AAElE,MAAM,OAAO,GAAG,qEAAqE,CAAC;AA4BtF;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,OAA2B;IACpE,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;IAC5F,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,sBAAsB,IAAI,EAAE,EAAE,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;AACrG,CAAC;AAED,SAAS,cAAc,CAAC,MAAc,EAAE,WAAmB,EAAE,OAAe,EAAE,eAAkC;IAC7G,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,OAAO,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,0CAA0C;IAC1F,MAAM,KAAK,GAAG;QACX,OAAO;QACP,GAAG,WAAW,iBAAiB;QAC/B,OAAO;QACP,eAAe,OAAO,EAAE;QACxB,eAAe,OAAO,EAAE;QACxB,GAAG,eAAe;QAClB,OAAO;KACT,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAc,EAAE,sBAA8B,EAAE,eAAkC;IAC7G,MAAM,KAAK,GAAG;QACX,wBAAwB;QACxB,OAAO;QACP,iFAAiF;QACjF,8EAA8E;QAC9E,qEAAqE;QACrE,sCAAsC,cAAc,sDAAsD;QAC1G,yFAAyF;QACzF,4FAA4F;QAC5F,8DAA8D;QAC9D,mFAAmF,sBAAsB,KAAK;QAC9G,oEAAoE;QACpE,GAAG,eAAe;QAClB,OAAO;KACT,CAAC;IACF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
/** Only append a memory suffix when the heap has moved by at least this much since the last log line. */
|
|
10
|
+
export declare const MEMORY_DELTA_BYTES: number;
|
|
11
|
+
/**
|
|
12
|
+
* Pluggable file-tee sink. The file-tee's only platform coupling is the
|
|
13
|
+
* actual disk write + directory create; routing those through an injected
|
|
14
|
+
* sink keeps this module free of `node:fs` so it stays on the portable `.`
|
|
15
|
+
* entry. `@hydranium/core/node` installs a `node:fs`-backed sink (see
|
|
16
|
+
* `installNodeLogFileSink`); when
|
|
17
|
+
* no sink is installed (browser / in-memory hosts) the file-tee is inert and
|
|
18
|
+
* lines fan out only to the LSP/console destination. Configuring a tee target
|
|
19
|
+
* (`HYDRANIUM_LOG_FILE`) is itself Node-only, so the inert path is never hit
|
|
20
|
+
* in a browser.
|
|
21
|
+
*/
|
|
22
|
+
export interface LogFileSink {
|
|
23
|
+
/** Append already-formatted text to the file at `path`. Must not throw. */
|
|
24
|
+
append(path: string, data: string): void;
|
|
25
|
+
/** Best-effort create of the parent directory for `path`. Must not throw. */
|
|
26
|
+
ensureDir(path: string): void;
|
|
27
|
+
}
|
|
28
|
+
/** Install (or clear, with `undefined`) the file-tee sink. Idempotent. */
|
|
29
|
+
export declare function setLogFileSink(sink: LogFileSink | undefined): void;
|
|
30
|
+
/**
|
|
31
|
+
* Set the file-tee target programmatically. Pass `undefined` to disable. The
|
|
32
|
+
* path may contain `{placeholder}` tokens (e.g. `{workspace}`); lines buffer
|
|
33
|
+
* until every token is supplied via {@link resolveLogFilePlaceholder}.
|
|
34
|
+
* Called by the `LspLogger` constructor's
|
|
35
|
+
* one-time `HYDRANIUM_LOG_FILE` env baseline (and by tests).
|
|
36
|
+
*/
|
|
37
|
+
export declare function setLogFilePath(path: string | undefined): void;
|
|
38
|
+
/**
|
|
39
|
+
* Supply a value for a `{name}` placeholder in the configured target. Once the
|
|
40
|
+
* last placeholder is supplied the target resolves and any lines buffered while
|
|
41
|
+
* it was pending are flushed in emission order.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveLogFilePlaceholder(name: string, value: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* Last-resort flush for the case where the target never resolves (e.g. the
|
|
46
|
+
* server crashed before the workspace was known). Substitutes any remaining
|
|
47
|
+
* `{...}` token with a process-unique `_startup-<pid>` segment and flushes the
|
|
48
|
+
* buffer, so startup / failure lines are never lost. No-op when the target is
|
|
49
|
+
* already resolved or there is nothing buffered. Registered on `process.exit`
|
|
50
|
+
* as soon as an unresolved target is configured.
|
|
51
|
+
*/
|
|
52
|
+
export declare function flushLogFileFallback(): void;
|
|
53
|
+
/** Current resolved file-tee target. `undefined` when disabled or still pending. */
|
|
54
|
+
export declare function getLogFilePath(): string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Fan a single already-formatted log line out to the file-tee target, if one is
|
|
57
|
+
* configured. Called by `LspLogger`'s emit in
|
|
58
|
+
* addition to the LSP/console sink — log sinks fan out, they don't replace.
|
|
59
|
+
* While the target is still pending (unresolved `{placeholder}`), the line is
|
|
60
|
+
* buffered instead of dropped.
|
|
61
|
+
*/
|
|
62
|
+
export declare function teeLogLine(formatted: string): void;
|
|
63
|
+
export { toLogFileWorkspaceToken } from './log-file-token.js';
|
|
64
|
+
/**
|
|
65
|
+
* Shared options-base for every framework-bound service that derives a
|
|
66
|
+
* `Tracer` (or
|
|
67
|
+
* `Logger`) from its `services`
|
|
68
|
+
* constructor parameter. Carries the `logName` label used to identify the
|
|
69
|
+
* service in its log / trace output and in the startup instantiation trace.
|
|
70
|
+
*
|
|
71
|
+
* The field name reads from the adopter's perspective — `logName` is "the
|
|
72
|
+
* name this service appears under in the log". Distinct from
|
|
73
|
+
* `LspLoggerOptions.component`, which is the logger's own identity field
|
|
74
|
+
* (matches `AbstractLogger.component` and `Logger.for`'s argument).
|
|
75
|
+
*
|
|
76
|
+
* A framework service's constructor stores a tracer named by `logName` and
|
|
77
|
+
* emits a single instantiation trace. The fallback used when `logName` is
|
|
78
|
+
* absent is chosen per service: a fixed curated string where the slot has one
|
|
79
|
+
* canonical implementation, or `this.constructor.name` where it has swappable
|
|
80
|
+
* strategy bindings, so the log shows which implementation ran. The
|
|
81
|
+
* framework's default `Logger` level is `'info'`, so those trace lines are
|
|
82
|
+
* no-ops in production; raising the level to `trace` — directly or via the
|
|
83
|
+
* LSP-config-bound setting — before workspace load makes startup
|
|
84
|
+
* instantiation visible.
|
|
85
|
+
*/
|
|
86
|
+
export interface LogNameOptions {
|
|
87
|
+
/**
|
|
88
|
+
* Name passed to `Tracer.for(...)` / `Logger.for(...)` — the label the
|
|
89
|
+
* service appears under in its log / trace output. Optional; each
|
|
90
|
+
* service supplies its own default (a fixed curated string, or
|
|
91
|
+
* `this.constructor.name`). Override when the runtime class name is
|
|
92
|
+
* generic (anonymous adopter subclass) or when multiple instances of
|
|
93
|
+
* the same class are bound to distinct slots and the adopter wants to
|
|
94
|
+
* disambiguate them in the log.
|
|
95
|
+
*/
|
|
96
|
+
readonly logName?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Format current memory as "heap used/total, rss N". Returns `''` where
|
|
100
|
+
* `process.memoryUsage` is unavailable (browser) so callers can append it
|
|
101
|
+
* unconditionally.
|
|
102
|
+
*/
|
|
103
|
+
export declare function formatMemory(): string;
|
|
104
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/langium/diagnostics/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAKlF,yGAAyG;AACzG,eAAO,MAAM,kBAAkB,QAAkB,CAAC;AAElD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW;IACzB,2EAA2E;IAC3E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,6EAA6E;IAC7E,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAID,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAElE;AA6ED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAM7D;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAG3E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAO3C;AAaD,oFAAoF;AACpF,wBAAgB,cAAc,IAAI,MAAM,GAAG,SAAS,CAEnD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAYlD;AAKD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,cAAc;IAC5B;;;;;;;;OAQG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAMrC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { Format } from '@hydranium/protocol';
|
|
10
|
+
import { currentMemoryUsage, onProcessEvent, processPid } from '../../util/environment.js';
|
|
11
|
+
/** Only append a memory suffix when the heap has moved by at least this much since the last log line. */
|
|
12
|
+
export const MEMORY_DELTA_BYTES = 5 * 1024 * 1024;
|
|
13
|
+
let fileSink;
|
|
14
|
+
/** Install (or clear, with `undefined`) the file-tee sink. Idempotent. */
|
|
15
|
+
export function setLogFileSink(sink) {
|
|
16
|
+
fileSink = sink;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* File-tee state for `LspLogger`'s emit. When
|
|
20
|
+
* non-empty, every formatted log line is appended to the path in addition to
|
|
21
|
+
* its LSP `window/logMessage` / console destination (see {@link teeLogLine}).
|
|
22
|
+
* Diagnostic surface only — once the LSP connection binds, server logs route
|
|
23
|
+
* through `connection.console.*` and disappear from any pipe watching backend
|
|
24
|
+
* stdout; setting this path makes them visible to a headless test harness
|
|
25
|
+
* without scraping the client's Output view.
|
|
26
|
+
*
|
|
27
|
+
* The sink writes synchronously, so log lines preserve emission order; errors
|
|
28
|
+
* are swallowed because a failing log sink must not propagate.
|
|
29
|
+
* Append-only — the path is the consumer's responsibility to truncate / rotate.
|
|
30
|
+
*
|
|
31
|
+
* Raw configured target — may contain `{placeholder}` tokens (e.g.
|
|
32
|
+
* `{workspace}`) that are not known at module-load time.
|
|
33
|
+
*/
|
|
34
|
+
let logFileTemplate;
|
|
35
|
+
/** Fully-resolved target (no remaining placeholders). `undefined` while pending. */
|
|
36
|
+
let resolvedLogFilePath;
|
|
37
|
+
/** Placeholder values supplied so far via {@link resolveLogFilePlaceholder}. */
|
|
38
|
+
const logFilePlaceholders = new Map();
|
|
39
|
+
/**
|
|
40
|
+
* Lines emitted while the target is still pending (placeholders unresolved).
|
|
41
|
+
* Flushed verbatim — preserving emission order — once the target resolves, so
|
|
42
|
+
* no startup line is ever dropped. Each entry already carries its trailing `\n`.
|
|
43
|
+
*/
|
|
44
|
+
const pendingLogLines = [];
|
|
45
|
+
/** Matches any remaining `{name}` placeholder token. */
|
|
46
|
+
const PLACEHOLDER_PATTERN = /\{[^}]+\}/;
|
|
47
|
+
/**
|
|
48
|
+
* Recompute {@link resolvedLogFilePath} from the template + known placeholders.
|
|
49
|
+
* Resolves (and flushes the pending buffer) only once no `{...}` token remains.
|
|
50
|
+
*/
|
|
51
|
+
function tryResolveLogFilePath() {
|
|
52
|
+
if (!logFileTemplate) {
|
|
53
|
+
resolvedLogFilePath = undefined;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
let path = logFileTemplate;
|
|
57
|
+
for (const [name, value] of logFilePlaceholders) {
|
|
58
|
+
path = path.split(`{${name}}`).join(value);
|
|
59
|
+
}
|
|
60
|
+
if (PLACEHOLDER_PATTERN.test(path)) {
|
|
61
|
+
resolvedLogFilePath = undefined;
|
|
62
|
+
// Target is pending — guarantee the buffer is flushed even if the process
|
|
63
|
+
// exits before the remaining placeholders are ever supplied.
|
|
64
|
+
ensureFallbackHandler();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
resolvedLogFilePath = path;
|
|
68
|
+
ensureLogDir(path);
|
|
69
|
+
flushPendingLogLines();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Best-effort create of the target's parent directory. Covers the headless-test
|
|
73
|
+
* case where the runner wipes the output directory before the server writes its
|
|
74
|
+
* log under it. Failures are swallowed — a log sink must never propagate.
|
|
75
|
+
*/
|
|
76
|
+
function ensureLogDir(filePath) {
|
|
77
|
+
// No-op when no sink is installed (browser); the Node sink swallows its own errors.
|
|
78
|
+
fileSink?.ensureDir(filePath);
|
|
79
|
+
}
|
|
80
|
+
/** Append the buffered lines to the resolved target, then clear the buffer. */
|
|
81
|
+
function flushPendingLogLines() {
|
|
82
|
+
if (!resolvedLogFilePath || pendingLogLines.length === 0) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
fileSink?.append(resolvedLogFilePath, pendingLogLines.join(''));
|
|
86
|
+
pendingLogLines.length = 0;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Set the file-tee target programmatically. Pass `undefined` to disable. The
|
|
90
|
+
* path may contain `{placeholder}` tokens (e.g. `{workspace}`); lines buffer
|
|
91
|
+
* until every token is supplied via {@link resolveLogFilePlaceholder}.
|
|
92
|
+
* Called by the `LspLogger` constructor's
|
|
93
|
+
* one-time `HYDRANIUM_LOG_FILE` env baseline (and by tests).
|
|
94
|
+
*/
|
|
95
|
+
export function setLogFilePath(path) {
|
|
96
|
+
logFileTemplate = path && path.length > 0 ? path : undefined;
|
|
97
|
+
logFilePlaceholders.clear();
|
|
98
|
+
pendingLogLines.length = 0;
|
|
99
|
+
resolvedLogFilePath = undefined;
|
|
100
|
+
tryResolveLogFilePath();
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Supply a value for a `{name}` placeholder in the configured target. Once the
|
|
104
|
+
* last placeholder is supplied the target resolves and any lines buffered while
|
|
105
|
+
* it was pending are flushed in emission order.
|
|
106
|
+
*/
|
|
107
|
+
export function resolveLogFilePlaceholder(name, value) {
|
|
108
|
+
logFilePlaceholders.set(name, value);
|
|
109
|
+
tryResolveLogFilePath();
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Last-resort flush for the case where the target never resolves (e.g. the
|
|
113
|
+
* server crashed before the workspace was known). Substitutes any remaining
|
|
114
|
+
* `{...}` token with a process-unique `_startup-<pid>` segment and flushes the
|
|
115
|
+
* buffer, so startup / failure lines are never lost. No-op when the target is
|
|
116
|
+
* already resolved or there is nothing buffered. Registered on `process.exit`
|
|
117
|
+
* as soon as an unresolved target is configured.
|
|
118
|
+
*/
|
|
119
|
+
export function flushLogFileFallback() {
|
|
120
|
+
if (!logFileTemplate || resolvedLogFilePath || pendingLogLines.length === 0) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
resolvedLogFilePath = logFileTemplate.replace(/\{[^}]+\}/g, `_startup-${processPid() ?? 'unknown'}`);
|
|
124
|
+
ensureLogDir(resolvedLogFilePath);
|
|
125
|
+
flushPendingLogLines();
|
|
126
|
+
}
|
|
127
|
+
/** Registered at most once; flushes any pending buffer on process teardown. */
|
|
128
|
+
let fallbackHandlerRegistered = false;
|
|
129
|
+
function ensureFallbackHandler() {
|
|
130
|
+
if (fallbackHandlerRegistered) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
fallbackHandlerRegistered = true;
|
|
134
|
+
// Node-only teardown flush; a no-op in a browser worker (no `exit` event).
|
|
135
|
+
onProcessEvent('exit', () => flushLogFileFallback());
|
|
136
|
+
}
|
|
137
|
+
/** Current resolved file-tee target. `undefined` when disabled or still pending. */
|
|
138
|
+
export function getLogFilePath() {
|
|
139
|
+
return resolvedLogFilePath;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Fan a single already-formatted log line out to the file-tee target, if one is
|
|
143
|
+
* configured. Called by `LspLogger`'s emit in
|
|
144
|
+
* addition to the LSP/console sink — log sinks fan out, they don't replace.
|
|
145
|
+
* While the target is still pending (unresolved `{placeholder}`), the line is
|
|
146
|
+
* buffered instead of dropped.
|
|
147
|
+
*/
|
|
148
|
+
export function teeLogLine(formatted) {
|
|
149
|
+
if (!logFileTemplate) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const line = `${formatted}\n`;
|
|
153
|
+
if (resolvedLogFilePath) {
|
|
154
|
+
// The sink swallows its own errors; recursing into the logger here would
|
|
155
|
+
// re-enter emit and loop. The LSP/console sink already delivered the line.
|
|
156
|
+
fileSink?.append(resolvedLogFilePath, line);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
pendingLogLines.push(line);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// Re-exported so the token derivation is reachable from the diagnostics barrel.
|
|
163
|
+
// It is defined in a standalone, dependency-light module so a Playwright test
|
|
164
|
+
// helper can import it directly without pulling the barrel's module graph.
|
|
165
|
+
export { toLogFileWorkspaceToken } from './log-file-token.js';
|
|
166
|
+
/**
|
|
167
|
+
* Format current memory as "heap used/total, rss N". Returns `''` where
|
|
168
|
+
* `process.memoryUsage` is unavailable (browser) so callers can append it
|
|
169
|
+
* unconditionally.
|
|
170
|
+
*/
|
|
171
|
+
export function formatMemory() {
|
|
172
|
+
const mem = currentMemoryUsage();
|
|
173
|
+
if (!mem) {
|
|
174
|
+
return '';
|
|
175
|
+
}
|
|
176
|
+
return `heap ${Format.bytes(mem.heapUsed)}/${Format.bytes(mem.heapTotal)}, rss ${Format.bytes(mem.rss)}`;
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/langium/diagnostics/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE3F,yGAAyG;AACzG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAoBlD,IAAI,QAAiC,CAAC;AAEtC,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAAC,IAA6B;IACzD,QAAQ,GAAG,IAAI,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,IAAI,eAAmC,CAAC;AACxC,oFAAoF;AACpF,IAAI,mBAAuC,CAAC;AAC5C,gFAAgF;AAChF,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;AACtD;;;;GAIG;AACH,MAAM,eAAe,GAAa,EAAE,CAAC;AAErC,wDAAwD;AACxD,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAExC;;;GAGG;AACH,SAAS,qBAAqB;IAC3B,IAAI,CAAC,eAAe,EAAE,CAAC;QACpB,mBAAmB,GAAG,SAAS,CAAC;QAChC,OAAO;IACV,CAAC;IACD,IAAI,IAAI,GAAG,eAAe,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,mBAAmB,EAAE,CAAC;QAC/C,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IACD,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,mBAAmB,GAAG,SAAS,CAAC;QAChC,0EAA0E;QAC1E,6DAA6D;QAC7D,qBAAqB,EAAE,CAAC;QACxB,OAAO;IACV,CAAC;IACD,mBAAmB,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,IAAI,CAAC,CAAC;IACnB,oBAAoB,EAAE,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,SAAS,YAAY,CAAC,QAAgB;IACnC,oFAAoF;IACpF,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED,+EAA+E;AAC/E,SAAS,oBAAoB;IAC1B,IAAI,CAAC,mBAAmB,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxD,OAAO;IACV,CAAC;IACD,QAAQ,EAAE,MAAM,CAAC,mBAAmB,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,IAAwB;IACpD,eAAe,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7D,mBAAmB,CAAC,KAAK,EAAE,CAAC;IAC5B,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3B,mBAAmB,GAAG,SAAS,CAAC;IAChC,qBAAqB,EAAE,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAY,EAAE,KAAa;IAClE,mBAAmB,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrC,qBAAqB,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB;IACjC,IAAI,CAAC,eAAe,IAAI,mBAAmB,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3E,OAAO;IACV,CAAC;IACD,mBAAmB,GAAG,eAAe,CAAC,OAAO,CAAC,YAAY,EAAE,YAAY,UAAU,EAAE,IAAI,SAAS,EAAE,CAAC,CAAC;IACrG,YAAY,CAAC,mBAAmB,CAAC,CAAC;IAClC,oBAAoB,EAAE,CAAC;AAC1B,CAAC;AAED,+EAA+E;AAC/E,IAAI,yBAAyB,GAAG,KAAK,CAAC;AACtC,SAAS,qBAAqB;IAC3B,IAAI,yBAAyB,EAAE,CAAC;QAC7B,OAAO;IACV,CAAC;IACD,yBAAyB,GAAG,IAAI,CAAC;IACjC,2EAA2E;IAC3E,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,cAAc;IAC3B,OAAO,mBAAmB,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB;IACzC,IAAI,CAAC,eAAe,EAAE,CAAC;QACpB,OAAO;IACV,CAAC;IACD,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,CAAC;IAC9B,IAAI,mBAAmB,EAAE,CAAC;QACvB,yEAAyE;QACzE,2EAA2E;QAC3E,QAAQ,EAAE,MAAM,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;SAAM,CAAC;QACL,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,8EAA8E;AAC9E,2EAA2E;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAqC9D;;;;GAIG;AACH,MAAM,UAAU,YAAY;IACzB,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;IACjC,IAAI,CAAC,GAAG,EAAE,CAAC;QACR,OAAO,EAAE,CAAC;IACb,CAAC;IACD,OAAO,QAAQ,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;AAC5G,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { AbstractLogger, type Clock, Logger, type LogLevel, type LogThreshold, type MaybeObservableValue } from '@hydranium/protocol';
|
|
10
|
+
import { type URI } from '@hydranium/langium';
|
|
11
|
+
import { type ServerSharedServices } from '../module.js';
|
|
12
|
+
/**
|
|
13
|
+
* Options accepted by {@link LspLogger}. Carries the logger's own
|
|
14
|
+
* identity {@link component} (the field on {@link AbstractLogger}
|
|
15
|
+
* prefixed to every log line the logger emits). This is intentionally
|
|
16
|
+
* a separate field from `logName` on
|
|
17
|
+
* `LogNameOptions` — the latter labels a
|
|
18
|
+
* service that DERIVES a logger; this labels the logger itself.
|
|
19
|
+
*/
|
|
20
|
+
export interface LspLoggerOptions {
|
|
21
|
+
/** Component label prefixed to log output. Read by `AbstractLogger.emit`. */
|
|
22
|
+
readonly component?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Process-global log threshold, applied at construction of the ROOT logger
|
|
25
|
+
* (the instance bound in DI). When set, the constructor calls
|
|
26
|
+
* `Logger.setLevel` with the current value (only when truthy, so an unset
|
|
27
|
+
* setting leaves the env-fallback / `'info'` default in place) and
|
|
28
|
+
* re-applies on every `onChange`. Bind to a user setting via
|
|
29
|
+
* `Settings.value`.
|
|
30
|
+
*
|
|
31
|
+
* The threshold is GLOBAL, not per-instance: `derive` / `for` create child
|
|
32
|
+
* loggers passing only `component`, so children never carry or re-apply
|
|
33
|
+
* `logThreshold` — the root owns it. Pass a constant for tests / non-LSP
|
|
34
|
+
* runs. (Named `logThreshold`, not `logLevel`, to avoid colliding with
|
|
35
|
+
* GLSP's per-instance numeric `Logger.logLevel`; it is an
|
|
36
|
+
* `MaybeObservableValue<LogThreshold>`, matching the framework's filter-side type.)
|
|
37
|
+
*/
|
|
38
|
+
readonly logThreshold?: MaybeObservableValue<LogThreshold | undefined>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* LSP-bound implementation of {@link Logger}. Forwards messages to the
|
|
42
|
+
* language client via the connection bound in {@link ServerSharedServices}.
|
|
43
|
+
* Emission only — memory readout and timing live on the server's
|
|
44
|
+
* `ServerTracer`, which composes this
|
|
45
|
+
* logger. Adds URI-aware labelling on top of {@link AbstractLogger}.
|
|
46
|
+
*
|
|
47
|
+
* `withUri` renders workspace-relative paths by default (via the framework
|
|
48
|
+
* `WorkspaceManager.wsRelativePath`); consumers subclass only for a different
|
|
49
|
+
* display convention or extra language-specific helpers.
|
|
50
|
+
*/
|
|
51
|
+
export declare class LspLogger extends AbstractLogger implements Logger {
|
|
52
|
+
protected readonly services: ServerSharedServices;
|
|
53
|
+
constructor(services: ServerSharedServices, options?: LspLoggerOptions);
|
|
54
|
+
/**
|
|
55
|
+
* Route logger timing and timestamps through the injected framework
|
|
56
|
+
* {@link Clock} (the dedicated `shared.Clock` slot) so server-side log time
|
|
57
|
+
* shares the one fake-clock axis tests drive with `makeFakeClock`, rather
|
|
58
|
+
* than reading the wall clock directly. The logger takes the full
|
|
59
|
+
* {@link ServerSharedServices}, which carries the slot, so the read is
|
|
60
|
+
* direct — no cast or fallback needed.
|
|
61
|
+
*/
|
|
62
|
+
protected clock(): Clock;
|
|
63
|
+
/**
|
|
64
|
+
* URI labelling rendered as a workspace-relative path via the framework
|
|
65
|
+
* `HydraniumWorkspaceManager.wsRelativePath` (falls back to the URI
|
|
66
|
+
* string when no workspace folder is known). Widens the
|
|
67
|
+
* {@link Logger.withUri} parameter to accept a `URI` object directly —
|
|
68
|
+
* server-side callers typically hold URIs, not strings. Subclasses with a
|
|
69
|
+
* different display convention override their `WorkspaceManager.wsRelativePath`
|
|
70
|
+
* (preferred) or this method.
|
|
71
|
+
*/
|
|
72
|
+
withUri(uri: URI | string): this;
|
|
73
|
+
protected emit(level: LogLevel, label: string, message: string, args: readonly unknown[]): void;
|
|
74
|
+
protected derive(component: string): this;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=lsp-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-logger.d.ts","sourceRoot":"","sources":["../../../src/langium/diagnostics/lsp-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,cAAc,EACd,KAAK,KAAK,EAGV,MAAM,EACN,KAAK,QAAQ,EACb,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EAE3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAYzD;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;CACzE;AAED;;;;;;;;;;GAUG;AACH,qBAAa,SAAU,SAAQ,cAAe,YAAW,MAAM;IAEzD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB;gBAA9B,QAAQ,EAAE,oBAAoB,EACjD,OAAO,GAAE,gBAAqB;IA2CjC;;;;;;;OAOG;cACgB,KAAK,IAAI,KAAK;IAIjC;;;;;;;;OAQG;IACM,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI;IAIzC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI;IAuC/F,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAM3C"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023-2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { AbstractLogger, DEFAULT_LOG_FILE_ENV, DEFAULT_LOG_LEVEL_ENV, Logger, ObservableValue, parseLogLevel } from '@hydranium/protocol';
|
|
10
|
+
import { setLogFilePath, teeLogLine } from './logger.js';
|
|
11
|
+
import { processEnv, writeStderr } from '../../util/environment.js';
|
|
12
|
+
/**
|
|
13
|
+
* Guards the one-time env-var log-level and log-file baselines (see the
|
|
14
|
+
* {@link LspLogger} constructor). Applied on the first logger construction and
|
|
15
|
+
* never again, so derived child loggers cannot re-read the env and clobber a
|
|
16
|
+
* live setting.
|
|
17
|
+
*/
|
|
18
|
+
let envBaselineApplied = false;
|
|
19
|
+
/**
|
|
20
|
+
* LSP-bound implementation of {@link Logger}. Forwards messages to the
|
|
21
|
+
* language client via the connection bound in {@link ServerSharedServices}.
|
|
22
|
+
* Emission only — memory readout and timing live on the server's
|
|
23
|
+
* `ServerTracer`, which composes this
|
|
24
|
+
* logger. Adds URI-aware labelling on top of {@link AbstractLogger}.
|
|
25
|
+
*
|
|
26
|
+
* `withUri` renders workspace-relative paths by default (via the framework
|
|
27
|
+
* `WorkspaceManager.wsRelativePath`); consumers subclass only for a different
|
|
28
|
+
* display convention or extra language-specific helpers.
|
|
29
|
+
*/
|
|
30
|
+
export class LspLogger extends AbstractLogger {
|
|
31
|
+
services;
|
|
32
|
+
constructor(services, options = {}) {
|
|
33
|
+
super(options.component);
|
|
34
|
+
this.services = services;
|
|
35
|
+
// Apply the framework env baselines (`HYDRANIUM_LOG_LEVEL` and
|
|
36
|
+
// `HYDRANIUM_LOG_FILE`) exactly once, on the first logger construction,
|
|
37
|
+
// before any setting is read. Unconditional and process-global, so it
|
|
38
|
+
// needs no root detection and is never re-applied by derived children —
|
|
39
|
+
// which would otherwise clobber a live setting. These are the single env
|
|
40
|
+
// vars for level / file-tee (an adopter brands them by renaming the
|
|
41
|
+
// framework env, not by introducing its own).
|
|
42
|
+
if (!envBaselineApplied) {
|
|
43
|
+
envBaselineApplied = true;
|
|
44
|
+
// No `process.env` in a browser — the level/file-tee env baseline is
|
|
45
|
+
// a Node concern; skip it cleanly there.
|
|
46
|
+
const env = processEnv();
|
|
47
|
+
if (env) {
|
|
48
|
+
const envLevel = parseLogLevel(env[DEFAULT_LOG_LEVEL_ENV]);
|
|
49
|
+
if (envLevel) {
|
|
50
|
+
Logger.setLevel(envLevel);
|
|
51
|
+
}
|
|
52
|
+
const envLogFile = env[DEFAULT_LOG_FILE_ENV];
|
|
53
|
+
if (envLogFile) {
|
|
54
|
+
setLogFilePath(envLogFile);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Apply the configured threshold from the root logger only — `derive`
|
|
59
|
+
// passes just `component`, so children never carry `logThreshold`. The
|
|
60
|
+
// setting overrides the env baseline above and re-applies on every change;
|
|
61
|
+
// truthy-guarded so an unset setting leaves the baseline / `'info'` default.
|
|
62
|
+
if (options.logThreshold !== undefined) {
|
|
63
|
+
const level = ObservableValue.from(options.logThreshold);
|
|
64
|
+
if (level.value) {
|
|
65
|
+
Logger.setLevel(level.value);
|
|
66
|
+
}
|
|
67
|
+
level.onChange(next => {
|
|
68
|
+
if (next) {
|
|
69
|
+
Logger.setLevel(next);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Route logger timing and timestamps through the injected framework
|
|
76
|
+
* {@link Clock} (the dedicated `shared.Clock` slot) so server-side log time
|
|
77
|
+
* shares the one fake-clock axis tests drive with `makeFakeClock`, rather
|
|
78
|
+
* than reading the wall clock directly. The logger takes the full
|
|
79
|
+
* {@link ServerSharedServices}, which carries the slot, so the read is
|
|
80
|
+
* direct — no cast or fallback needed.
|
|
81
|
+
*/
|
|
82
|
+
clock() {
|
|
83
|
+
return this.services.Clock;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* URI labelling rendered as a workspace-relative path via the framework
|
|
87
|
+
* `HydraniumWorkspaceManager.wsRelativePath` (falls back to the URI
|
|
88
|
+
* string when no workspace folder is known). Widens the
|
|
89
|
+
* {@link Logger.withUri} parameter to accept a `URI` object directly —
|
|
90
|
+
* server-side callers typically hold URIs, not strings. Subclasses with a
|
|
91
|
+
* different display convention override their `WorkspaceManager.wsRelativePath`
|
|
92
|
+
* (preferred) or this method.
|
|
93
|
+
*/
|
|
94
|
+
withUri(uri) {
|
|
95
|
+
return this.with(this.services.workspace.WorkspaceManager.wsRelativePath(uri));
|
|
96
|
+
}
|
|
97
|
+
emit(level, label, message, args) {
|
|
98
|
+
const component = this.component ? ` [${this.component}]` : '';
|
|
99
|
+
// Pad to the widest label (5 chars — 'Error'/'Debug'/'Trace') so timestamps line up.
|
|
100
|
+
const prefix = `[${label.padEnd(5)} - ${this.timestamp()}]${component}`;
|
|
101
|
+
const combined = args.length === 0 ? message : `${message} ${args.map(formatLogArg).join(' ')}`;
|
|
102
|
+
const formatted = `${prefix} ${combined}`;
|
|
103
|
+
const connection = this.services.lsp.Connection;
|
|
104
|
+
// Route through the LSP `window/logMessage` channel so log lines stay
|
|
105
|
+
// framed as JSON-RPC messages even in `--stdio` mode (where stdout is
|
|
106
|
+
// the LSP transport — any raw `console.*` write before
|
|
107
|
+
// vscode-languageserver's `attachConsole` patches the globals would
|
|
108
|
+
// corrupt the protocol stream). Pre-stringify all args into one
|
|
109
|
+
// message because `RemoteConsole.*` takes a single string.
|
|
110
|
+
//
|
|
111
|
+
// Falls through to the raw sink below when the connection cannot take the
|
|
112
|
+
// line, which is NOT a theoretical case: `RemoteConsole.send` throws
|
|
113
|
+
// `Connection is disposed` once the client has gone, and the log lines
|
|
114
|
+
// most likely to arrive at that moment are the ones that matter most —
|
|
115
|
+
// shutdown diagnostics and the workspace manager's own
|
|
116
|
+
// unhandled-rejection handler. A log sink that throws turns a diagnostic
|
|
117
|
+
// into a crash, so a dead channel degrades to stderr instead.
|
|
118
|
+
if (!connection || !sendViaConnection(connection, level, formatted)) {
|
|
119
|
+
if (!writeStderr(`${formatted}\n`)) {
|
|
120
|
+
// Browser only. In Node every level goes to STDERR, including the
|
|
121
|
+
// three that `console.*` would put on stdout (`info` / `debug` /
|
|
122
|
+
// `log`) — stdout is the JSON-RPC channel for any head launched over
|
|
123
|
+
// stdio, so a log line written there corrupts the protocol stream
|
|
124
|
+
// rather than merely appearing in the wrong place. A browser has no
|
|
125
|
+
// such channel, so it keeps the per-level console methods, which
|
|
126
|
+
// render structured args far better than a pre-joined string.
|
|
127
|
+
const consumer = CONSOLE[level];
|
|
128
|
+
consumer(prefix, message, ...args);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// File-tee fan-out for headless capture (see `setLogFilePath`). Always runs
|
|
132
|
+
// in addition to the LSP/console sink — log sinks fan out, they don't replace.
|
|
133
|
+
teeLogLine(formatted);
|
|
134
|
+
}
|
|
135
|
+
derive(component) {
|
|
136
|
+
const Subclass = this.constructor;
|
|
137
|
+
return new Subclass(this.services, { component });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Deliver one formatted line over the LSP `window/logMessage` channel,
|
|
142
|
+
* reporting whether the channel took it.
|
|
143
|
+
*
|
|
144
|
+
* Returns `false` — rather than throwing — when the connection is closed or
|
|
145
|
+
* disposed. `RemoteConsole.send` throws `Connection is disposed` in that state,
|
|
146
|
+
* and a logger that propagates it converts a diagnostic into an uncaught
|
|
147
|
+
* exception at exactly the moment things are already going wrong: the framework's
|
|
148
|
+
* own `handleProcessUnhandledRejection` logs through this path, so a late
|
|
149
|
+
* rejection after client teardown would crash the server while *reporting* an
|
|
150
|
+
* error. The caller falls back to the raw sink, so the line is still delivered.
|
|
151
|
+
*/
|
|
152
|
+
function sendViaConnection(connection, level, formatted) {
|
|
153
|
+
try {
|
|
154
|
+
LSP_CONSOLE[level](connection)(formatted);
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Per-level console adapter, used **only where there is no `process.stderr`**
|
|
163
|
+
* (a browser). In Node the fallback writes to stderr for every level instead —
|
|
164
|
+
* see the `emit` branch. Kept per-level rather than collapsed onto
|
|
165
|
+
* `console.error` because devtools render `info` / `debug` distinctly and
|
|
166
|
+
* colouring every framework log line as an error would be actively misleading.
|
|
167
|
+
*/
|
|
168
|
+
const CONSOLE = {
|
|
169
|
+
error: console.error,
|
|
170
|
+
warn: console.warn,
|
|
171
|
+
info: console.info,
|
|
172
|
+
debug: console.debug,
|
|
173
|
+
trace: console.log
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Per-level adapter that resolves the right `RemoteConsole` method on a
|
|
177
|
+
* Langium {@link Connection}. `RemoteConsole` exposes
|
|
178
|
+
* `error / warn / info / log / debug` — `debug` arriving with LSP 3.18's
|
|
179
|
+
* `MessageType.Debug` severity, so a debug line is now tagged as such in
|
|
180
|
+
* the client's log instead of being indistinguishable from `log`. There is
|
|
181
|
+
* still no `trace`, so that one level folds into `log` (severity `Log` in
|
|
182
|
+
* the `window/logMessage` type table). A client predating 3.18 has no
|
|
183
|
+
* `Debug` case and appends the message unlabelled, so the mapping degrades
|
|
184
|
+
* rather than dropping output. The returned function takes a single
|
|
185
|
+
* pre-formatted string since `RemoteConsole.*` accepts only one argument.
|
|
186
|
+
*/
|
|
187
|
+
const LSP_CONSOLE = {
|
|
188
|
+
error: c => c.console.error.bind(c.console),
|
|
189
|
+
warn: c => c.console.warn.bind(c.console),
|
|
190
|
+
info: c => c.console.info.bind(c.console),
|
|
191
|
+
debug: c => c.console.debug.bind(c.console),
|
|
192
|
+
trace: c => c.console.log.bind(c.console)
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Render a logger-argument value into the single combined string the LSP
|
|
196
|
+
* `window/logMessage` channel takes. Mirrors how raw `console.*` would
|
|
197
|
+
* format multiple args, but with explicit handling for Errors (stack) and
|
|
198
|
+
* objects (JSON).
|
|
199
|
+
*/
|
|
200
|
+
function formatLogArg(value) {
|
|
201
|
+
if (value === undefined) {
|
|
202
|
+
return 'undefined';
|
|
203
|
+
}
|
|
204
|
+
if (value === null) {
|
|
205
|
+
return 'null';
|
|
206
|
+
}
|
|
207
|
+
if (typeof value === 'string') {
|
|
208
|
+
return value;
|
|
209
|
+
}
|
|
210
|
+
if (value instanceof Error) {
|
|
211
|
+
return value.stack ?? value.message;
|
|
212
|
+
}
|
|
213
|
+
if (typeof value === 'object') {
|
|
214
|
+
try {
|
|
215
|
+
return JSON.stringify(value);
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
return String(value);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return String(value);
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=lsp-logger.js.map
|