@hydranium/core 1.0.0-next.37 → 1.0.0-next.370
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 +254 -140
- package/lib/documents/ast-document-manager.d.ts.map +1 -1
- package/lib/documents/ast-document-manager.js +311 -127
- 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 +445 -282
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
- package/lib/documents/hydranium-text-documents.js +903 -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 +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -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/ast-extension/ast-node-builder.d.ts +12 -7
- package/lib/langium/ast-extension/ast-node-builder.d.ts.map +1 -1
- package/lib/langium/ast-extension/ast-node-builder.js +25 -9
- package/lib/langium/ast-extension/ast-node-builder.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 +75 -36
- 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/console-tee.d.ts +27 -0
- package/lib/langium/diagnostics/console-tee.d.ts.map +1 -0
- package/lib/langium/diagnostics/console-tee.js +141 -0
- package/lib/langium/diagnostics/console-tee.js.map +1 -0
- 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 +25 -6
- package/lib/langium/diagnostics/logger.d.ts.map +1 -1
- package/lib/langium/diagnostics/logger.js +49 -17
- package/lib/langium/diagnostics/logger.js.map +1 -1
- package/lib/langium/diagnostics/lsp-logger.d.ts +25 -0
- package/lib/langium/diagnostics/lsp-logger.d.ts.map +1 -1
- package/lib/langium/diagnostics/lsp-logger.js +81 -46
- 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 +43 -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 +308 -39
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
- package/lib/langium/document-builder/document-builder.js +490 -79
- 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 +39 -23
- 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 +17 -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 +95 -27
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-service.js +303 -63
- package/lib/langium/integrity/integrity-service.js.map +1 -1
- package/lib/langium/keys/containment.d.ts +3 -2
- package/lib/langium/keys/containment.d.ts.map +1 -1
- package/lib/langium/keys/containment.js.map +1 -1
- package/lib/langium/keys/name-based-key-provider.d.ts +17 -10
- package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -1
- package/lib/langium/keys/name-based-key-provider.js +24 -12
- 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 +21 -5
- 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 +68 -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 +440 -323
- package/lib/langium/model-service/model-service.d.ts.map +1 -1
- package/lib/langium/model-service/model-service.js +601 -397
- package/lib/langium/model-service/model-service.js.map +1 -1
- package/lib/langium/module.d.ts +89 -30
- package/lib/langium/module.d.ts.map +1 -1
- package/lib/langium/module.js +39 -27
- package/lib/langium/module.js.map +1 -1
- package/lib/langium/naming/name-provider.d.ts +32 -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.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 +15 -11
- package/lib/langium/residency/cst-residency-service.d.ts.map +1 -1
- package/lib/langium/residency/cst-residency-service.js +15 -3
- package/lib/langium/residency/cst-residency-service.js.map +1 -1
- package/lib/langium/scope/ast-node-description-provider.d.ts +46 -10
- package/lib/langium/scope/ast-node-description-provider.d.ts.map +1 -1
- package/lib/langium/scope/ast-node-description-provider.js +88 -15
- package/lib/langium/scope/ast-node-description-provider.js.map +1 -1
- package/lib/langium/scope/built-local-symbols.d.ts +12 -0
- package/lib/langium/scope/built-local-symbols.d.ts.map +1 -0
- package/lib/langium/scope/built-local-symbols.js +11 -0
- package/lib/langium/scope/built-local-symbols.js.map +1 -0
- 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 +122 -32
- package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.js +217 -39
- 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 +69 -37
- package/lib/langium/scope/scope-extension-service.d.ts.map +1 -1
- package/lib/langium/scope/scope-extension-service.js +102 -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 +12 -0
- package/lib/langium/serialization/yaml-serializer.d.ts.map +1 -1
- package/lib/langium/serialization/yaml-serializer.js +24 -4
- 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 +10 -4
- 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 +60 -39
- package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -1
- package/lib/langium/transfer/transfer-encoder.js +35 -24
- package/lib/langium/transfer/transfer-encoder.js.map +1 -1
- package/lib/langium/trivia/comment-preserver.d.ts +543 -0
- package/lib/langium/trivia/comment-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/comment-preserver.js +1164 -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 +168 -23
- package/lib/langium/validation/document-validator.d.ts.map +1 -1
- package/lib/langium/validation/document-validator.js +264 -26
- 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/ast-node-locator.d.ts +24 -0
- package/lib/langium/workspace/ast-node-locator.d.ts.map +1 -0
- package/lib/langium/workspace/ast-node-locator.js +32 -0
- package/lib/langium/workspace/ast-node-locator.js.map +1 -0
- 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 +103 -21
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.js +184 -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 +2 -0
- package/lib/langium/workspace/index.d.ts.map +1 -1
- package/lib/langium/workspace/index.js +2 -0
- package/lib/langium/workspace/index.js.map +1 -1
- package/lib/langium/workspace/initialize-workspace.d.ts +40 -3
- package/lib/langium/workspace/initialize-workspace.d.ts.map +1 -1
- package/lib/langium/workspace/initialize-workspace.js +68 -3
- 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/{documents → langium/workspace}/self-save-registry.d.ts +7 -9
- package/lib/langium/workspace/self-save-registry.d.ts.map +1 -0
- package/lib/{documents → langium/workspace}/self-save-registry.js +9 -11
- 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/server-locale.d.ts +6 -6
- package/lib/locale/server-locale.d.ts.map +1 -1
- package/lib/locale/server-locale.js.map +1 -1
- 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/edit-requests-guard.d.ts +31 -0
- package/lib/lsp/edit-requests-guard.d.ts.map +1 -0
- package/lib/lsp/edit-requests-guard.js +125 -0
- package/lib/lsp/edit-requests-guard.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 +234 -101
- package/lib/lsp/hydranium-document-update-handler.js.map +1 -1
- package/lib/lsp/index.d.ts +6 -2
- package/lib/lsp/index.d.ts.map +1 -1
- package/lib/lsp/index.js +6 -2
- 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 +58 -2
- package/lib/lsp/semantic-token-provider.d.ts.map +1 -1
- package/lib/lsp/semantic-token-provider.js +98 -9
- 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 +12 -7
- package/lib/lsp/start-language-server.d.ts.map +1 -1
- package/lib/lsp/start-language-server.js +21 -7
- package/lib/lsp/start-language-server.js.map +1 -1
- package/lib/messages/carriers.d.ts +4 -6
- package/lib/messages/carriers.d.ts.map +1 -1
- package/lib/messages/carriers.js +4 -6
- package/lib/messages/carriers.js.map +1 -1
- package/lib/messages/index.d.ts +2 -2
- package/lib/messages/index.d.ts.map +1 -1
- package/lib/messages/index.js +2 -2
- package/lib/messages/index.js.map +1 -1
- package/lib/messages/renderer.d.ts +10 -4
- package/lib/messages/renderer.d.ts.map +1 -1
- package/lib/messages/renderer.js +6 -0
- package/lib/messages/renderer.js.map +1 -1
- 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-file-sink.d.ts +3 -2
- package/lib/node/log-file-sink.d.ts.map +1 -1
- package/lib/node/log-file-sink.js +6 -2
- package/lib/node/log-file-sink.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/node/validate-workspace.d.ts +1 -1
- package/lib/node/validate-workspace.d.ts.map +1 -1
- package/lib/node/validate-workspace.js +5 -1
- package/lib/node/validate-workspace.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.js.map +1 -1
- package/lib/testing/make-test-services.d.ts +45 -14
- package/lib/testing/make-test-services.d.ts.map +1 -1
- package/lib/testing/make-test-services.js +23 -7
- 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 -51
- package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
- package/lib/testing/stub-ast-document-manager.js +31 -59
- 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 +8 -7
- package/lib/testing/stub-model-service.d.ts.map +1 -1
- package/lib/testing/stub-model-service.js +4 -4
- 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 +22 -6
- package/lib/util/connection-liveness.d.ts.map +1 -1
- package/lib/util/connection-liveness.js +75 -15
- package/lib/util/connection-liveness.js.map +1 -1
- package/lib/util/environment.d.ts +7 -0
- package/lib/util/environment.d.ts.map +1 -1
- package/lib/util/environment.js +15 -1
- package/lib/util/environment.js.map +1 -1
- package/lib/util/registry.d.ts.map +1 -1
- package/package.json +41 -60
- 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 +477 -249
- 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 +1029 -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 +3 -0
- package/src/langium/ast-extension/ast-extension-service.ts +77 -41
- package/src/langium/ast-extension/ast-node-builder.ts +35 -13
- package/src/langium/bootstrap.ts +79 -43
- 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/console-tee.ts +150 -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 +51 -17
- package/src/langium/diagnostics/lsp-logger.ts +83 -45
- package/src/langium/document-builder/build-pipeline-integration.ts +57 -32
- package/src/langium/document-builder/build-session.ts +4 -3
- package/src/langium/document-builder/document-builder.ts +613 -77
- package/src/langium/integration-services.ts +58 -27
- package/src/langium/integrity/integrity-rule.ts +17 -8
- package/src/langium/integrity/integrity-service.ts +332 -69
- package/src/langium/keys/containment.ts +3 -2
- package/src/langium/keys/name-based-key-provider.ts +24 -12
- package/src/langium/language-module.ts +52 -9
- package/src/langium/model-service/client-session.ts +726 -0
- package/src/langium/model-service/index.ts +2 -0
- package/src/langium/model-service/model-events.ts +82 -0
- package/src/langium/model-service/model-service.ts +887 -522
- package/src/langium/module.ts +132 -56
- package/src/langium/naming/name-provider.ts +34 -8
- 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 +30 -14
- package/src/langium/scope/ast-node-description-provider.ts +111 -16
- package/src/langium/scope/built-local-symbols.ts +13 -0
- 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 +245 -41
- 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 +148 -56
- 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 +26 -4
- package/src/langium/service-registry.ts +41 -2
- package/src/langium/shared-services.ts +13 -4
- package/src/langium/single-langium-copy.ts +42 -0
- package/src/langium/transfer/transfer-encoder.ts +76 -50
- package/src/langium/trivia/comment-preserver.ts +1409 -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 +312 -31
- package/src/langium/validation/validation-contribution-collector.ts +10 -1
- package/src/langium/workspace/ast-node-locator.ts +33 -0
- 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 +212 -35
- package/src/langium/workspace/in-memory-file-system-provider.ts +54 -23
- package/src/langium/workspace/index.ts +2 -0
- package/src/langium/workspace/initialize-workspace.ts +96 -4
- package/src/langium/workspace/langium-documents.ts +19 -1
- package/src/langium/workspace/persistent-file-system-provider.ts +27 -15
- package/src/{documents → langium/workspace}/self-save-registry.ts +12 -14
- 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/server-locale.ts +6 -6
- 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/edit-requests-guard.ts +152 -0
- package/src/lsp/hydranium-document-update-handler.ts +284 -110
- package/src/lsp/index.ts +6 -2
- package/src/lsp/lsp-latency.ts +62 -0
- package/src/lsp/save-text-document.ts +63 -0
- package/src/lsp/semantic-token-provider.ts +146 -8
- package/src/lsp/shared-module.ts +4 -8
- package/src/lsp/start-language-server.ts +21 -7
- package/src/messages/carriers.ts +4 -6
- package/src/messages/index.ts +11 -2
- package/src/messages/renderer.ts +11 -3
- 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-file-sink.ts +6 -2
- 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/node/validate-workspace.ts +8 -2
- 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-test-services.ts +83 -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 -123
- package/src/testing/stub-document-builder.ts +138 -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 +9 -8
- 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 +81 -15
- package/src/util/environment.ts +24 -2
- 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.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/lsp/instrument-connection.ts +0 -66
- package/src/node/process-memory.ts +0 -299
package/src/langium/module.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { type Clock, type Logger, type Project, type Tracer, NoopLogger, SystemClock } from '@hydranium/protocol';
|
|
10
|
+
import { type Clock, type Logger, type Project, type Tracer, type TransferDiagnostic, NoopLogger, SystemClock } from '@hydranium/protocol';
|
|
11
11
|
import { DefaultServerLocale, type ServerLocale } from '../locale/server-locale.js';
|
|
12
12
|
import { DefaultMessageRenderer, type MessageRenderer } from '../messages/renderer.js';
|
|
13
13
|
import { ServerTracer } from './diagnostics/server-tracer.js';
|
|
@@ -15,6 +15,7 @@ import { HydraniumLangiumProfiler } from './diagnostics/hydranium-langium-profil
|
|
|
15
15
|
import { type AstNode, type Module } from '@hydranium/langium';
|
|
16
16
|
import { type DefaultSharedModuleContext, type LangiumSharedServices, type PartialLangiumSharedServices } from '@hydranium/langium/lsp';
|
|
17
17
|
import { type TextDocument } from 'vscode-languageserver-textdocument';
|
|
18
|
+
import { type ClientSessionFactory, DefaultClientSessionFactory } from './model-service/client-session.js';
|
|
18
19
|
import { DefaultModelService, type ModelService } from './model-service/model-service.js';
|
|
19
20
|
import { type ProjectManager } from './project/project-manager.js';
|
|
20
21
|
import { SingleProjectManager } from './project/single-project-manager.js';
|
|
@@ -24,6 +25,7 @@ import { DefaultBuildPipelineIntegration, type BuildPipelineIntegration } from '
|
|
|
24
25
|
import { type BuildPhasePassContribution } from './build-phase-pass/build-phase-pass.js';
|
|
25
26
|
import { type BuildPhasePassService, DefaultBuildPhasePassService } from './build-phase-pass/build-phase-pass-service.js';
|
|
26
27
|
import { DefaultCstResidencyService, type CstResidencyService } from './residency/index.js';
|
|
28
|
+
import { HydraniumConfigurationProvider } from './config/configuration-provider.js';
|
|
27
29
|
import { HydraniumIndexManager } from './workspace/index-manager.js';
|
|
28
30
|
import { HydraniumWorkspaceManager } from './workspace/hydranium-workspace-manager.js';
|
|
29
31
|
import { HydraniumWorkspaceLock } from './workspace/hydranium-workspace-lock.js';
|
|
@@ -32,9 +34,19 @@ import { type HydraniumDocumentRegistry, HydraniumLangiumDocuments } from './wor
|
|
|
32
34
|
import { type AdditionalDocumentContribution } from './workspace/additional-document-contribution.js';
|
|
33
35
|
import { DefaultDocumentUriPolicy, type DocumentUriPolicy } from './workspace/document-uri-policy.js';
|
|
34
36
|
import { HydraniumTextDocuments } from '../documents/hydranium-text-documents.js';
|
|
35
|
-
import { DefaultAstDocumentManager, type AstDocumentManager
|
|
36
|
-
import { DefaultSelfSaveRegistry, type SelfSaveRegistry } from '
|
|
37
|
-
import {
|
|
37
|
+
import { DefaultAstDocumentManager, type AstDocumentManager } from '../documents/ast-document-manager.js';
|
|
38
|
+
import { DefaultSelfSaveRegistry, type SelfSaveRegistry } from './workspace/self-save-registry.js';
|
|
39
|
+
import { DefaultFileSystemTaskQueue, type FileSystemTaskQueue } from '../documents/file-system-task-queue.js';
|
|
40
|
+
import { DefaultModelLedger, type ModelLedger } from '../documents/model-ledger.js';
|
|
41
|
+
import { DefaultDocumentReleaseHandler, type DocumentReleaseHandler } from '../documents/document-release-handler.js';
|
|
42
|
+
import { DefaultVersionSyncService, type VersionSyncService } from '../documents/version-sync-service.js';
|
|
43
|
+
import {
|
|
44
|
+
DefaultEmptyFileSystemProvider,
|
|
45
|
+
DefaultFileSystemProviderRegistry,
|
|
46
|
+
type FileSystemProviderRegistry,
|
|
47
|
+
type WritableFileSystemProvider
|
|
48
|
+
} from './workspace/file-system-provider.js';
|
|
49
|
+
import { VIRTUAL_SCHEME, VirtualFileSystemProvider } from './workspace/virtual-document.js';
|
|
38
50
|
import { type ServerLanguageServices } from './language-module.js';
|
|
39
51
|
import { ExtendedServiceRegistry } from './service-registry.js';
|
|
40
52
|
|
|
@@ -46,7 +58,10 @@ import { ExtendedServiceRegistry } from './service-registry.js';
|
|
|
46
58
|
* these shared services; per-head shared bindings, if any, are
|
|
47
59
|
* contributed by additional modules layered after this one.
|
|
48
60
|
*/
|
|
49
|
-
export interface ServerAddedSharedServices<
|
|
61
|
+
export interface ServerAddedSharedServices<
|
|
62
|
+
TProject extends Project = Project,
|
|
63
|
+
TDiagnostic extends TransferDiagnostic = TransferDiagnostic
|
|
64
|
+
> {
|
|
50
65
|
/**
|
|
51
66
|
* Injectable time source. Framework default is {@link SystemClock} (real
|
|
52
67
|
* `Date.now` / `performance.now` / `setTimeout`); tests bind a fake to
|
|
@@ -154,12 +169,11 @@ export interface ServerAddedSharedServices<TProject extends Project = Project> {
|
|
|
154
169
|
* the `awaitDocumentState` bug-fix, framework-wired phase logs,
|
|
155
170
|
* and the `markNextReason` observability primitive without
|
|
156
171
|
* binding the slot explicitly. The
|
|
157
|
-
* `HydraniumDocumentUpdateHandler`'s `dispatch`
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* compile-time target.
|
|
172
|
+
* `HydraniumDocumentUpdateHandler`'s `dispatch` and
|
|
173
|
+
* `ModelService.rebuild` build through this slot's
|
|
174
|
+
* `scheduleUpdate`, so narrowing here is a load-bearing contract:
|
|
175
|
+
* a builder without it fails every LSP-driven build, and every
|
|
176
|
+
* session write that takes the lock, at run time.
|
|
163
177
|
*/
|
|
164
178
|
/* override */ DocumentBuilder: HydraniumDocumentBuilder;
|
|
165
179
|
/**
|
|
@@ -173,20 +187,36 @@ export interface ServerAddedSharedServices<TProject extends Project = Project> {
|
|
|
173
187
|
*/
|
|
174
188
|
/* override */ WorkspaceLock: HydraniumWorkspaceLock;
|
|
175
189
|
/**
|
|
176
|
-
* Tighten Langium's read-only `FileSystemProvider` slot to
|
|
177
|
-
* {@link
|
|
178
|
-
* ({@link AstDocumentManager.save}, integrity
|
|
179
|
-
* `
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* {@link
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
190
|
+
* Tighten Langium's read-only `FileSystemProvider` slot to a
|
|
191
|
+
* {@link FileSystemProviderRegistry}, which is writable: the
|
|
192
|
+
* framework's save path ({@link AstDocumentManager.save}, integrity
|
|
193
|
+
* corrections, a session's `save`) requires write semantics, and a
|
|
194
|
+
* read-only slot type defers the failure of a read-only
|
|
195
|
+
* implementation to the first save.
|
|
196
|
+
*
|
|
197
|
+
* Bound to {@link DefaultFileSystemProviderRegistry}, which dispatches
|
|
198
|
+
* by scheme to the {@link ServerAddedSharedServices.fileSystemProviders}
|
|
199
|
+
* group and sends every other scheme to its `host`: the provider
|
|
200
|
+
* `context.fileSystemProvider` returns when it is writable, or else
|
|
201
|
+
* `DefaultEmptyFileSystemProvider`, which is what keeps the core
|
|
202
|
+
* barrel free of `node:fs` and therefore browser-bundleable. A Node
|
|
203
|
+
* host passes `@hydranium/core/node`'s Node-backed provider (wired to
|
|
204
|
+
* {@link SelfSaveRegistry}) instead, and adopters pass their own
|
|
187
205
|
* writable implementation when neither fits.
|
|
206
|
+
*
|
|
207
|
+
* To reach the members of its own provider, an adopter declares this
|
|
208
|
+
* slot as `FileSystemProviderRegistry<MyProvider>` through
|
|
209
|
+
* {@link WithServiceOverrides}, binds a
|
|
210
|
+
* `DefaultFileSystemProviderRegistry` with that host from a factory
|
|
211
|
+
* whose return type names the narrowed slot (a module's `DeepPartial`
|
|
212
|
+
* checks no host member otherwise), and reads
|
|
213
|
+
* `FileSystemProvider.host`. A
|
|
214
|
+
* registry that serves a seeded document under none of its providers
|
|
215
|
+
* loses the document at its last close, which
|
|
216
|
+
* {@link HydraniumWorkspaceManager.warnIfDocumentsUnserved} reports
|
|
217
|
+
* once at startup.
|
|
188
218
|
*/
|
|
189
|
-
/* override */ FileSystemProvider:
|
|
219
|
+
/* override */ FileSystemProvider: FileSystemProviderRegistry;
|
|
190
220
|
ProjectManager: ProjectManager<TProject>;
|
|
191
221
|
SelfSaveRegistry: SelfSaveRegistry;
|
|
192
222
|
/**
|
|
@@ -213,9 +243,17 @@ export interface ServerAddedSharedServices<TProject extends Project = Project> {
|
|
|
213
243
|
* there is only one, and `'plaintext'` when there are several, rather
|
|
214
244
|
* than naming a language the document demonstrably is not. Consumers
|
|
215
245
|
* that need to narrow the diagnostic type or override lifecycle
|
|
216
|
-
* behaviour rebind this slot with a subclass.
|
|
246
|
+
* behaviour rebind this slot with a subclass. Subscribes to the build
|
|
247
|
+
* pipeline and the text store in its constructor, so it is eagerly
|
|
248
|
+
* constructed via `DEFAULT_EAGER_SERVICES`.
|
|
249
|
+
*/
|
|
250
|
+
AstDocumentManager: AstDocumentManager<AstNode>;
|
|
251
|
+
/**
|
|
252
|
+
* Orders the server's disk accesses of each file. One slot for every
|
|
253
|
+
* reader and writer: a service given a queue of its own does not order
|
|
254
|
+
* against the others.
|
|
217
255
|
*/
|
|
218
|
-
|
|
256
|
+
FileSystemTaskQueue: FileSystemTaskQueue;
|
|
219
257
|
/**
|
|
220
258
|
* Wires the framework's build-time features (integrity, AST
|
|
221
259
|
* enrichment) into Langium's build pipeline: owns the build-phase
|
|
@@ -230,7 +268,7 @@ export interface ServerAddedSharedServices<TProject extends Project = Project> {
|
|
|
230
268
|
* `onBuildPhase` sibling of the per-node `AstExtensionService`
|
|
231
269
|
* (`onDocumentPhase`) and `IntegrityService`. {@link BuildPipelineIntegration}
|
|
232
270
|
* drives it from its phase listeners; the framework self-registers its
|
|
233
|
-
* integrity
|
|
271
|
+
* integrity and CST-residency passes into it, and adopters
|
|
234
272
|
* contribute via the shared {@link ServerAddedSharedServices.buildPhasePasses}
|
|
235
273
|
* group. A single priority space orders framework and adopter passes
|
|
236
274
|
* against one another deterministically.
|
|
@@ -247,6 +285,16 @@ export interface ServerAddedSharedServices<TProject extends Project = Project> {
|
|
|
247
285
|
* strategy (`shed-closed-when-idle`) to enable shedding.
|
|
248
286
|
*/
|
|
249
287
|
CstResidencyService: CstResidencyService;
|
|
288
|
+
/** The version of the text each root was parsed from. */
|
|
289
|
+
ModelLedger: ModelLedger;
|
|
290
|
+
/** Reconciles each produced root with the store, and owns every build that syncs a root to its text or recovers one. */
|
|
291
|
+
VersionSyncService: VersionSyncService;
|
|
292
|
+
/**
|
|
293
|
+
* What the build keeps for a document {@link HydraniumTextDocuments} has
|
|
294
|
+
* released, for every head. Bound to {@link DefaultDocumentReleaseHandler},
|
|
295
|
+
* which reverts it to disk.
|
|
296
|
+
*/
|
|
297
|
+
DocumentReleaseHandler: DocumentReleaseHandler;
|
|
250
298
|
};
|
|
251
299
|
/**
|
|
252
300
|
* In-process workspace facade ({@link ModelService}) + AST→transfer
|
|
@@ -259,7 +307,7 @@ export interface ServerAddedSharedServices<TProject extends Project = Project> {
|
|
|
259
307
|
* adopter can therefore REPLACE this declaration (see
|
|
260
308
|
* {@link WithServiceOverrides}) rather than intersect with it, which is what
|
|
261
309
|
* keeps slot resolution independent of the order a services type is written
|
|
262
|
-
* in. `ModelService` is
|
|
310
|
+
* in. `ModelService` is an interface for the same reason.
|
|
263
311
|
*
|
|
264
312
|
* A class in a slot costs two things, both measured. Its `protected` members
|
|
265
313
|
* join every assignability check and are compared NOMINALLY, so a subclass
|
|
@@ -270,8 +318,14 @@ export interface ServerAddedSharedServices<TProject extends Project = Project> {
|
|
|
270
318
|
* framework's. Neither survives on an interface.
|
|
271
319
|
*/
|
|
272
320
|
model: {
|
|
273
|
-
TransferEncoder: TransferEncoder
|
|
274
|
-
|
|
321
|
+
TransferEncoder: TransferEncoder<TDiagnostic>;
|
|
322
|
+
/**
|
|
323
|
+
* Subscribes to the settled document phase in its constructor, so it is
|
|
324
|
+
* eagerly constructed via `DEFAULT_EAGER_SERVICES`.
|
|
325
|
+
*/
|
|
326
|
+
ModelService: ModelService<AstNode>;
|
|
327
|
+
/** Builds the handle of every session `ModelService.createSession` starts. */
|
|
328
|
+
ClientSessionFactory: ClientSessionFactory;
|
|
275
329
|
};
|
|
276
330
|
/**
|
|
277
331
|
* Shared contribution group for batch-level build-phase passes (see
|
|
@@ -294,6 +348,15 @@ export interface ServerAddedSharedServices<TProject extends Project = Project> {
|
|
|
294
348
|
* contribute none never touch it.
|
|
295
349
|
*/
|
|
296
350
|
additionalDocuments: Record<string, AdditionalDocumentContribution>;
|
|
351
|
+
/**
|
|
352
|
+
* Shared contribution group of file system providers keyed by the URI
|
|
353
|
+
* scheme each answers for, which {@link FileSystemProviderRegistry}
|
|
354
|
+
* dispatches to. The framework registers {@link VirtualFileSystemProvider}
|
|
355
|
+
* under `virtual`; an adopter deep-merges a provider for a scheme of its
|
|
356
|
+
* own, and an entry under `virtual` replaces the framework's. A scheme with
|
|
357
|
+
* no entry goes to the registry's `host`.
|
|
358
|
+
*/
|
|
359
|
+
fileSystemProviders: Record<string, WritableFileSystemProvider>;
|
|
297
360
|
}
|
|
298
361
|
|
|
299
362
|
/**
|
|
@@ -309,10 +372,18 @@ export interface ServerAddedSharedServices<TProject extends Project = Project> {
|
|
|
309
372
|
* `ClientTextDocumentChangeEvent` payload (with `clientId`);
|
|
310
373
|
* `ServiceRegistry.getServices(uri)` keeps the
|
|
311
374
|
* {@link ServerLanguageServices} return shape.
|
|
375
|
+
*
|
|
376
|
+
* `TDiagnostic` is the diagnostic the bound `model.TransferEncoder` emits. A
|
|
377
|
+
* head that sends a narrower diagnostic than `TransferDiagnostic` takes
|
|
378
|
+
* services typed with it, so none of its envelopes claims a shape the encoder
|
|
379
|
+
* does not produce.
|
|
312
380
|
*/
|
|
313
|
-
export type ServerSharedServices<TProject extends Project = Project
|
|
381
|
+
export type ServerSharedServices<TProject extends Project = Project, TDiagnostic extends TransferDiagnostic = TransferDiagnostic> = Omit<
|
|
382
|
+
LangiumSharedServices,
|
|
383
|
+
'workspace' | 'ServiceRegistry'
|
|
384
|
+
> & {
|
|
314
385
|
workspace: Omit<LangiumSharedServices['workspace'], 'TextDocuments' | 'DocumentBuilder'>;
|
|
315
|
-
} & ServerAddedSharedServices<TProject>;
|
|
386
|
+
} & ServerAddedSharedServices<TProject, TDiagnostic>;
|
|
316
387
|
|
|
317
388
|
/**
|
|
318
389
|
* The service-tree namespaces — the keys whose value groups further slots
|
|
@@ -464,9 +535,13 @@ export function createServerSharedModule(
|
|
|
464
535
|
TextDocuments: services => new HydraniumTextDocuments(services),
|
|
465
536
|
WorkspaceManager: services => new HydraniumWorkspaceManager(services),
|
|
466
537
|
IndexManager: services => new HydraniumIndexManager(services),
|
|
538
|
+
// Langium's default asks only about sections named after registered
|
|
539
|
+
// language ids, so a section `lsp.configurationRoot` is bound to reads
|
|
540
|
+
// `undefined` forever with no request on the wire.
|
|
541
|
+
ConfigurationProvider: services => new HydraniumConfigurationProvider(services),
|
|
467
542
|
// Override Langium's factory so a `fromModel` (code-built) virtual
|
|
468
543
|
// document retains serialized text via the per-language Serializer,
|
|
469
|
-
// making it re-read-safe through
|
|
544
|
+
// making it re-read-safe through `VirtualFileSystemProvider`.
|
|
470
545
|
LangiumDocumentFactory: services => new HydraniumLangiumDocumentFactory(services),
|
|
471
546
|
// Langium's default routes through no identity seam and treats every
|
|
472
547
|
// failed load alike, so leaving this unbound opts a server out of both
|
|
@@ -475,52 +550,53 @@ export function createServerSharedModule(
|
|
|
475
550
|
DocumentBuilder: services => new HydraniumDocumentBuilder(services),
|
|
476
551
|
// The write-lock scope this marks is inert unless a host installs a
|
|
477
552
|
// scope tracker — `@hydranium/core/node` does.
|
|
478
|
-
WorkspaceLock:
|
|
553
|
+
WorkspaceLock: services => new HydraniumWorkspaceLock(services),
|
|
479
554
|
ProjectManager: services => new SingleProjectManager(services),
|
|
480
555
|
SelfSaveRegistry: services => new DefaultSelfSaveRegistry(services),
|
|
481
556
|
DocumentUriPolicy: () => new DefaultDocumentUriPolicy(),
|
|
482
|
-
//
|
|
483
|
-
//
|
|
484
|
-
//
|
|
485
|
-
//
|
|
486
|
-
// (in-memory, browser, test stub like `DefaultEmptyFileSystemProvider`).
|
|
487
|
-
// - Otherwise — the portable default `DefaultEmptyFileSystemProvider`
|
|
488
|
-
// (no-op writes, no disk access). Node hosts opt into real disk I/O
|
|
489
|
-
// by binding `@hydranium/core/node`'s `DefaultFileSystemProvider`
|
|
490
|
-
// (Node-backed, wired to `SelfSaveRegistry` so framework `writeFile`
|
|
491
|
-
// calls register their mtime and adopters can suppress the
|
|
492
|
-
// `didChangeWatchedFiles` echo) — typically via this same
|
|
493
|
-
// `context.fileSystemProvider` channel or by rebinding
|
|
494
|
-
// the slot. Keeping the `.`-entry default empty is what lets the
|
|
495
|
-
// core barrel stay free of `node:fs` (browser-bundleable); see the
|
|
496
|
-
// `@hydranium/core/node` carve.
|
|
557
|
+
// The host is the provider `context.fileSystemProvider` returns
|
|
558
|
+
// when it is writable (has `writeFile`); anything narrower gets the
|
|
559
|
+
// empty provider, which is what keeps the core barrel free of
|
|
560
|
+
// `node:fs`.
|
|
497
561
|
FileSystemProvider: services => {
|
|
498
562
|
const fromContext = context.fileSystemProvider?.(services);
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
563
|
+
const writable = typeof (fromContext as Partial<WritableFileSystemProvider> | undefined)?.writeFile === 'function';
|
|
564
|
+
return new DefaultFileSystemProviderRegistry(services, {
|
|
565
|
+
host: writable ? (fromContext as WritableFileSystemProvider) : new DefaultEmptyFileSystemProvider(services)
|
|
566
|
+
});
|
|
503
567
|
},
|
|
568
|
+
// Eagerly constructed, so its build-pipeline and text-store listeners
|
|
569
|
+
// attach before the first build.
|
|
504
570
|
AstDocumentManager: services => new DefaultAstDocumentManager(services),
|
|
571
|
+
FileSystemTaskQueue: services => new DefaultFileSystemTaskQueue(services),
|
|
505
572
|
// Eagerly constructed, so its build-phase listeners attach before the
|
|
506
573
|
// first build.
|
|
507
574
|
BuildPipelineIntegration: services => new DefaultBuildPipelineIntegration(services),
|
|
508
575
|
BuildPhasePassService: services => new DefaultBuildPhasePassService(services),
|
|
509
576
|
// Eagerly constructed, so its `Validated` pass registers before the
|
|
510
577
|
// first build.
|
|
511
|
-
CstResidencyService: services => new DefaultCstResidencyService(services)
|
|
578
|
+
CstResidencyService: services => new DefaultCstResidencyService(services),
|
|
579
|
+
ModelLedger: () => new DefaultModelLedger(),
|
|
580
|
+
VersionSyncService: services => new DefaultVersionSyncService(services),
|
|
581
|
+
DocumentReleaseHandler: services => new DefaultDocumentReleaseHandler(services)
|
|
512
582
|
},
|
|
513
583
|
model: {
|
|
514
584
|
// Generic walker — adopters with a typed `$type → wire shape` overlay
|
|
515
585
|
// rebind this slot with a subclass.
|
|
516
586
|
TransferEncoder: services => new DefaultTransferEncoder(services),
|
|
517
|
-
|
|
587
|
+
// Eagerly constructed, so its settled-phase listener attaches before
|
|
588
|
+
// the first build.
|
|
589
|
+
ModelService: services => new DefaultModelService(services),
|
|
590
|
+
ClientSessionFactory: services => new DefaultClientSessionFactory(services)
|
|
518
591
|
},
|
|
519
592
|
// Empty default so `services.buildPhasePasses` always resolves (Langium
|
|
520
593
|
// throws on access to an unbound slot). The framework's own integrity /
|
|
521
|
-
//
|
|
594
|
+
// CST-residency passes self-register imperatively, not here.
|
|
522
595
|
buildPhasePasses: {},
|
|
523
596
|
// Empty default so `services.additionalDocuments` always resolves.
|
|
524
|
-
additionalDocuments: {}
|
|
597
|
+
additionalDocuments: {},
|
|
598
|
+
fileSystemProviders: {
|
|
599
|
+
[VIRTUAL_SCHEME]: services => new VirtualFileSystemProvider(services)
|
|
600
|
+
}
|
|
525
601
|
};
|
|
526
602
|
}
|
|
@@ -221,6 +221,11 @@ export interface NameProvider extends LangiumNameProvider {
|
|
|
221
221
|
* walk traverses through the document root: if the root has its own
|
|
222
222
|
* name, that name IS part of the qualified form. Adopters who want a
|
|
223
223
|
* different boundary override this method.
|
|
224
|
+
*
|
|
225
|
+
* May answer as of its first read since the last build: the default
|
|
226
|
+
* memoises per built node, so a name changed in memory after that read
|
|
227
|
+
* reads as the old one until its document rebuilds. A node in no document
|
|
228
|
+
* is named afresh on every call.
|
|
224
229
|
*/
|
|
225
230
|
getDocumentQualifiedName(node?: AstNode): string | undefined;
|
|
226
231
|
|
|
@@ -236,6 +241,10 @@ export interface NameProvider extends LangiumNameProvider {
|
|
|
236
241
|
* string) or no project owns the URI — in those cases project-
|
|
237
242
|
* qualified equals document-qualified, and
|
|
238
243
|
* `HydraniumScopeComputation` skips the multi-tier emit.
|
|
244
|
+
*
|
|
245
|
+
* The default memoises it as it does {@link getDocumentQualifiedName}, and
|
|
246
|
+
* for a node in no document answers the document-qualified name: there is
|
|
247
|
+
* no project to prefix.
|
|
239
248
|
*/
|
|
240
249
|
getProjectQualifiedName(node?: AstNode): string | undefined;
|
|
241
250
|
|
|
@@ -254,10 +263,21 @@ export interface NameProvider extends LangiumNameProvider {
|
|
|
254
263
|
/**
|
|
255
264
|
* Find a unique name for a new node within `container`, using `base`
|
|
256
265
|
* as a stem. Walks the AST subtree rooted at `container` and avoids
|
|
257
|
-
* names already
|
|
258
|
-
* generates `${base}1`,
|
|
259
|
-
* found. Used by create-element
|
|
260
|
-
* uniqueness scope is one AST subtree.
|
|
266
|
+
* names already held there by nodes of `type` or of any subtype of it,
|
|
267
|
+
* as `AstReflection.isSubtype` reports. Default generates `${base}1`,
|
|
268
|
+
* `${base}2`, ... until an unused value is found. Used by create-element
|
|
269
|
+
* operation handlers when the uniqueness scope is one AST subtree.
|
|
270
|
+
*
|
|
271
|
+
* Subtype-closed rather than `$type`-exact, because a name space shared by
|
|
272
|
+
* several concrete types is named by their common supertype and by no
|
|
273
|
+
* concrete type at all — the shape a cross-reference whose target type is
|
|
274
|
+
* that supertype produces. An exact filter finds no collisions for such a
|
|
275
|
+
* call and returns the proposal unchanged, which a caller cannot tell from
|
|
276
|
+
* a name that was genuinely free.
|
|
277
|
+
* {@link NameProvider.findNextDocumentQualifiedName} and
|
|
278
|
+
* {@link NameProvider.findNextProjectQualifiedName} resolve `type` the same
|
|
279
|
+
* way, through `IndexManager.allElements`, so one type argument does not
|
|
280
|
+
* mean different sets at different tiers.
|
|
261
281
|
*/
|
|
262
282
|
findNextName(type: string, base: string, container: AstNode): string;
|
|
263
283
|
|
|
@@ -315,6 +335,9 @@ export class DefaultNameProvider implements NameProvider {
|
|
|
315
335
|
* document's lifetime. Evicted automatically when Langium rebuilds
|
|
316
336
|
* the document.
|
|
317
337
|
*
|
|
338
|
+
* So a built node renamed in memory reads its old name until the rebuild,
|
|
339
|
+
* as {@link NameProvider.getDocumentQualifiedName} warns.
|
|
340
|
+
*
|
|
318
341
|
* Only cached when the computed result is a defined string — `undefined`
|
|
319
342
|
* results re-evaluate on each call (cheap path: `getOwnName` returns
|
|
320
343
|
* undefined for unnamed nodes, no chain walk needed).
|
|
@@ -323,7 +346,9 @@ export class DefaultNameProvider implements NameProvider {
|
|
|
323
346
|
/**
|
|
324
347
|
* Per-document memo for {@link getProjectQualifiedName} results.
|
|
325
348
|
* Sibling of {@link documentQualifiedNameCache}; covers the additional
|
|
326
|
-
* project-reference-name lookup the project-qualified variant performs
|
|
349
|
+
* project-reference-name lookup the project-qualified variant performs,
|
|
350
|
+
* and goes stale on an in-memory rename the same way, as
|
|
351
|
+
* {@link NameProvider.getDocumentQualifiedName} warns.
|
|
327
352
|
*
|
|
328
353
|
* **Project-rename caveat.** If `Project.referenceName` mutates without
|
|
329
354
|
* a corresponding document rebuild, cached entries become stale. Adopters
|
|
@@ -460,8 +485,8 @@ export class DefaultNameProvider implements NameProvider {
|
|
|
460
485
|
* qualified names.
|
|
461
486
|
*
|
|
462
487
|
* **Within-document references stay keyed by bare names** via
|
|
463
|
-
* `HydraniumScopeComputation.
|
|
464
|
-
* {@link getOwnName} when populating the local-symbols map (bypassing
|
|
488
|
+
* `HydraniumScopeComputation.addLocalSymbolByOwnName`, which explicitly
|
|
489
|
+
* calls {@link getOwnName} when populating the local-symbols map (bypassing
|
|
465
490
|
* Langium's default that goes through this `getName`). The
|
|
466
491
|
* separation lets `getName` carry the workspace-unique form for the
|
|
467
492
|
* linker without forcing qualified names into the per-document
|
|
@@ -496,8 +521,9 @@ export class DefaultNameProvider implements NameProvider {
|
|
|
496
521
|
|
|
497
522
|
findNextName(type: string, base: string, container: AstNode): string {
|
|
498
523
|
const proposal = base.replaceAll(this.nameSeparator, '_');
|
|
524
|
+
const reflection = this.services.shared.AstReflection;
|
|
499
525
|
const knownNames = AstUtils.streamAst(container)
|
|
500
|
-
.filter(node => node.$type
|
|
526
|
+
.filter(node => reflection.isSubtype(node.$type, type))
|
|
501
527
|
.map(node => this.getOwnName(node))
|
|
502
528
|
.nonNullable()
|
|
503
529
|
.toArray();
|
|
@@ -7,18 +7,19 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { Deferred, type Project, type Tracer, UNQUALIFIED_PROJECT_REFERENCE } from '@hydranium/protocol';
|
|
10
|
+
import { Deferred, type Project, type Tracer, UNQUALIFIED_PROJECT_REFERENCE, describeErrorWithStack } from '@hydranium/protocol';
|
|
11
11
|
import {
|
|
12
12
|
type AstNode,
|
|
13
13
|
AstUtils,
|
|
14
14
|
type DocumentBuilder,
|
|
15
|
+
DocumentState,
|
|
15
16
|
type FileSystemProvider,
|
|
16
17
|
type LangiumDocument,
|
|
17
18
|
type LangiumDocuments,
|
|
18
19
|
type URI,
|
|
19
20
|
UriUtils
|
|
20
21
|
} from '@hydranium/langium';
|
|
21
|
-
import { Disposable } from 'vscode-languageserver';
|
|
22
|
+
import { CancellationToken, Disposable } from 'vscode-languageserver';
|
|
22
23
|
import type { WorkspaceFolder } from 'vscode-languageserver-types';
|
|
23
24
|
import type { LogNameOptions } from '../diagnostics/logger.js';
|
|
24
25
|
import { type ServerSharedServicesMinimal } from '../shared-services.js';
|
|
@@ -225,7 +226,7 @@ export abstract class AbstractProjectManager<TProject extends Project = Project>
|
|
|
225
226
|
try {
|
|
226
227
|
entries = await this.fileSystemProvider.readDirectory(folder);
|
|
227
228
|
} catch (error) {
|
|
228
|
-
this.tracer.warn(`Failed to read directory ${folder.toString()}: ${error}`);
|
|
229
|
+
this.tracer.warn(`Failed to read directory ${folder.toString()}: ${describeErrorWithStack(error)}`);
|
|
229
230
|
return;
|
|
230
231
|
}
|
|
231
232
|
for (const entry of entries) {
|
|
@@ -377,6 +378,13 @@ export abstract class AbstractProjectManager<TProject extends Project = Project>
|
|
|
377
378
|
protected async loadDescriptor(uri: URI): Promise<TProject | undefined> {
|
|
378
379
|
try {
|
|
379
380
|
const document = await this.langiumDocuments.getOrCreateDocument(uri);
|
|
381
|
+
if (document.state < DocumentState.Parsed) {
|
|
382
|
+
// `onUpdate` fires before the build parses, so the AST is still the previous edit's.
|
|
383
|
+
// The state is restored so the build still runs, and notifies, its own parse phase.
|
|
384
|
+
const state = document.state;
|
|
385
|
+
await this.services.workspace.LangiumDocumentFactory.update(document, CancellationToken.None);
|
|
386
|
+
document.state = state;
|
|
387
|
+
}
|
|
380
388
|
const project = await this.parseProjectDescriptor(uri, document);
|
|
381
389
|
if (project) {
|
|
382
390
|
this.projects.set(project.id, project);
|
|
@@ -387,7 +395,7 @@ export abstract class AbstractProjectManager<TProject extends Project = Project>
|
|
|
387
395
|
}
|
|
388
396
|
return project;
|
|
389
397
|
} catch (error) {
|
|
390
|
-
this.tracer.error(`Failed to parse ${this.conceptName()} descriptor at ${uri.toString()}: ${error}`);
|
|
398
|
+
this.tracer.error(`Failed to parse ${this.conceptName()} descriptor at ${uri.toString()}: ${describeErrorWithStack(error)}`);
|
|
391
399
|
return undefined;
|
|
392
400
|
}
|
|
393
401
|
}
|
|
@@ -612,7 +620,7 @@ export abstract class AbstractProjectManager<TProject extends Project = Project>
|
|
|
612
620
|
try {
|
|
613
621
|
listener(event);
|
|
614
622
|
} catch (error) {
|
|
615
|
-
this.tracer.error(`Project change listener failed: ${error}`);
|
|
623
|
+
this.tracer.error(`Project change listener failed: ${describeErrorWithStack(error)}`);
|
|
616
624
|
}
|
|
617
625
|
}
|
|
618
626
|
}
|
|
@@ -28,8 +28,8 @@ import type { URI } from '@hydranium/langium';
|
|
|
28
28
|
* - {@link affectedDocuments} lists URIs whose reachable scope changed. The
|
|
29
29
|
* default cascade plumbing in `HydraniumWorkspaceManager` subscribes to
|
|
30
30
|
* this event and re-runs `DocumentBuilder.resetToState` for each entry,
|
|
31
|
-
* which the
|
|
32
|
-
* independently for other reactions.
|
|
31
|
+
* which the build of the update that changed the descriptor picks up.
|
|
32
|
+
* Consumers can subscribe independently for other reactions.
|
|
33
33
|
*/
|
|
34
34
|
export interface ProjectChangeEvent<TProject extends Project = Project> {
|
|
35
35
|
/** Ids of projects newly registered since the last event. */
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { asMutable, type Clock, Debouncer, Format, type Tracer } from '@hydranium/protocol';
|
|
10
|
+
import { asMutable, type Clock, Debouncer, Format, type Tracer, UNRECORDED_VERSION } from '@hydranium/protocol';
|
|
11
11
|
import {
|
|
12
12
|
type AstNode,
|
|
13
13
|
AstUtils,
|
|
@@ -45,8 +45,11 @@ export const CST_RESIDENCY_PASS_PRIORITY = 1_000_000;
|
|
|
45
45
|
* "off" toggle.
|
|
46
46
|
* - `{ kind: 'shed-closed-when-idle', idleMs }`: shed a closed document's CST
|
|
47
47
|
* once it has been idle (not in any build) for `idleMs`, keeping the AST
|
|
48
|
-
* resident. Open documents are always kept.
|
|
49
|
-
* document
|
|
48
|
+
* resident. Open documents are always kept. The timer starts when a build
|
|
49
|
+
* includes the document, so `idleMs: 0` sheds a closed document on the tick
|
|
50
|
+
* after each such build. A shed document that re-enters a build is re-parsed
|
|
51
|
+
* in full, so a window shorter than the gap between a document's builds
|
|
52
|
+
* re-parses a closed document on every build it rides in.
|
|
50
53
|
*/
|
|
51
54
|
export type CstResidencyStrategy = { readonly kind: 'always-keep' } | { readonly kind: 'shed-closed-when-idle'; readonly idleMs: number };
|
|
52
55
|
|
|
@@ -185,12 +188,16 @@ function rehydrateCst(document: LangiumDocument, factory: LangiumDocumentFactory
|
|
|
185
188
|
}
|
|
186
189
|
|
|
187
190
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
191
|
+
* Keeps a document's CST available to the readers that need one, shedding it
|
|
192
|
+
* for documents that have gone idle and re-grafting on demand.
|
|
193
|
+
*
|
|
194
|
+
* Each build refreshes
|
|
190
195
|
* the idle window of the documents in its batch; when a closed, sheddable
|
|
191
196
|
* document's window elapses, every AST node's `$cstNode` and every reference's
|
|
192
|
-
* `$refNode` are nulled, and the CST
|
|
193
|
-
*
|
|
197
|
+
* `$refNode` are nulled, and the CST becomes unreachable with the `Range`s
|
|
198
|
+
* and `Position`s only it holds. The reference index's segments, and a
|
|
199
|
+
* description's segments once read, share the CST's `Range` objects, so
|
|
200
|
+
* those stay.
|
|
194
201
|
*
|
|
195
202
|
* **Terminology.** *Residency* is the state axis (is the CST in memory? —
|
|
196
203
|
* `resident` vs `shed`); *shed* is both the act and the policy vocabulary (drop
|
|
@@ -231,10 +238,6 @@ function rehydrateCst(document: LangiumDocument, factory: LangiumDocumentFactory
|
|
|
231
238
|
* `NameProvider.getNameNode` chokepoint, the comment provider, and
|
|
232
239
|
* `HydraniumLangiumDocuments.getOrCreateDocument`.
|
|
233
240
|
*/
|
|
234
|
-
/**
|
|
235
|
-
* Keeps a document's CST available to the readers that need one, shedding it
|
|
236
|
-
* for documents that have gone idle and re-grafting on demand.
|
|
237
|
-
*/
|
|
238
241
|
export interface CstResidencyService {
|
|
239
242
|
/**
|
|
240
243
|
* Ensure `document` has a CST, re-parsing its retained text if it was shed.
|
|
@@ -246,7 +249,8 @@ export interface CstResidencyService {
|
|
|
246
249
|
/**
|
|
247
250
|
* Node-level convenience over {@link rehydrate}, cheap enough for an
|
|
248
251
|
* unconditional call: a node whose `$cstNode` is already set returns
|
|
249
|
-
* without resolving its document
|
|
252
|
+
* without resolving its document, and a node outside any document, such as
|
|
253
|
+
* a detached synthetic node, has nothing to restore and returns too.
|
|
250
254
|
*/
|
|
251
255
|
rehydrateNode(node: AstNode): void;
|
|
252
256
|
}
|
|
@@ -281,7 +285,7 @@ export class DefaultCstResidencyService implements CstResidencyService {
|
|
|
281
285
|
this.langiumDocs = services.workspace.LangiumDocuments;
|
|
282
286
|
services.workspace.BuildPhasePassService.register({
|
|
283
287
|
id: 'framework:cst-residency:shed',
|
|
284
|
-
|
|
288
|
+
phase: DocumentState.Validated,
|
|
285
289
|
priority: options.priority ?? CST_RESIDENCY_PASS_PRIORITY,
|
|
286
290
|
run: documents => this.onBuild(documents)
|
|
287
291
|
});
|
|
@@ -315,7 +319,10 @@ export class DefaultCstResidencyService implements CstResidencyService {
|
|
|
315
319
|
if (node.$cstNode !== undefined) {
|
|
316
320
|
return;
|
|
317
321
|
}
|
|
318
|
-
|
|
322
|
+
const document = AstUtils.findRootNode(node).$document;
|
|
323
|
+
if (document) {
|
|
324
|
+
this.rehydrate(document);
|
|
325
|
+
}
|
|
319
326
|
}
|
|
320
327
|
|
|
321
328
|
/**
|
|
@@ -407,6 +414,15 @@ export class DefaultCstResidencyService implements CstResidencyService {
|
|
|
407
414
|
if (root === undefined || root.$cstNode === undefined) {
|
|
408
415
|
return 0;
|
|
409
416
|
}
|
|
417
|
+
// Readers of the parsed text, the `'text-diagnostics'` fingerprint among
|
|
418
|
+
// them, otherwise see none once the CST is gone. Recorded in the ledger
|
|
419
|
+
// directly: no root is produced, and reconciling it with the store would
|
|
420
|
+
// step a closed document's sequence for a root behind its text.
|
|
421
|
+
const ledger = this.services.workspace.ModelLedger;
|
|
422
|
+
const version = ledger.versionOf(root);
|
|
423
|
+
if (version !== UNRECORDED_VERSION) {
|
|
424
|
+
ledger.record(root, version, ledger.textOf(root));
|
|
425
|
+
}
|
|
410
426
|
let cleared = 0;
|
|
411
427
|
for (const node of AstUtils.streamAst(root)) {
|
|
412
428
|
if (node.$cstNode) {
|