@hydranium/core 1.0.0-next.31 → 1.0.0-next.313
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/README.md +78 -82
- package/lib/browser/host-heads-in-worker.d.ts +77 -0
- package/lib/browser/host-heads-in-worker.d.ts.map +1 -0
- package/lib/browser/host-heads-in-worker.js +169 -0
- package/lib/browser/host-heads-in-worker.js.map +1 -0
- package/lib/browser/index.d.ts +12 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +17 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/indexeddb-file-system-store.d.ts +82 -0
- package/lib/browser/indexeddb-file-system-store.d.ts.map +1 -0
- package/lib/browser/indexeddb-file-system-store.js +181 -0
- package/lib/browser/indexeddb-file-system-store.js.map +1 -0
- package/lib/browser/start-language-server-in-worker.d.ts +32 -0
- package/lib/browser/start-language-server-in-worker.d.ts.map +1 -0
- package/lib/browser/start-language-server-in-worker.js +40 -0
- package/lib/browser/start-language-server-in-worker.js.map +1 -0
- package/lib/documents/ast-document-manager.d.ts +256 -124
- package/lib/documents/ast-document-manager.d.ts.map +1 -1
- package/lib/documents/ast-document-manager.js +293 -132
- package/lib/documents/ast-document-manager.js.map +1 -1
- package/lib/documents/client-ids.d.ts +5 -19
- package/lib/documents/client-ids.d.ts.map +1 -1
- package/lib/documents/client-ids.js +5 -19
- package/lib/documents/client-ids.js.map +1 -1
- package/lib/documents/client-session-errors.d.ts +15 -0
- package/lib/documents/client-session-errors.d.ts.map +1 -0
- package/lib/documents/client-session-errors.js +15 -0
- package/lib/documents/client-session-errors.js.map +1 -0
- package/lib/documents/client-session-registry.d.ts +146 -0
- package/lib/documents/client-session-registry.d.ts.map +1 -0
- package/lib/documents/client-session-registry.js +207 -0
- package/lib/documents/client-session-registry.js.map +1 -0
- package/lib/documents/dirty-state-tracker.d.ts +101 -0
- package/lib/documents/dirty-state-tracker.d.ts.map +1 -0
- package/lib/documents/dirty-state-tracker.js +85 -0
- package/lib/documents/dirty-state-tracker.js.map +1 -0
- package/lib/documents/document-release-handler.d.ts +204 -0
- package/lib/documents/document-release-handler.d.ts.map +1 -0
- package/lib/documents/document-release-handler.js +317 -0
- package/lib/documents/document-release-handler.js.map +1 -0
- package/lib/documents/document-release-scheduler.d.ts +67 -0
- package/lib/documents/document-release-scheduler.d.ts.map +1 -0
- package/lib/documents/document-release-scheduler.js +80 -0
- package/lib/documents/document-release-scheduler.js.map +1 -0
- package/lib/documents/file-system-task-queue.d.ts +52 -0
- package/lib/documents/file-system-task-queue.d.ts.map +1 -0
- package/lib/documents/file-system-task-queue.js +37 -0
- package/lib/documents/file-system-task-queue.js.map +1 -0
- package/lib/documents/hydranium-text-documents.d.ts +436 -282
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
- package/lib/documents/hydranium-text-documents.js +897 -483
- package/lib/documents/hydranium-text-documents.js.map +1 -1
- package/lib/documents/index.d.ts +10 -2
- package/lib/documents/index.d.ts.map +1 -1
- package/lib/documents/index.js +10 -2
- package/lib/documents/index.js.map +1 -1
- package/lib/documents/language-client-shadow.d.ts +234 -0
- package/lib/documents/language-client-shadow.d.ts.map +1 -0
- package/lib/documents/language-client-shadow.js +306 -0
- package/lib/documents/language-client-shadow.js.map +1 -0
- package/lib/documents/model-ledger.d.ts +47 -0
- package/lib/documents/model-ledger.d.ts.map +1 -0
- package/lib/documents/model-ledger.js +30 -0
- package/lib/documents/model-ledger.js.map +1 -0
- package/lib/documents/text-ledger.d.ts +64 -0
- package/lib/documents/text-ledger.d.ts.map +1 -0
- package/lib/documents/text-ledger.js +63 -0
- package/lib/documents/text-ledger.js.map +1 -0
- package/lib/documents/version-sync-service.d.ts +138 -0
- package/lib/documents/version-sync-service.d.ts.map +1 -0
- package/lib/documents/version-sync-service.js +173 -0
- package/lib/documents/version-sync-service.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/lib/langium/ast-extension/ast-extension-service.d.ts +42 -31
- package/lib/langium/ast-extension/ast-extension-service.d.ts.map +1 -1
- package/lib/langium/ast-extension/ast-extension-service.js +45 -19
- package/lib/langium/ast-extension/ast-extension-service.js.map +1 -1
- package/lib/langium/bootstrap.d.ts +49 -36
- package/lib/langium/bootstrap.d.ts.map +1 -1
- package/lib/langium/bootstrap.js +91 -45
- package/lib/langium/bootstrap.js.map +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass-service.d.ts +9 -9
- package/lib/langium/build-phase-pass/build-phase-pass-service.d.ts.map +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass-service.js +25 -16
- package/lib/langium/build-phase-pass/build-phase-pass-service.js.map +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass.d.ts +20 -8
- package/lib/langium/build-phase-pass/build-phase-pass.d.ts.map +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass.js +20 -0
- package/lib/langium/build-phase-pass/build-phase-pass.js.map +1 -1
- package/lib/langium/composite-ast-reflection.d.ts +46 -0
- package/lib/langium/composite-ast-reflection.d.ts.map +1 -0
- package/lib/langium/composite-ast-reflection.js +97 -0
- package/lib/langium/composite-ast-reflection.js.map +1 -0
- package/lib/langium/config/configuration-provider.d.ts +81 -0
- package/lib/langium/config/configuration-provider.d.ts.map +1 -0
- package/lib/langium/config/configuration-provider.js +112 -0
- package/lib/langium/config/configuration-provider.js.map +1 -0
- package/lib/langium/config/index.d.ts +1 -0
- package/lib/langium/config/index.d.ts.map +1 -1
- package/lib/langium/config/index.js +1 -0
- package/lib/langium/config/index.js.map +1 -1
- package/lib/langium/config/settings.js.map +1 -1
- package/lib/langium/diagnostics/hydranium-langium-profiler.d.ts +9 -20
- package/lib/langium/diagnostics/hydranium-langium-profiler.d.ts.map +1 -1
- package/lib/langium/diagnostics/hydranium-langium-profiler.js +15 -24
- package/lib/langium/diagnostics/hydranium-langium-profiler.js.map +1 -1
- package/lib/langium/diagnostics/log-preamble.js +1 -1
- package/lib/langium/diagnostics/log-preamble.js.map +1 -1
- package/lib/langium/diagnostics/logger.d.ts +19 -4
- package/lib/langium/diagnostics/logger.d.ts.map +1 -1
- package/lib/langium/diagnostics/logger.js +36 -11
- package/lib/langium/diagnostics/logger.js.map +1 -1
- package/lib/langium/diagnostics/lsp-logger.d.ts +17 -0
- package/lib/langium/diagnostics/lsp-logger.d.ts.map +1 -1
- package/lib/langium/diagnostics/lsp-logger.js +58 -17
- package/lib/langium/diagnostics/lsp-logger.js.map +1 -1
- package/lib/langium/diagnostics/server-tracer.d.ts.map +1 -1
- package/lib/langium/diagnostics/server-tracer.js.map +1 -1
- package/lib/langium/document-builder/build-pipeline-integration.d.ts +21 -1
- package/lib/langium/document-builder/build-pipeline-integration.d.ts.map +1 -1
- package/lib/langium/document-builder/build-pipeline-integration.js +28 -30
- package/lib/langium/document-builder/build-pipeline-integration.js.map +1 -1
- package/lib/langium/document-builder/build-session.d.ts +6 -5
- package/lib/langium/document-builder/build-session.d.ts.map +1 -1
- package/lib/langium/document-builder/build-session.js +5 -5
- package/lib/langium/document-builder/build-session.js.map +1 -1
- package/lib/langium/document-builder/document-builder.d.ts +309 -35
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
- package/lib/langium/document-builder/document-builder.js +511 -75
- package/lib/langium/document-builder/document-builder.js.map +1 -1
- package/lib/langium/documentation/comment-provider.d.ts.map +1 -1
- package/lib/langium/documentation/comment-provider.js.map +1 -1
- package/lib/langium/integration-services.d.ts +40 -24
- package/lib/langium/integration-services.d.ts.map +1 -1
- package/lib/langium/integration-services.js +7 -4
- package/lib/langium/integration-services.js.map +1 -1
- package/lib/langium/integrity/integrity-rule.d.ts +16 -8
- package/lib/langium/integrity/integrity-rule.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-rule.js.map +1 -1
- package/lib/langium/integrity/integrity-service.d.ts +83 -27
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-service.js +273 -63
- package/lib/langium/integrity/integrity-service.js.map +1 -1
- package/lib/langium/keys/containment.d.ts +64 -0
- package/lib/langium/keys/containment.d.ts.map +1 -0
- package/lib/langium/keys/containment.js +53 -0
- package/lib/langium/keys/containment.js.map +1 -0
- package/lib/langium/keys/index.d.ts +1 -0
- package/lib/langium/keys/index.d.ts.map +1 -1
- package/lib/langium/keys/index.js +1 -0
- package/lib/langium/keys/index.js.map +1 -1
- package/lib/langium/keys/name-based-key-provider.d.ts +4 -0
- package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -1
- package/lib/langium/keys/name-based-key-provider.js +4 -0
- package/lib/langium/keys/name-based-key-provider.js.map +1 -1
- package/lib/langium/keys/positional-key-provider.d.ts.map +1 -1
- package/lib/langium/keys/positional-key-provider.js.map +1 -1
- package/lib/langium/labeling/label-provider.d.ts.map +1 -1
- package/lib/langium/labeling/label-provider.js.map +1 -1
- package/lib/langium/language-module.d.ts +30 -5
- package/lib/langium/language-module.d.ts.map +1 -1
- package/lib/langium/language-module.js +18 -4
- package/lib/langium/language-module.js.map +1 -1
- package/lib/langium/model-service/client-session.d.ts +383 -0
- package/lib/langium/model-service/client-session.d.ts.map +1 -0
- package/lib/langium/model-service/client-session.js +455 -0
- package/lib/langium/model-service/client-session.js.map +1 -0
- package/lib/langium/model-service/index.d.ts +2 -0
- package/lib/langium/model-service/index.d.ts.map +1 -1
- package/lib/langium/model-service/index.js +2 -0
- package/lib/langium/model-service/index.js.map +1 -1
- package/lib/langium/model-service/model-events.d.ts +66 -0
- package/lib/langium/model-service/model-events.d.ts.map +1 -0
- package/lib/langium/model-service/model-events.js +10 -0
- package/lib/langium/model-service/model-events.js.map +1 -0
- package/lib/langium/model-service/model-service.d.ts +480 -289
- package/lib/langium/model-service/model-service.d.ts.map +1 -1
- package/lib/langium/model-service/model-service.js +597 -456
- package/lib/langium/model-service/model-service.js.map +1 -1
- package/lib/langium/module.d.ts +158 -37
- package/lib/langium/module.d.ts.map +1 -1
- package/lib/langium/module.js +52 -36
- package/lib/langium/module.js.map +1 -1
- package/lib/langium/naming/name-provider.d.ts +42 -7
- package/lib/langium/naming/name-provider.d.ts.map +1 -1
- package/lib/langium/naming/name-provider.js +10 -4
- package/lib/langium/naming/name-provider.js.map +1 -1
- package/lib/langium/naming/name-separator-validation.d.ts +23 -1
- package/lib/langium/naming/name-separator-validation.d.ts.map +1 -1
- package/lib/langium/naming/name-separator-validation.js +22 -0
- package/lib/langium/naming/name-separator-validation.js.map +1 -1
- package/lib/langium/project/abstract-project-manager.d.ts.map +1 -1
- package/lib/langium/project/abstract-project-manager.js +13 -6
- package/lib/langium/project/abstract-project-manager.js.map +1 -1
- package/lib/langium/project/project-change-event.d.ts +2 -2
- package/lib/langium/project/single-project-manager.d.ts.map +1 -1
- package/lib/langium/project/single-project-manager.js.map +1 -1
- package/lib/langium/residency/cst-residency-service.d.ts +38 -14
- package/lib/langium/residency/cst-residency-service.d.ts.map +1 -1
- package/lib/langium/residency/cst-residency-service.js +24 -58
- package/lib/langium/residency/cst-residency-service.js.map +1 -1
- package/lib/langium/scope/ast-node-description-provider.d.ts.map +1 -1
- package/lib/langium/scope/ast-node-description-provider.js.map +1 -1
- package/lib/langium/scope/fallback-scope.d.ts +27 -0
- package/lib/langium/scope/fallback-scope.d.ts.map +1 -0
- package/lib/langium/scope/fallback-scope.js +35 -0
- package/lib/langium/scope/fallback-scope.js.map +1 -0
- package/lib/langium/scope/hydranium-scope-computation.d.ts +21 -18
- package/lib/langium/scope/hydranium-scope-computation.d.ts.map +1 -1
- package/lib/langium/scope/hydranium-scope-computation.js +38 -39
- package/lib/langium/scope/hydranium-scope-computation.js.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.d.ts +29 -11
- package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.js +37 -15
- package/lib/langium/scope/hydranium-scope-provider.js.map +1 -1
- package/lib/langium/scope/index.d.ts +1 -0
- package/lib/langium/scope/index.d.ts.map +1 -1
- package/lib/langium/scope/index.js +1 -0
- package/lib/langium/scope/index.js.map +1 -1
- package/lib/langium/scope/reference-builder.d.ts.map +1 -1
- package/lib/langium/scope/reference-builder.js.map +1 -1
- package/lib/langium/scope/reference-candidate-provider.d.ts +6 -5
- package/lib/langium/scope/reference-candidate-provider.d.ts.map +1 -1
- package/lib/langium/scope/reference-candidate-provider.js +3 -2
- package/lib/langium/scope/reference-candidate-provider.js.map +1 -1
- package/lib/langium/scope/scope-extension-service.d.ts +41 -37
- package/lib/langium/scope/scope-extension-service.d.ts.map +1 -1
- package/lib/langium/scope/scope-extension-service.js +57 -29
- package/lib/langium/scope/scope-extension-service.js.map +1 -1
- package/lib/langium/scope/scoped-ast-node-description.d.ts +1 -3
- package/lib/langium/scope/scoped-ast-node-description.d.ts.map +1 -1
- package/lib/langium/scope/scoped-ast-node-description.js +1 -3
- package/lib/langium/scope/scoped-ast-node-description.js.map +1 -1
- package/lib/langium/serialization/abstract-serializer.d.ts +38 -27
- package/lib/langium/serialization/abstract-serializer.d.ts.map +1 -1
- package/lib/langium/serialization/abstract-serializer.js +54 -30
- package/lib/langium/serialization/abstract-serializer.js.map +1 -1
- package/lib/langium/serialization/json-serializer.d.ts +8 -1
- package/lib/langium/serialization/json-serializer.d.ts.map +1 -1
- package/lib/langium/serialization/json-serializer.js +13 -3
- package/lib/langium/serialization/json-serializer.js.map +1 -1
- package/lib/langium/serialization/serializer.d.ts +1 -1
- package/lib/langium/serialization/yaml-serializer.d.ts +4 -0
- package/lib/langium/serialization/yaml-serializer.d.ts.map +1 -1
- package/lib/langium/serialization/yaml-serializer.js +4 -0
- package/lib/langium/serialization/yaml-serializer.js.map +1 -1
- package/lib/langium/service-registry.d.ts +29 -1
- package/lib/langium/service-registry.d.ts.map +1 -1
- package/lib/langium/service-registry.js +37 -0
- package/lib/langium/service-registry.js.map +1 -1
- package/lib/langium/shared-services.d.ts +23 -6
- package/lib/langium/shared-services.d.ts.map +1 -1
- package/lib/langium/shared-services.js.map +1 -1
- package/lib/langium/single-langium-copy.d.ts +22 -0
- package/lib/langium/single-langium-copy.d.ts.map +1 -0
- package/lib/langium/single-langium-copy.js +36 -0
- package/lib/langium/single-langium-copy.js.map +1 -0
- package/lib/langium/transfer/transfer-encoder.d.ts +84 -35
- package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -1
- package/lib/langium/transfer/transfer-encoder.js +34 -23
- package/lib/langium/transfer/transfer-encoder.js.map +1 -1
- package/lib/langium/trivia/comment-preserver.d.ts +423 -0
- package/lib/langium/trivia/comment-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/comment-preserver.js +906 -0
- package/lib/langium/trivia/comment-preserver.js.map +1 -0
- package/lib/langium/trivia/document-ending-preserver.d.ts +51 -0
- package/lib/langium/trivia/document-ending-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/document-ending-preserver.js +62 -0
- package/lib/langium/trivia/document-ending-preserver.js.map +1 -0
- package/lib/langium/trivia/index.d.ts +14 -0
- package/lib/langium/trivia/index.d.ts.map +1 -0
- package/lib/langium/trivia/index.js +14 -0
- package/lib/langium/trivia/index.js.map +1 -0
- package/lib/langium/trivia/trivia-contribution.d.ts +37 -0
- package/lib/langium/trivia/trivia-contribution.d.ts.map +1 -0
- package/lib/langium/trivia/trivia-contribution.js +10 -0
- package/lib/langium/trivia/trivia-contribution.js.map +1 -0
- package/lib/langium/trivia/trivia-preserver.d.ts +52 -0
- package/lib/langium/trivia/trivia-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/trivia-preserver.js +10 -0
- package/lib/langium/trivia/trivia-preserver.js.map +1 -0
- package/lib/langium/trivia/trivia-service.d.ts +70 -0
- package/lib/langium/trivia/trivia-service.d.ts.map +1 -0
- package/lib/langium/trivia/trivia-service.js +56 -0
- package/lib/langium/trivia/trivia-service.js.map +1 -0
- package/lib/langium/update-rewrite/normalize-empty-strings.d.ts.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite-service.d.ts +1 -1
- package/lib/langium/update-rewrite/update-rewrite-service.d.ts.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite-service.js.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite.d.ts +1 -1
- package/lib/langium/validation/document-validator.d.ts +280 -9
- package/lib/langium/validation/document-validator.d.ts.map +1 -1
- package/lib/langium/validation/document-validator.js +453 -8
- package/lib/langium/validation/document-validator.js.map +1 -1
- package/lib/langium/validation/validation-contribution-collector.d.ts +9 -1
- package/lib/langium/validation/validation-contribution-collector.d.ts.map +1 -1
- package/lib/langium/validation/validation-contribution-collector.js +1 -1
- package/lib/langium/validation/validation-contribution-collector.js.map +1 -1
- package/lib/langium/workspace/document-uri-policy.d.ts +24 -15
- package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -1
- package/lib/langium/workspace/document-uri-policy.js +22 -13
- package/lib/langium/workspace/document-uri-policy.js.map +1 -1
- package/lib/langium/workspace/file-not-found.d.ts +23 -0
- package/lib/langium/workspace/file-not-found.d.ts.map +1 -0
- package/lib/langium/workspace/file-not-found.js +31 -0
- package/lib/langium/workspace/file-not-found.js.map +1 -0
- package/lib/langium/workspace/file-system-provider.d.ts +167 -8
- package/lib/langium/workspace/file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/file-system-provider.js +115 -13
- package/lib/langium/workspace/file-system-provider.js.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts +31 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.js +54 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts +43 -1
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-lock.js +58 -1
- package/lib/langium/workspace/hydranium-workspace-lock.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts +124 -22
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.js +212 -31
- package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts +26 -9
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.js +45 -22
- package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
- package/lib/langium/workspace/index-manager.d.ts.map +1 -1
- package/lib/langium/workspace/index-manager.js.map +1 -1
- package/lib/langium/workspace/index.d.ts +1 -0
- package/lib/langium/workspace/index.d.ts.map +1 -1
- package/lib/langium/workspace/index.js +1 -0
- package/lib/langium/workspace/index.js.map +1 -1
- package/lib/langium/workspace/initialize-workspace.d.ts +61 -4
- package/lib/langium/workspace/initialize-workspace.d.ts.map +1 -1
- package/lib/langium/workspace/initialize-workspace.js +80 -7
- package/lib/langium/workspace/initialize-workspace.js.map +1 -1
- package/lib/langium/workspace/langium-documents.d.ts +7 -0
- package/lib/langium/workspace/langium-documents.d.ts.map +1 -1
- package/lib/langium/workspace/langium-documents.js +18 -1
- package/lib/langium/workspace/langium-documents.js.map +1 -1
- package/lib/langium/workspace/persistent-file-system-provider.d.ts +16 -10
- package/lib/langium/workspace/persistent-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/persistent-file-system-provider.js +25 -13
- package/lib/langium/workspace/persistent-file-system-provider.js.map +1 -1
- package/lib/langium/workspace/self-save-registry.d.ts +84 -0
- package/lib/langium/workspace/self-save-registry.d.ts.map +1 -0
- package/lib/{documents → langium/workspace}/self-save-registry.js +33 -22
- package/lib/langium/workspace/self-save-registry.js.map +1 -0
- package/lib/langium/workspace/virtual-document.d.ts +55 -21
- package/lib/langium/workspace/virtual-document.d.ts.map +1 -1
- package/lib/langium/workspace/virtual-document.js +87 -24
- package/lib/langium/workspace/virtual-document.js.map +1 -1
- package/lib/langium/workspace/write-lock-scope.d.ts +22 -10
- package/lib/langium/workspace/write-lock-scope.d.ts.map +1 -1
- package/lib/langium/workspace/write-lock-scope.js +15 -5
- package/lib/langium/workspace/write-lock-scope.js.map +1 -1
- package/lib/launcher/integrated-server.d.ts +3 -1
- package/lib/launcher/integrated-server.d.ts.map +1 -1
- package/lib/locale/index.d.ts +10 -0
- package/lib/locale/index.d.ts.map +1 -0
- package/lib/locale/index.js +10 -0
- package/lib/locale/index.js.map +1 -0
- package/lib/locale/server-locale.d.ts +73 -0
- package/lib/locale/server-locale.d.ts.map +1 -0
- package/lib/locale/server-locale.js +61 -0
- package/lib/locale/server-locale.js.map +1 -0
- package/lib/lsp/completion/hydranium-completion-provider.d.ts +44 -2
- package/lib/lsp/completion/hydranium-completion-provider.d.ts.map +1 -1
- package/lib/lsp/completion/hydranium-completion-provider.js +68 -0
- package/lib/lsp/completion/hydranium-completion-provider.js.map +1 -1
- package/lib/lsp/connection-features.d.ts +23 -0
- package/lib/lsp/connection-features.d.ts.map +1 -0
- package/lib/lsp/connection-features.js +60 -0
- package/lib/lsp/connection-features.js.map +1 -0
- package/lib/lsp/diagnostics-connection.d.ts +27 -0
- package/lib/lsp/diagnostics-connection.d.ts.map +1 -0
- package/lib/lsp/diagnostics-connection.js +53 -0
- package/lib/lsp/diagnostics-connection.js.map +1 -0
- package/lib/lsp/hydranium-document-update-handler.d.ts +126 -82
- package/lib/lsp/hydranium-document-update-handler.d.ts.map +1 -1
- package/lib/lsp/hydranium-document-update-handler.js +235 -102
- package/lib/lsp/hydranium-document-update-handler.js.map +1 -1
- package/lib/lsp/index.d.ts +4 -1
- package/lib/lsp/index.d.ts.map +1 -1
- package/lib/lsp/index.js +4 -1
- package/lib/lsp/index.js.map +1 -1
- package/lib/lsp/lsp-latency.d.ts +39 -0
- package/lib/lsp/lsp-latency.d.ts.map +1 -0
- package/lib/lsp/lsp-latency.js +58 -0
- package/lib/lsp/lsp-latency.js.map +1 -0
- package/lib/lsp/save-text-document.d.ts +31 -0
- package/lib/lsp/save-text-document.d.ts.map +1 -0
- package/lib/lsp/save-text-document.js +52 -0
- package/lib/lsp/save-text-document.js.map +1 -0
- package/lib/lsp/semantic-token-provider.d.ts +34 -1
- package/lib/lsp/semantic-token-provider.d.ts.map +1 -1
- package/lib/lsp/semantic-token-provider.js +55 -8
- package/lib/lsp/semantic-token-provider.js.map +1 -1
- package/lib/lsp/shared-module.d.ts +4 -8
- package/lib/lsp/shared-module.d.ts.map +1 -1
- package/lib/lsp/shared-module.js.map +1 -1
- package/lib/lsp/start-language-server.d.ts +8 -7
- package/lib/lsp/start-language-server.d.ts.map +1 -1
- package/lib/lsp/start-language-server.js +13 -7
- package/lib/lsp/start-language-server.js.map +1 -1
- package/lib/messages/carriers.d.ts +18 -12
- package/lib/messages/carriers.d.ts.map +1 -1
- package/lib/messages/carriers.js +22 -13
- package/lib/messages/carriers.js.map +1 -1
- package/lib/messages/index.d.ts +4 -1
- package/lib/messages/index.d.ts.map +1 -1
- package/lib/messages/index.js +4 -1
- package/lib/messages/index.js.map +1 -1
- package/lib/messages/renderer.d.ts +142 -0
- package/lib/messages/renderer.d.ts.map +1 -0
- package/lib/messages/renderer.js +165 -0
- package/lib/messages/renderer.js.map +1 -0
- package/lib/node/event-loop-monitor.d.ts.map +1 -1
- package/lib/node/event-loop-monitor.js +2 -1
- package/lib/node/event-loop-monitor.js.map +1 -1
- package/lib/node/heap-ceiling.d.ts +61 -0
- package/lib/node/heap-ceiling.d.ts.map +1 -0
- package/lib/node/heap-ceiling.js +72 -0
- package/lib/node/heap-ceiling.js.map +1 -0
- package/lib/node/index.d.ts +1 -1
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +5 -1
- package/lib/node/index.js.map +1 -1
- package/lib/node/latency-from-env.d.ts +1 -1
- package/lib/node/latency-from-env.js +1 -1
- package/lib/node/lint-grammar.js.map +1 -1
- package/lib/node/log-preamble-node.d.ts +5 -3
- package/lib/node/log-preamble-node.d.ts.map +1 -1
- package/lib/node/log-preamble-node.js +13 -10
- package/lib/node/log-preamble-node.js.map +1 -1
- package/lib/node/measure-memory.d.ts.map +1 -1
- package/lib/node/measure-memory.js +5 -4
- package/lib/node/measure-memory.js.map +1 -1
- package/lib/node/memory-monitor.d.ts +2 -2
- package/lib/node/memory-monitor.d.ts.map +1 -1
- package/lib/node/memory-monitor.js +9 -10
- package/lib/node/memory-monitor.js.map +1 -1
- package/lib/node/node-file-system-provider.d.ts +67 -9
- package/lib/node/node-file-system-provider.d.ts.map +1 -1
- package/lib/node/node-file-system-provider.js +198 -53
- package/lib/node/node-file-system-provider.js.map +1 -1
- package/lib/node/profile-capture.d.ts +12 -4
- package/lib/node/profile-capture.d.ts.map +1 -1
- package/lib/node/profile-capture.js +8 -6
- package/lib/node/profile-capture.js.map +1 -1
- package/lib/node/profile-digest.js.map +1 -1
- package/lib/node/profiling-run.d.ts +13 -3
- package/lib/node/profiling-run.d.ts.map +1 -1
- package/lib/node/profiling-run.js +17 -8
- package/lib/node/profiling-run.js.map +1 -1
- package/lib/node/rename-over-open-readers.d.ts +61 -0
- package/lib/node/rename-over-open-readers.d.ts.map +1 -0
- package/lib/node/rename-over-open-readers.js +80 -0
- package/lib/node/rename-over-open-readers.js.map +1 -0
- package/lib/node/server-diagnostics.js +1 -1
- package/lib/node/server-diagnostics.js.map +1 -1
- package/lib/node/server-state-snapshot.js +4 -4
- package/lib/node/server-state-snapshot.js.map +1 -1
- package/lib/node/socket-launcher.d.ts +43 -7
- package/lib/node/socket-launcher.d.ts.map +1 -1
- package/lib/node/socket-launcher.js +42 -7
- package/lib/node/socket-launcher.js.map +1 -1
- package/lib/node/startup-cpu-profile.d.ts +29 -0
- package/lib/node/startup-cpu-profile.d.ts.map +1 -0
- package/lib/node/startup-cpu-profile.js +91 -0
- package/lib/node/startup-cpu-profile.js.map +1 -0
- package/lib/node/stdio-launcher.d.ts +13 -13
- package/lib/node/stdio-launcher.d.ts.map +1 -1
- package/lib/node/stdio-launcher.js +21 -11
- package/lib/node/stdio-launcher.js.map +1 -1
- package/lib/testing/document-uri-policy-conformance.js +1 -1
- package/lib/testing/document-uri-policy-conformance.js.map +1 -1
- package/lib/testing/fake-description.js.map +1 -1
- package/lib/testing/fake-document.d.ts +2 -1
- package/lib/testing/fake-document.d.ts.map +1 -1
- package/lib/testing/fake-document.js.map +1 -1
- package/lib/testing/index.d.ts +1 -1
- package/lib/testing/index.d.ts.map +1 -1
- package/lib/testing/index.js +2 -1
- package/lib/testing/index.js.map +1 -1
- package/lib/testing/langium-test-helpers.d.ts.map +1 -1
- package/lib/testing/langium-test-helpers.js +1 -0
- package/lib/testing/langium-test-helpers.js.map +1 -1
- package/lib/testing/make-noop-language-services.js.map +1 -1
- package/lib/testing/make-noop-shared-services.d.ts +14 -0
- package/lib/testing/make-noop-shared-services.d.ts.map +1 -1
- package/lib/testing/make-noop-shared-services.js +28 -2
- package/lib/testing/make-noop-shared-services.js.map +1 -1
- package/lib/testing/make-test-services.d.ts +72 -14
- package/lib/testing/make-test-services.d.ts.map +1 -1
- package/lib/testing/make-test-services.js +42 -10
- package/lib/testing/make-test-services.js.map +1 -1
- package/lib/testing/make-test-tracer.d.ts +12 -0
- package/lib/testing/make-test-tracer.d.ts.map +1 -1
- package/lib/testing/make-test-tracer.js +13 -0
- package/lib/testing/make-test-tracer.js.map +1 -1
- package/lib/testing/node/applied-edit-capture.d.ts +29 -0
- package/lib/testing/node/applied-edit-capture.d.ts.map +1 -0
- package/lib/testing/node/applied-edit-capture.js +117 -0
- package/lib/testing/node/applied-edit-capture.js.map +1 -0
- package/lib/testing/node/golden-corpus.js.map +1 -1
- package/lib/testing/node/index.d.ts +1 -0
- package/lib/testing/node/index.d.ts.map +1 -1
- package/lib/testing/node/index.js +1 -0
- package/lib/testing/node/index.js.map +1 -1
- package/lib/testing/node/lsp-harness.d.ts.map +1 -1
- package/lib/testing/node/lsp-harness.js +2 -0
- package/lib/testing/node/lsp-harness.js.map +1 -1
- package/lib/testing/node/lsp-server-connection.d.ts +21 -6
- package/lib/testing/node/lsp-server-connection.d.ts.map +1 -1
- package/lib/testing/node/lsp-server-connection.js +49 -106
- package/lib/testing/node/lsp-server-connection.js.map +1 -1
- package/lib/testing/node/scratch-workspace.d.ts.map +1 -1
- package/lib/testing/node/scratch-workspace.js +10 -5
- package/lib/testing/node/scratch-workspace.js.map +1 -1
- package/lib/testing/node/spawned-server.d.ts +30 -1
- package/lib/testing/node/spawned-server.d.ts.map +1 -1
- package/lib/testing/node/spawned-server.js +39 -2
- package/lib/testing/node/spawned-server.js.map +1 -1
- package/lib/testing/node/unhandled-rejections.d.ts +20 -0
- package/lib/testing/node/unhandled-rejections.d.ts.map +1 -0
- package/lib/testing/node/unhandled-rejections.js +32 -0
- package/lib/testing/node/unhandled-rejections.js.map +1 -0
- package/lib/testing/playwright/browser-capture-bridge.js.map +1 -1
- package/lib/testing/playwright/e2e-profiling.js.map +1 -1
- package/lib/testing/playwright/flaky-network-proxy.d.ts +76 -0
- package/lib/testing/playwright/flaky-network-proxy.d.ts.map +1 -0
- package/lib/testing/playwright/flaky-network-proxy.js +164 -0
- package/lib/testing/playwright/flaky-network-proxy.js.map +1 -0
- package/lib/testing/playwright/index.d.ts +1 -0
- package/lib/testing/playwright/index.d.ts.map +1 -1
- package/lib/testing/playwright/index.js +1 -0
- package/lib/testing/playwright/index.js.map +1 -1
- package/lib/testing/playwright/server-log-capture.d.ts +46 -16
- package/lib/testing/playwright/server-log-capture.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-capture.js +111 -40
- package/lib/testing/playwright/server-log-capture.js.map +1 -1
- package/lib/testing/playwright/server-log-fixture.d.ts +16 -0
- package/lib/testing/playwright/server-log-fixture.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-fixture.js +25 -6
- package/lib/testing/playwright/server-log-fixture.js.map +1 -1
- package/lib/testing/playwright/server-log-region.d.ts +15 -0
- package/lib/testing/playwright/server-log-region.d.ts.map +1 -0
- package/lib/testing/playwright/server-log-region.js +30 -0
- package/lib/testing/playwright/server-log-region.js.map +1 -0
- package/lib/testing/playwright/server-log-rename-reporter.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-rename-reporter.js +4 -3
- package/lib/testing/playwright/server-log-rename-reporter.js.map +1 -1
- package/lib/testing/run-update-pipeline.d.ts +8 -5
- package/lib/testing/run-update-pipeline.d.ts.map +1 -1
- package/lib/testing/run-update-pipeline.js.map +1 -1
- package/lib/testing/stub-ast-document-manager.d.ts +11 -52
- package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
- package/lib/testing/stub-ast-document-manager.js +31 -62
- package/lib/testing/stub-ast-document-manager.js.map +1 -1
- package/lib/testing/stub-document-builder.d.ts +33 -11
- package/lib/testing/stub-document-builder.d.ts.map +1 -1
- package/lib/testing/stub-document-builder.js +103 -5
- package/lib/testing/stub-document-builder.js.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.d.ts +33 -10
- package/lib/testing/stub-hydranium-text-documents.d.ts.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.js +132 -16
- package/lib/testing/stub-hydranium-text-documents.js.map +1 -1
- package/lib/testing/stub-index-manager.js.map +1 -1
- package/lib/testing/stub-langium-documents.d.ts +3 -2
- package/lib/testing/stub-langium-documents.d.ts.map +1 -1
- package/lib/testing/stub-langium-documents.js.map +1 -1
- package/lib/testing/stub-model-service.d.ts +9 -8
- package/lib/testing/stub-model-service.d.ts.map +1 -1
- package/lib/testing/stub-model-service.js +6 -6
- package/lib/testing/stub-model-service.js.map +1 -1
- package/lib/testing/stub-project-manager.js.map +1 -1
- package/lib/testing/stub-self-save-registry.d.ts +1 -1
- package/lib/testing/stub-self-save-registry.d.ts.map +1 -1
- package/lib/testing/stub-service-registry.d.ts +1 -1
- package/lib/testing/stub-service-registry.js.map +1 -1
- package/lib/testing/stub-writable-file-system.d.ts +1 -1
- package/lib/testing/stub-writable-file-system.d.ts.map +1 -1
- package/lib/testing/stub-writable-file-system.js +2 -1
- package/lib/testing/stub-writable-file-system.js.map +1 -1
- package/lib/util/connection-liveness.d.ts +19 -6
- package/lib/util/connection-liveness.d.ts.map +1 -1
- package/lib/util/connection-liveness.js +61 -15
- package/lib/util/connection-liveness.js.map +1 -1
- package/lib/util/environment.d.ts.map +1 -1
- package/lib/util/environment.js.map +1 -1
- package/lib/util/registry.d.ts.map +1 -1
- package/package.json +38 -57
- package/src/browser/host-heads-in-worker.ts +218 -0
- package/src/browser/index.ts +17 -0
- package/src/browser/indexeddb-file-system-store.ts +192 -0
- package/src/browser/start-language-server-in-worker.ts +56 -0
- package/src/documents/ast-document-manager.ts +467 -233
- package/src/documents/client-ids.ts +5 -22
- package/src/documents/client-session-errors.ts +24 -0
- package/src/documents/client-session-registry.ts +262 -0
- package/src/documents/dirty-state-tracker.ts +167 -0
- package/src/documents/document-release-handler.ts +404 -0
- package/src/documents/document-release-scheduler.ts +121 -0
- package/src/documents/file-system-task-queue.ts +74 -0
- package/src/documents/hydranium-text-documents.ts +1022 -595
- package/src/documents/index.ts +10 -2
- package/src/documents/language-client-shadow.ts +501 -0
- package/src/documents/model-ledger.ts +66 -0
- package/src/documents/text-ledger.ts +112 -0
- package/src/documents/version-sync-service.ts +275 -0
- package/src/index.ts +8 -0
- package/src/langium/ast-extension/ast-extension-service.ts +77 -41
- package/src/langium/bootstrap.ts +95 -52
- package/src/langium/build-phase-pass/build-phase-pass-service.ts +29 -19
- package/src/langium/build-phase-pass/build-phase-pass.ts +37 -8
- package/src/langium/composite-ast-reflection.ts +112 -0
- package/src/langium/config/configuration-provider.ts +119 -0
- package/src/langium/config/index.ts +1 -0
- package/src/langium/diagnostics/hydranium-langium-profiler.ts +15 -39
- package/src/langium/diagnostics/log-preamble.ts +1 -1
- package/src/langium/diagnostics/logger.ts +38 -11
- package/src/langium/diagnostics/lsp-logger.ts +61 -16
- package/src/langium/document-builder/build-pipeline-integration.ts +46 -32
- package/src/langium/document-builder/build-session.ts +4 -3
- package/src/langium/document-builder/document-builder.ts +616 -73
- package/src/langium/integration-services.ts +59 -28
- package/src/langium/integrity/integrity-rule.ts +16 -8
- package/src/langium/integrity/integrity-service.ts +296 -69
- package/src/langium/keys/containment.ts +87 -0
- package/src/langium/keys/index.ts +1 -0
- package/src/langium/keys/name-based-key-provider.ts +4 -0
- package/src/langium/language-module.ts +49 -8
- package/src/langium/model-service/client-session.ts +718 -0
- package/src/langium/model-service/index.ts +2 -0
- package/src/langium/model-service/model-events.ts +80 -0
- package/src/langium/model-service/model-service.ts +908 -485
- package/src/langium/module.ts +212 -67
- package/src/langium/naming/name-provider.ts +44 -8
- package/src/langium/naming/name-separator-validation.ts +25 -3
- package/src/langium/project/abstract-project-manager.ts +13 -5
- package/src/langium/project/project-change-event.ts +2 -2
- package/src/langium/residency/cst-residency-service.ts +54 -19
- package/src/langium/scope/fallback-scope.ts +38 -0
- package/src/langium/scope/hydranium-scope-computation.ts +45 -44
- package/src/langium/scope/hydranium-scope-provider.ts +49 -16
- package/src/langium/scope/index.ts +1 -0
- package/src/langium/scope/reference-candidate-provider.ts +6 -5
- package/src/langium/scope/scope-extension-service.ts +74 -59
- package/src/langium/scope/scoped-ast-node-description.ts +1 -3
- package/src/langium/serialization/abstract-serializer.ts +57 -41
- package/src/langium/serialization/json-serializer.ts +14 -3
- package/src/langium/serialization/serializer.ts +1 -1
- package/src/langium/serialization/yaml-serializer.ts +4 -0
- package/src/langium/service-registry.ts +41 -2
- package/src/langium/shared-services.ts +26 -6
- package/src/langium/single-langium-copy.ts +42 -0
- package/src/langium/transfer/transfer-encoder.ts +102 -45
- package/src/langium/trivia/comment-preserver.ts +1100 -0
- package/src/langium/trivia/document-ending-preserver.ts +71 -0
- package/src/langium/trivia/index.ts +14 -0
- package/src/langium/trivia/trivia-contribution.ts +39 -0
- package/src/langium/trivia/trivia-preserver.ts +56 -0
- package/src/langium/trivia/trivia-service.ts +99 -0
- package/src/langium/update-rewrite/update-rewrite-service.ts +1 -1
- package/src/langium/update-rewrite/update-rewrite.ts +1 -1
- package/src/langium/validation/document-validator.ts +528 -13
- package/src/langium/validation/validation-contribution-collector.ts +10 -1
- package/src/langium/workspace/document-uri-policy.ts +32 -18
- package/src/langium/workspace/file-not-found.ts +35 -0
- package/src/langium/workspace/file-system-provider.ts +258 -16
- package/src/langium/workspace/hydranium-langium-document-factory.ts +83 -0
- package/src/langium/workspace/hydranium-workspace-lock.ts +86 -2
- package/src/langium/workspace/hydranium-workspace-manager.ts +241 -35
- package/src/langium/workspace/in-memory-file-system-provider.ts +54 -23
- package/src/langium/workspace/index.ts +1 -0
- package/src/langium/workspace/initialize-workspace.ts +129 -8
- package/src/langium/workspace/langium-documents.ts +19 -1
- package/src/langium/workspace/persistent-file-system-provider.ts +27 -15
- package/src/langium/workspace/self-save-registry.ts +118 -0
- package/src/langium/workspace/virtual-document.ts +106 -25
- package/src/langium/workspace/write-lock-scope.ts +27 -12
- package/src/launcher/integrated-server.ts +3 -1
- package/src/locale/index.ts +10 -0
- package/src/locale/server-locale.ts +86 -0
- package/src/lsp/completion/hydranium-completion-provider.ts +82 -2
- package/src/lsp/connection-features.ts +67 -0
- package/src/lsp/diagnostics-connection.ts +56 -0
- package/src/lsp/hydranium-document-update-handler.ts +285 -111
- package/src/lsp/index.ts +4 -1
- package/src/lsp/lsp-latency.ts +62 -0
- package/src/lsp/save-text-document.ts +63 -0
- package/src/lsp/semantic-token-provider.ts +74 -7
- package/src/lsp/shared-module.ts +4 -8
- package/src/lsp/start-language-server.ts +13 -7
- package/src/messages/carriers.ts +23 -15
- package/src/messages/index.ts +13 -1
- package/src/messages/renderer.ts +212 -0
- package/src/node/event-loop-monitor.ts +2 -1
- package/src/node/heap-ceiling.ts +108 -0
- package/src/node/index.ts +5 -1
- package/src/node/latency-from-env.ts +1 -1
- package/src/node/log-preamble-node.ts +20 -10
- package/src/node/measure-memory.ts +5 -4
- package/src/node/memory-monitor.ts +10 -10
- package/src/node/node-file-system-provider.ts +214 -57
- package/src/node/profile-capture.ts +16 -15
- package/src/node/profiling-run.ts +30 -8
- package/src/node/rename-over-open-readers.ts +94 -0
- package/src/node/server-diagnostics.ts +1 -1
- package/src/node/server-state-snapshot.ts +5 -5
- package/src/node/socket-launcher.ts +78 -14
- package/src/node/startup-cpu-profile.ts +94 -0
- package/src/node/stdio-launcher.ts +29 -19
- package/src/testing/document-uri-policy-conformance.ts +1 -1
- package/src/testing/fake-document.ts +2 -1
- package/src/testing/index.ts +2 -1
- package/src/testing/langium-test-helpers.ts +1 -0
- package/src/testing/make-noop-shared-services.ts +50 -2
- package/src/testing/make-test-services.ts +125 -31
- package/src/testing/make-test-tracer.ts +26 -0
- package/src/testing/node/applied-edit-capture.ts +141 -0
- package/src/testing/node/index.ts +1 -0
- package/src/testing/node/lsp-harness.ts +2 -0
- package/src/testing/node/lsp-server-connection.ts +83 -119
- package/src/testing/node/scratch-workspace.ts +10 -5
- package/src/testing/node/spawned-server.ts +57 -3
- package/src/testing/node/unhandled-rejections.ts +31 -0
- package/src/testing/parse-semantic-root.ts +1 -1
- package/src/testing/playwright/flaky-network-proxy.ts +240 -0
- package/src/testing/playwright/index.ts +1 -0
- package/src/testing/playwright/server-log-capture.ts +137 -47
- package/src/testing/playwright/server-log-fixture.ts +46 -6
- package/src/testing/playwright/server-log-region.ts +32 -0
- package/src/testing/playwright/server-log-rename-reporter.ts +4 -3
- package/src/testing/run-update-pipeline.ts +8 -5
- package/src/testing/stub-ast-document-manager.ts +47 -128
- package/src/testing/stub-document-builder.ts +133 -18
- package/src/testing/stub-hydranium-text-documents.ts +184 -27
- package/src/testing/stub-langium-documents.ts +3 -2
- package/src/testing/stub-model-service.ts +11 -10
- package/src/testing/stub-self-save-registry.ts +1 -1
- package/src/testing/stub-service-registry.ts +1 -1
- package/src/testing/stub-writable-file-system.ts +3 -2
- package/src/util/connection-liveness.ts +67 -15
- package/src/util/environment.ts +9 -1
- package/lib/documents/language-client-text-shadow.d.ts +0 -101
- package/lib/documents/language-client-text-shadow.d.ts.map +0 -1
- package/lib/documents/language-client-text-shadow.js +0 -156
- package/lib/documents/language-client-text-shadow.js.map +0 -1
- package/lib/documents/self-save-registry.d.ts +0 -55
- package/lib/documents/self-save-registry.d.ts.map +0 -1
- package/lib/documents/self-save-registry.js.map +0 -1
- package/lib/lsp/instrument-connection.d.ts +0 -36
- package/lib/lsp/instrument-connection.d.ts.map +0 -1
- package/lib/lsp/instrument-connection.js +0 -62
- package/lib/lsp/instrument-connection.js.map +0 -1
- package/lib/node/process-memory.d.ts +0 -66
- package/lib/node/process-memory.d.ts.map +0 -1
- package/lib/node/process-memory.js +0 -252
- package/lib/node/process-memory.js.map +0 -1
- package/src/documents/language-client-text-shadow.ts +0 -175
- package/src/documents/self-save-registry.ts +0 -81
- package/src/lsp/instrument-connection.ts +0 -66
- package/src/node/process-memory.ts +0 -299
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { type AstNode, AstUtils, type LangiumDocument
|
|
10
|
+
import { type AstNode, AstUtils, type LangiumDocument } from '@hydranium/langium';
|
|
11
11
|
import { type Disposable } from 'vscode-languageserver';
|
|
12
|
-
import { type Tracer } from '@hydranium/protocol';
|
|
12
|
+
import { Format, Logger, type ProfileRecord, type ProfileSession, type Tracer } from '@hydranium/protocol';
|
|
13
13
|
import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
14
14
|
import { type ServerLanguageServices } from '../language-module.js';
|
|
15
15
|
import { Registry, type RegistryItem } from '../../util/registry.js';
|
|
@@ -49,8 +49,7 @@ export interface ScopeDescriptionAcceptor {
|
|
|
49
49
|
* descriptions are constructed ahead of time, to avoid per-query
|
|
50
50
|
* allocation. The pushed description's `tier` must be `'local'` or
|
|
51
51
|
* `'universal'`; a description of any other tier is silently dropped,
|
|
52
|
-
* because
|
|
53
|
-
* the tier they were asked for.
|
|
52
|
+
* because {@link ScopeExtensionDescriptions} holds only those two.
|
|
54
53
|
*/
|
|
55
54
|
push(description: TieredAstNodeDescription): void;
|
|
56
55
|
}
|
|
@@ -87,38 +86,32 @@ export interface ScopeExtension extends RegistryItem {
|
|
|
87
86
|
addDescriptions(context: AstNode, referenceType: string, document: LangiumDocument, accept: ScopeDescriptionAcceptor): void;
|
|
88
87
|
}
|
|
89
88
|
|
|
89
|
+
/** The scope-extension descriptions for one reference, split by tier. */
|
|
90
|
+
export interface ScopeExtensionDescriptions {
|
|
91
|
+
readonly local: readonly TieredAstNodeDescription[];
|
|
92
|
+
readonly universal: readonly TieredAstNodeDescription[];
|
|
93
|
+
}
|
|
94
|
+
|
|
90
95
|
/**
|
|
91
96
|
* Public contract for the per-language scope-extension service. Extends
|
|
92
97
|
* the {@link ScopeExtensionRegistry} (the imperative `register` surface
|
|
93
|
-
* contributions use) with the
|
|
94
|
-
*
|
|
95
|
-
* `layerUniversalExtension` helpers, which layer scope-extension
|
|
96
|
-
* contributions around the cached project chain.
|
|
97
|
-
*
|
|
98
|
-
* Adopter overrides go through {@link DefaultScopeExtensionService}; the
|
|
99
|
-
* interface keeps the public API stable while internals
|
|
100
|
-
* (`collectExtensionDescriptions` walk) stay `protected` on the default
|
|
101
|
-
* class.
|
|
98
|
+
* contributions use) with the query `HydraniumScopeProvider` builds its
|
|
99
|
+
* extension tiers from.
|
|
102
100
|
*/
|
|
103
101
|
export interface ScopeExtensionService extends ScopeExtensionRegistry {
|
|
104
102
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
103
|
+
* Run every extension registered for `referenceType` once against
|
|
104
|
+
* `context`, and answer its descriptions by tier. A caller that needs
|
|
105
|
+
* both tiers takes them from one call: a call per tier runs every
|
|
106
|
+
* extension twice.
|
|
109
107
|
*/
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Layer this language's `universal`-tier scope-extension descriptions
|
|
113
|
-
* BELOW `outerScope` for the given reference type. Returns `outerScope`
|
|
114
|
-
* unchanged when no extension contributes a `universal`-tier
|
|
115
|
-
* description for the type.
|
|
116
|
-
*/
|
|
117
|
-
getUniversalExtensionScope(referenceType: string, context: AstNode, outerScope: Scope): Scope;
|
|
108
|
+
getDescriptions(referenceType: string, context: AstNode): ScopeExtensionDescriptions;
|
|
118
109
|
}
|
|
119
110
|
|
|
120
111
|
export type ScopeExtensionServiceOptions = LogNameOptions;
|
|
121
112
|
|
|
113
|
+
const NO_DESCRIPTIONS: ScopeExtensionDescriptions = { local: [], universal: [] };
|
|
114
|
+
|
|
122
115
|
/**
|
|
123
116
|
* Default {@link ScopeExtensionService} implementation. Per-language
|
|
124
117
|
* registry for dynamic scope contributions: extra resolvable descriptions
|
|
@@ -128,13 +121,19 @@ export type ScopeExtensionServiceOptions = LogNameOptions;
|
|
|
128
121
|
* separate from the query-time scope-resolution concern (which only reads).
|
|
129
122
|
*
|
|
130
123
|
* Lives in the per-language `references` group alongside `ScopeProvider`,
|
|
131
|
-
* which consumes
|
|
132
|
-
* / {@link getUniversalExtensionScope}). Designed as a base class; adopters
|
|
124
|
+
* which consumes {@link getDescriptions}. Designed as a base class; adopters
|
|
133
125
|
* extend it and call `register` in their constructor.
|
|
126
|
+
*
|
|
127
|
+
* At `debug`, each extension's calls and self-time go into one profile
|
|
128
|
+
* session, reported when a build starts and when it ends. A report thus
|
|
129
|
+
* covers one build, validation included, or the calls made between two
|
|
130
|
+
* builds, such as a reference picker's.
|
|
134
131
|
*/
|
|
135
132
|
export class DefaultScopeExtensionService implements ScopeExtensionService {
|
|
136
133
|
protected readonly scopeExtensions = new Registry<ScopeExtension>();
|
|
137
134
|
protected readonly tracer: Tracer;
|
|
135
|
+
/** Open from the first profiled call until {@link reportProfile}. */
|
|
136
|
+
protected profileSession?: ProfileSession;
|
|
138
137
|
|
|
139
138
|
constructor(
|
|
140
139
|
protected readonly services: ServerLanguageServices,
|
|
@@ -150,6 +149,10 @@ export class DefaultScopeExtensionService implements ScopeExtensionService {
|
|
|
150
149
|
for (const contribution of Object.values(contributions)) {
|
|
151
150
|
contribution.registerScopeExtensions(this);
|
|
152
151
|
}
|
|
152
|
+
// Optional for the same reason: a stub tree may carry no builder.
|
|
153
|
+
const builder = services.shared.workspace.DocumentBuilder;
|
|
154
|
+
builder?.onUpdate(() => this.reportProfile());
|
|
155
|
+
builder?.onBuildEnded(() => this.reportProfile());
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
/**
|
|
@@ -162,46 +165,58 @@ export class DefaultScopeExtensionService implements ScopeExtensionService {
|
|
|
162
165
|
return this.scopeExtensions.register(extension);
|
|
163
166
|
}
|
|
164
167
|
|
|
165
|
-
getLocalExtensionScope(referenceType: string, context: AstNode, outerScope: Scope): Scope {
|
|
166
|
-
const local = this.collectExtensionDescriptions(referenceType, context, 'local');
|
|
167
|
-
if (local.length === 0) {
|
|
168
|
-
return outerScope;
|
|
169
|
-
}
|
|
170
|
-
return new StreamScope(stream(local), outerScope);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
getUniversalExtensionScope(referenceType: string, context: AstNode, outerScope: Scope): Scope {
|
|
174
|
-
const universal = this.collectExtensionDescriptions(referenceType, context, 'universal');
|
|
175
|
-
if (universal.length === 0) {
|
|
176
|
-
return outerScope;
|
|
177
|
-
}
|
|
178
|
-
return new StreamScope(outerScope.getAllElements(), new MapScope(universal));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
168
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* `push`-ed descriptions of other tiers are silently dropped here —
|
|
185
|
-
* the per-tier query methods only return descriptions matching their
|
|
186
|
-
* tier. (`local` and `universal` are the only acceptor entry points;
|
|
187
|
-
* `push` is the escape hatch for pre-built descriptions and is the
|
|
188
|
-
* only path that could carry other tiers.)
|
|
169
|
+
* Holds the profile wrap, which an override would have to copy; to change
|
|
170
|
+
* which extensions run, override {@link extensionsFor}.
|
|
189
171
|
*/
|
|
190
|
-
|
|
191
|
-
referenceType
|
|
192
|
-
context: AstNode,
|
|
193
|
-
tier: 'local' | 'universal'
|
|
194
|
-
): TieredAstNodeDescription[] {
|
|
195
|
-
const extensionsForType = this.scopeExtensions.all().filter(extension => extension.referenceTypes.includes(referenceType));
|
|
172
|
+
getDescriptions(referenceType: string, context: AstNode): ScopeExtensionDescriptions {
|
|
173
|
+
const extensionsForType = this.extensionsFor(referenceType, context);
|
|
196
174
|
if (extensionsForType.length === 0) {
|
|
197
|
-
return
|
|
175
|
+
return NO_DESCRIPTIONS;
|
|
198
176
|
}
|
|
199
177
|
const document = AstUtils.getDocument(context);
|
|
200
178
|
const collected: TieredAstNodeDescription[] = [];
|
|
201
179
|
const accept = createScopeDescriptionAcceptor(collected, this.services.workspace.AstNodeDescriptionProvider);
|
|
180
|
+
const session = Logger.isLevelEnabled('debug') ? (this.profileSession ??= this.tracer.profile('scope-extension')) : undefined;
|
|
202
181
|
for (const extension of extensionsForType) {
|
|
203
|
-
|
|
182
|
+
if (session) {
|
|
183
|
+
session.scope(extension.id, () => extension.addDescriptions(context, referenceType, document, accept));
|
|
184
|
+
} else {
|
|
185
|
+
extension.addDescriptions(context, referenceType, document, accept);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return {
|
|
189
|
+
local: collected.filter(description => description.tier === 'local'),
|
|
190
|
+
universal: collected.filter(description => description.tier === 'universal')
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** The extensions that run for one reference: by default, those registered for `referenceType`. */
|
|
195
|
+
protected extensionsFor(referenceType: string, _context: AstNode): ScopeExtension[] {
|
|
196
|
+
return this.scopeExtensions.all().filter(extension => extension.referenceTypes.includes(referenceType));
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Report the profile session, if one is open, and start the next one fresh:
|
|
201
|
+
* one line per extension, its calls and self-time. Not a share of the
|
|
202
|
+
* session's time, which runs from the first call to the report and so takes
|
|
203
|
+
* in whatever happened between the calls.
|
|
204
|
+
*/
|
|
205
|
+
protected reportProfile(): void {
|
|
206
|
+
const session = this.profileSession;
|
|
207
|
+
this.profileSession = undefined;
|
|
208
|
+
for (const record of session?.records() ?? []) {
|
|
209
|
+
this.tracer.debug(this.formatProfileRecord(record));
|
|
204
210
|
}
|
|
205
|
-
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* The log line of one extension's {@link reportProfile} entry. It names the
|
|
215
|
+
* language: each has its own session, and an extension id is unique only
|
|
216
|
+
* within its language.
|
|
217
|
+
*/
|
|
218
|
+
protected formatProfileRecord(record: ProfileRecord): string {
|
|
219
|
+
const language = this.services.LanguageMetaData.languageId;
|
|
220
|
+
return `[profile scope-extension ${language}] ${record.id} ×${record.count} ${Format.elapsed(record.selfMs)}`;
|
|
206
221
|
}
|
|
207
222
|
}
|
|
@@ -157,9 +157,7 @@ export function isUniversalTier(description: AstNodeDescription): description is
|
|
|
157
157
|
* URI's project, the public-tier sibling belonging to that
|
|
158
158
|
* same project is redundant (the project-tier sibling under a shorter
|
|
159
159
|
* name is already in scope) and should be hidden from completion /
|
|
160
|
-
* linking.
|
|
161
|
-
* `HydraniumScopeProvider.bucketFor` uses this
|
|
162
|
-
* predicate to enforce the own-project canonical filter on the typed scope path.
|
|
160
|
+
* linking.
|
|
163
161
|
*
|
|
164
162
|
* `projectId` accepts `string | undefined` for adopter-call-site
|
|
165
163
|
* ergonomics: when the source has no resolvable project (standalone
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { type MaybePromise, type Tracer, type TransferElement } from '@hydranium/protocol';
|
|
11
11
|
import { type AstNode, type AstReflection, type GenericAstNode, isAstNode } from '@hydranium/langium';
|
|
12
12
|
import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
13
13
|
import { type HydraniumLanguageServices } from '../language-module.js';
|
|
@@ -66,16 +66,6 @@ export interface AbstractSerializerOptions extends LogNameOptions {
|
|
|
66
66
|
* the extra property carries a value.
|
|
67
67
|
*/
|
|
68
68
|
readonly referenceWrapperTypes?: ReadonlyMap<string, string>;
|
|
69
|
-
/**
|
|
70
|
-
* Whether {@link AbstractSerializer.serializeAst} trims trailing whitespace
|
|
71
|
-
* from the final output (leading whitespace is always trimmed). Defaults to
|
|
72
|
-
* `true` — the conventional "no trailing blank lines" document shape. Set to
|
|
73
|
-
* `false` for grammars whose values may legitimately END the document with
|
|
74
|
-
* blank lines that must survive a round-trip — e.g. a multi-line block-scalar
|
|
75
|
-
* property (see `YamlSerializerOptions.blockScalarProperties`),
|
|
76
|
-
* where a trailing-trim would silently eat user-typed blank lines.
|
|
77
|
-
*/
|
|
78
|
-
readonly trimTrailingWhitespace?: boolean;
|
|
79
69
|
}
|
|
80
70
|
|
|
81
71
|
/**
|
|
@@ -110,8 +100,11 @@ export interface AbstractSerializerOptions extends LogNameOptions {
|
|
|
110
100
|
* **Extension points** (override in a subclass):
|
|
111
101
|
* - {@link serializeReferenceText} — extract the textual form of a
|
|
112
102
|
* cross-reference; defaults to the value's `$refText`.
|
|
103
|
+
* - {@link formatString} — quote a string, as a primitive or a reference, for
|
|
104
|
+
* the grammar's string terminal; the one override for a grammar whose
|
|
105
|
+
* terminal or value converter differs from Langium's default.
|
|
113
106
|
* - {@link formatReferenceValue} — format a cross-reference value for emission;
|
|
114
|
-
* defaults to
|
|
107
|
+
* defaults to {@link formatString}.
|
|
115
108
|
* - {@link serializeCustomValue} — type-specific serialization for values
|
|
116
109
|
* that don't fit the generic paths. Runs after all reference detection, so
|
|
117
110
|
* references never reach this hook. Returns `undefined` to fall through to
|
|
@@ -124,6 +117,25 @@ export abstract class AbstractSerializer<
|
|
|
124
117
|
TAst extends AstNode = AstNode,
|
|
125
118
|
TTransfer extends TransferElement = TransferElement
|
|
126
119
|
> implements Serializer<TAst, TTransfer> {
|
|
120
|
+
/**
|
|
121
|
+
* The escapes {@link formatString} writes, read through the subclass, so a
|
|
122
|
+
* grammar adding one overrides this table alone. Langium's
|
|
123
|
+
* `ValueConverter.convertString` decodes the short escapes here and reads
|
|
124
|
+
* any other escaped character as itself, which is how `\\` and `\"` read
|
|
125
|
+
* back, and why a `\u` escape would read back as `u`.
|
|
126
|
+
*/
|
|
127
|
+
protected static readonly STRING_ESCAPES: ReadonlyMap<string, string> = new Map([
|
|
128
|
+
['\\', '\\\\'],
|
|
129
|
+
['"', '\\"'],
|
|
130
|
+
['\b', '\\b'],
|
|
131
|
+
['\f', '\\f'],
|
|
132
|
+
['\n', '\\n'],
|
|
133
|
+
['\r', '\\r'],
|
|
134
|
+
['\t', '\\t'],
|
|
135
|
+
['\v', '\\v'],
|
|
136
|
+
['\0', '\\0']
|
|
137
|
+
]);
|
|
138
|
+
|
|
127
139
|
protected readonly reflection: AstReflection;
|
|
128
140
|
protected readonly tracer: Tracer;
|
|
129
141
|
|
|
@@ -139,29 +151,20 @@ export abstract class AbstractSerializer<
|
|
|
139
151
|
* Entry point for AST-shape inputs. Typically the grammar root, but any
|
|
140
152
|
* AST node works — the walker is recursive and shape-agnostic.
|
|
141
153
|
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
154
|
+
* **Emits the model and nothing else — do not trim here.** Trailing
|
|
155
|
+
* whitespace belongs to the author, and a write path holding the prior
|
|
156
|
+
* document restores it from there; trimming at this end deletes it before
|
|
157
|
+
* that restore sees it. A serializer has no prior document to consult, so it
|
|
158
|
+
* cannot tell a deliberate blank line from an accidental one.
|
|
159
|
+
*
|
|
160
|
+
* **Nothing trims what a subclass emits**, at either end. Emitting leading
|
|
161
|
+
* whitespace therefore puts it in the file, where no write path removes it.
|
|
162
|
+
*
|
|
163
|
+
* Returns whatever `serializeNode` returns, so a fully sync subclass keeps a
|
|
164
|
+
* bare `string` with no promise allocation.
|
|
146
165
|
*/
|
|
147
166
|
serializeAst(model: TAst): MaybePromise<string> {
|
|
148
|
-
|
|
149
|
-
if (isPromiseLike(result)) {
|
|
150
|
-
return result.then(text => this.trimSerialized(text));
|
|
151
|
-
}
|
|
152
|
-
return this.trimSerialized(result);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Trim the final serialized output. Leading whitespace is always removed;
|
|
157
|
-
* trailing whitespace is removed unless {@link AbstractSerializerOptions.trimTrailingWhitespace}
|
|
158
|
-
* is `false` (which preserves document-ending blank lines, e.g. inside a block scalar).
|
|
159
|
-
*/
|
|
160
|
-
protected trimSerialized(text: string | undefined): string {
|
|
161
|
-
if (text === undefined) {
|
|
162
|
-
return '';
|
|
163
|
-
}
|
|
164
|
-
return this.options.trimTrailingWhitespace === false ? text.trimStart() : text.trim();
|
|
167
|
+
return this.serializeNode(model, 0);
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
/**
|
|
@@ -426,29 +429,42 @@ export abstract class AbstractSerializer<
|
|
|
426
429
|
}
|
|
427
430
|
|
|
428
431
|
/**
|
|
429
|
-
* Format a cross-reference value for emission. Defaults to
|
|
430
|
-
* Override to apply language-specific reference
|
|
431
|
-
* id-reference formatter that mirrors the grammar's id
|
|
432
|
+
* Format a cross-reference value for emission. Defaults to
|
|
433
|
+
* {@link formatString}. Override to apply language-specific reference
|
|
434
|
+
* quoting — e.g. an id-reference formatter that mirrors the grammar's id
|
|
435
|
+
* convention.
|
|
432
436
|
*
|
|
433
437
|
* Returns {@link MaybePromise} so adopters with async formatting needs
|
|
434
438
|
* (remote schema lookup, external canonical-id resolution) can return a
|
|
435
439
|
* `Promise<string>`. Sync overrides remain valid.
|
|
436
440
|
*/
|
|
437
441
|
protected formatReferenceValue(value: string): MaybePromise<string> {
|
|
438
|
-
return
|
|
442
|
+
return this.formatString(value);
|
|
439
443
|
}
|
|
440
444
|
|
|
441
445
|
/**
|
|
442
|
-
* Format a primitive value (string, number, boolean) for emission.
|
|
443
|
-
*
|
|
444
|
-
*
|
|
446
|
+
* Format a primitive value (string, number, boolean) for emission. A string
|
|
447
|
+
* goes through {@link formatString}, any other value through
|
|
448
|
+
* `JSON.stringify`.
|
|
445
449
|
*
|
|
446
450
|
* Returns {@link MaybePromise} so adopters with async formatting needs
|
|
447
451
|
* (e.g. delegating to `prettier.format` for a specific value class) can
|
|
448
452
|
* return a `Promise<string>`.
|
|
449
453
|
*/
|
|
450
454
|
protected formatPrimitive(value: unknown): MaybePromise<string> {
|
|
451
|
-
return JSON.stringify(value);
|
|
455
|
+
return typeof value === 'string' ? this.formatString(value) : JSON.stringify(value);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Quote a string, as a primitive or a reference, for its reader: the
|
|
460
|
+
* grammar's string terminal and value converter. Defaults to the inverse of
|
|
461
|
+
* Langium's default `STRING` terminal and converter: double quotes, `\` and
|
|
462
|
+
* `"` escaped, the converter's short escapes, every other character as it
|
|
463
|
+
* is. A grammar with another terminal or converter overrides this.
|
|
464
|
+
*/
|
|
465
|
+
protected formatString(value: string): string {
|
|
466
|
+
const escapes = (this.constructor as typeof AbstractSerializer).STRING_ESCAPES;
|
|
467
|
+
return `"${Array.from(value, char => escapes.get(char) ?? char).join('')}"`;
|
|
452
468
|
}
|
|
453
469
|
|
|
454
470
|
/**
|
|
@@ -224,13 +224,24 @@ export class JsonSerializer<TAst extends AstNode = AstNode, TTransfer extends Tr
|
|
|
224
224
|
* encodings.
|
|
225
225
|
*/
|
|
226
226
|
protected override formatReferenceValue(value: string): MaybePromise<string> {
|
|
227
|
+
const quoted = this.formatString(value);
|
|
227
228
|
if (this.referenceEncoding === 'string') {
|
|
228
|
-
return
|
|
229
|
+
return quoted;
|
|
229
230
|
}
|
|
230
231
|
if (this.compact) {
|
|
231
|
-
return `{${JSON.stringify('$ref')}:${
|
|
232
|
+
return `{${JSON.stringify('$ref')}:${quoted}}`;
|
|
232
233
|
}
|
|
233
|
-
return `{ ${JSON.stringify('$ref')}: ${
|
|
234
|
+
return `{ ${JSON.stringify('$ref')}: ${quoted} }`;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* `JSON.stringify`, so the output stays valid JSON for other tools. The
|
|
239
|
+
* grammar reading it back needs a terminal and value converter that decode
|
|
240
|
+
* the `\u` escape JSON writes for a control character without a short
|
|
241
|
+
* escape; Langium's default converter reads `\u0001` as `u0001`.
|
|
242
|
+
*/
|
|
243
|
+
protected override formatString(value: string): string {
|
|
244
|
+
return JSON.stringify(value);
|
|
234
245
|
}
|
|
235
246
|
|
|
236
247
|
protected composeObject(entries: readonly (readonly [string, string])[], indentationLevel: number): string {
|
|
@@ -34,7 +34,7 @@ import type { AstNode } from '@hydranium/langium';
|
|
|
34
34
|
* Neither method requires the input to be the grammar root — the walker is
|
|
35
35
|
* recursive and shape-agnostic, so any element from either tree serializes
|
|
36
36
|
* correctly. Callers typically pass a root (that's what
|
|
37
|
-
* `
|
|
37
|
+
* `DefaultModelService.serialize`
|
|
38
38
|
* and the GLSP source-model flows hand in), but sub-tree serialization works
|
|
39
39
|
* for unit tests, snippet rendering, and tooling.
|
|
40
40
|
*/
|
|
@@ -87,6 +87,10 @@ export interface YamlSerializerOptions extends AbstractSerializerOptions {
|
|
|
87
87
|
* points. YAML's one addition is unquoted-terminal emission, handled by its
|
|
88
88
|
* {@link serializeCustomValue} override driven by
|
|
89
89
|
* {@link YamlSerializerOptions.unquotedProperties}.
|
|
90
|
+
*
|
|
91
|
+
* The grammar, not a YAML parser, reads its quoted strings back, so a control
|
|
92
|
+
* character without a short escape is written raw, which a strict YAML parser
|
|
93
|
+
* such as js-yaml refuses.
|
|
90
94
|
*/
|
|
91
95
|
export class YamlSerializer<TAst extends AstNode = AstNode, TTransfer extends TransferElement = TransferElement> extends AbstractSerializer<
|
|
92
96
|
TAst,
|
|
@@ -209,6 +209,19 @@ export class ExtendedServiceRegistry<
|
|
|
209
209
|
return super.getServices(arg);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Every registered language's services, typed as `TServices` like the
|
|
214
|
+
* lookups here rather than as Langium's base shape, so a sweep of the whole
|
|
215
|
+
* set reaches what a URI or a typed handle would have given it.
|
|
216
|
+
*
|
|
217
|
+
* The cast is sound because {@link register} is the only way a language
|
|
218
|
+
* enters and takes `TServices`; the inherited accessor is typed to Langium's
|
|
219
|
+
* base, which is the only reason one is needed.
|
|
220
|
+
*/
|
|
221
|
+
override get all(): readonly TServices[] {
|
|
222
|
+
return super.all as readonly TServices[];
|
|
223
|
+
}
|
|
224
|
+
|
|
212
225
|
/**
|
|
213
226
|
* Lookup by anything that identifies a document — an AST node (routed by
|
|
214
227
|
* the document it lives in), a `URI`, or a URI string. `undefined` when the
|
|
@@ -255,9 +268,13 @@ export class ExtendedServiceRegistry<
|
|
|
255
268
|
* inherited Langium semantics, which throws on miss). Used for
|
|
256
269
|
* dynamically-routed lookups where the language id comes from
|
|
257
270
|
* external input.
|
|
271
|
+
*
|
|
272
|
+
* The cast is sound because {@link register} is the only way a language
|
|
273
|
+
* enters and takes `TServices`; `languageIdMap` is inherited and typed to
|
|
274
|
+
* Langium's base, which is the only reason one is needed.
|
|
258
275
|
*/
|
|
259
|
-
getServicesById(languageId: string):
|
|
260
|
-
return this.languageIdMap.get(languageId);
|
|
276
|
+
getServicesById(languageId: string): TServices | undefined {
|
|
277
|
+
return this.languageIdMap.get(languageId) as TServices | undefined;
|
|
261
278
|
}
|
|
262
279
|
|
|
263
280
|
/**
|
|
@@ -299,6 +316,28 @@ export class ExtendedServiceRegistry<
|
|
|
299
316
|
return owners.length === 1 ? owners[0] : undefined;
|
|
300
317
|
}
|
|
301
318
|
|
|
319
|
+
/**
|
|
320
|
+
* The language the strongest signal given names: a declared `languageId`,
|
|
321
|
+
* then `target`'s document, then the only registered language, then the sole
|
|
322
|
+
* producer of `type`. `undefined` when none answers, which leaves the
|
|
323
|
+
* fallback to the caller, since it differs per caller.
|
|
324
|
+
*
|
|
325
|
+
* A declared id comes first because every later signal is inferred, and an
|
|
326
|
+
* inference must not override a caller that said which grammar it means.
|
|
327
|
+
*/
|
|
328
|
+
getLanguageFor(hint: { readonly languageId?: string; readonly target?: LanguageTarget; readonly type?: string }): TServices | undefined {
|
|
329
|
+
const declared = hint.languageId === undefined ? undefined : this.getServicesById(hint.languageId);
|
|
330
|
+
const located = declared ?? this.getServicesFor(hint.target);
|
|
331
|
+
if (located) {
|
|
332
|
+
return located;
|
|
333
|
+
}
|
|
334
|
+
const all = this.all;
|
|
335
|
+
if (all.length === 1) {
|
|
336
|
+
return all[0];
|
|
337
|
+
}
|
|
338
|
+
return hint.type === undefined ? undefined : this.soleServicesByType(hint.type);
|
|
339
|
+
}
|
|
340
|
+
|
|
302
341
|
/**
|
|
303
342
|
* Drop the memoised type index, so a language registered after the first
|
|
304
343
|
* type lookup is accounted for. The reason this index belongs on the
|
|
@@ -9,8 +9,12 @@
|
|
|
9
9
|
|
|
10
10
|
import type { Clock, Logger, Project, Tracer } from '@hydranium/protocol';
|
|
11
11
|
import type { LangiumSharedCoreServices } from '@hydranium/langium';
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
12
|
+
import type { ServerLocale } from '../locale/server-locale.js';
|
|
13
|
+
import type { MessageRenderer } from '../messages/renderer.js';
|
|
14
|
+
import type { SelfSaveRegistry } from './workspace/self-save-registry.js';
|
|
15
|
+
import type { ModelLedger } from '../documents/model-ledger.js';
|
|
16
|
+
import type { VersionSyncService } from '../documents/version-sync-service.js';
|
|
17
|
+
import type { WritableFileSystemProvider } from './workspace/file-system-provider.js';
|
|
14
18
|
import type { HydraniumDocumentRegistry } from './workspace/langium-documents.js';
|
|
15
19
|
import type { BuildPhasePassService } from './build-phase-pass/build-phase-pass-service.js';
|
|
16
20
|
import type { CstResidencyService } from './residency/cst-residency-service.js';
|
|
@@ -19,6 +23,7 @@ import type { ProjectManager } from './project/project-manager.js';
|
|
|
19
23
|
import type { ExtendedServiceRegistry } from './service-registry.js';
|
|
20
24
|
import type { DocumentUriPolicy } from './workspace/document-uri-policy.js';
|
|
21
25
|
import type { HydraniumWorkspaceManager } from './workspace/hydranium-workspace-manager.js';
|
|
26
|
+
import type { HydraniumDocumentBuilder } from './document-builder/document-builder.js';
|
|
22
27
|
import type { AdditionalDocumentContribution } from './workspace/additional-document-contribution.js';
|
|
23
28
|
|
|
24
29
|
/**
|
|
@@ -28,12 +33,13 @@ import type { AdditionalDocumentContribution } from './workspace/additional-docu
|
|
|
28
33
|
* framework additions that other framework services consume: the dedicated
|
|
29
34
|
* {@link Clock}, {@link Logger} and {@link Tracer} top-level slots (injectable
|
|
30
35
|
* time source, emission-only logger, and the measure-and-emit tracer composed
|
|
31
|
-
* from the other two), the {@link AdditionalDocumentContribution} group,
|
|
32
|
-
* {@link
|
|
36
|
+
* from the other two), the {@link AdditionalDocumentContribution} group, the
|
|
37
|
+
* {@link MessageRenderer} and the {@link ServerLocale} it renders in,
|
|
38
|
+
* an {@link ExtendedServiceRegistry}, and on `workspace` a writable file-system
|
|
33
39
|
* provider plus {@link HydraniumWorkspaceManager}, {@link ProjectManager},
|
|
34
40
|
* {@link SelfSaveRegistry}, {@link BuildPipelineIntegration},
|
|
35
|
-
* {@link BuildPhasePassService}, {@link CstResidencyService}
|
|
36
|
-
* {@link DocumentUriPolicy}.
|
|
41
|
+
* {@link BuildPhasePassService}, {@link CstResidencyService},
|
|
42
|
+
* {@link DocumentUriPolicy}, {@link ModelLedger} and {@link VersionSyncService}.
|
|
37
43
|
*
|
|
38
44
|
* Declared structurally (interface extends + intersection on nested slots)
|
|
39
45
|
* so the full `ServerSharedServices` and any consumer-extended variant
|
|
@@ -58,6 +64,14 @@ export interface ServerSharedServicesMinimal<TProject extends Project = Project>
|
|
|
58
64
|
* adopters deep-merge contributions that seed built-in / stdlib documents.
|
|
59
65
|
*/
|
|
60
66
|
additionalDocuments: Record<string, AdditionalDocumentContribution>;
|
|
67
|
+
/**
|
|
68
|
+
* Renders each user-facing message once, before the server sends it. On the
|
|
69
|
+
* shared tier with no workspace dependency, because all three heads'
|
|
70
|
+
* messages pass through it.
|
|
71
|
+
*/
|
|
72
|
+
MessageRenderer: MessageRenderer;
|
|
73
|
+
/** The locale an init handed the server, for whoever renders in it. */
|
|
74
|
+
ServerLocale: ServerLocale;
|
|
61
75
|
/**
|
|
62
76
|
* Narrows Langium's base `ServiceRegistry` slot to the framework impl the
|
|
63
77
|
* framework always binds, so the abstaining lookups — `getServicesFor`
|
|
@@ -81,12 +95,18 @@ export interface ServerSharedServicesMinimal<TProject extends Project = Project>
|
|
|
81
95
|
// only through this narrowing — a scope provider querying a URI before
|
|
82
96
|
// the file exists is the caller that needs it.
|
|
83
97
|
/* override */ LangiumDocuments: HydraniumDocumentRegistry;
|
|
98
|
+
// Same, for the builder: only the framework's has `onBuildEnded`, which a
|
|
99
|
+
// per-build report needs because Langium's phases stay silent for a
|
|
100
|
+
// build that validates nothing.
|
|
101
|
+
/* override */ DocumentBuilder: HydraniumDocumentBuilder;
|
|
84
102
|
ProjectManager: ProjectManager<TProject>;
|
|
85
103
|
SelfSaveRegistry: SelfSaveRegistry;
|
|
86
104
|
BuildPipelineIntegration: BuildPipelineIntegration;
|
|
87
105
|
BuildPhasePassService: BuildPhasePassService;
|
|
88
106
|
CstResidencyService: CstResidencyService;
|
|
89
107
|
DocumentUriPolicy: DocumentUriPolicy;
|
|
108
|
+
ModelLedger: ModelLedger;
|
|
109
|
+
VersionSyncService: VersionSyncService;
|
|
90
110
|
};
|
|
91
111
|
}
|
|
92
112
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
|
|
10
|
+
import { AbstractAstReflection, type AstReflection } from '@hydranium/langium';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Fail fast when `reflection` extends `AbstractAstReflection` from a second
|
|
14
|
+
* copy of `langium`, which the files `langium-cli` generates run on: a second
|
|
15
|
+
* install, or one install a bundler or test runner loads twice.
|
|
16
|
+
*
|
|
17
|
+
* A reflection whose prototype chain misses this copy's base is taken to come
|
|
18
|
+
* from another copy when it carries the `subtypes` and `allSubtypes` fields that
|
|
19
|
+
* base creates, which `AstReflection` does not declare. Fields rather than the
|
|
20
|
+
* class name, because bundlers and minifiers rename classes; a hand-written
|
|
21
|
+
* reflection passes unless it declares both fields itself.
|
|
22
|
+
*/
|
|
23
|
+
export function assertSingleLangiumCopy(
|
|
24
|
+
reflection: AstReflection,
|
|
25
|
+
subject: () => string = () => `the shared AstReflection (${reflection.constructor?.name ?? 'no constructor'})`
|
|
26
|
+
): void {
|
|
27
|
+
if (reflection instanceof AbstractAstReflection) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (Object.hasOwn(reflection, 'subtypes') && Object.hasOwn(reflection, 'allSubtypes')) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`[hydranium] ${subject()} extends \`AbstractAstReflection\` from another instance of \`langium\` than ` +
|
|
33
|
+
'the one `@hydranium/langium` loads, a second physical copy or one install loaded twice, so the generated ' +
|
|
34
|
+
'code runs on one and the framework on the other. Values Langium compares by identity, such as its ' +
|
|
35
|
+
'cancellation signal, are not recognised across the two. `npm explain langium` lists each installed copy ' +
|
|
36
|
+
'and what requires it. If your package resolves another version, declare `langium` at the version ' +
|
|
37
|
+
'`@hydranium/langium` pins and reinstall from scratch, without the lockfile; in a workspace, declare the ' +
|
|
38
|
+
'same pins in the root as well. If a test runner or bundler inlines `langium` but not `@hydranium/*`, ' +
|
|
39
|
+
'load both the same way.'
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|