@hydranium/core 1.0.0-next.39 → 1.0.0-next.390
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 -128
- 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 +40 -0
- package/lib/documents/file-system-task-queue.js.map +1 -0
- package/lib/documents/hydranium-text-documents.d.ts +453 -282
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
- package/lib/documents/hydranium-text-documents.js +918 -504
- 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 +153 -0
- package/lib/documents/version-sync-service.d.ts.map +1 -0
- package/lib/documents/version-sync-service.js +186 -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 +390 -40
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
- package/lib/langium/document-builder/document-builder.js +635 -102
- 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 +20 -23
- package/lib/langium/integration-services.d.ts.map +1 -1
- package/lib/langium/integration-services.js.map +1 -1
- package/lib/langium/integrity/integrity-rule.d.ts +22 -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 +217 -29
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-service.js +588 -84
- 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 +405 -0
- package/lib/langium/model-service/client-session.d.ts.map +1 -0
- package/lib/langium/model-service/client-session.js +479 -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 +441 -323
- package/lib/langium/model-service/model-service.d.ts.map +1 -1
- package/lib/langium/model-service/model-service.js +602 -407
- package/lib/langium/model-service/model-service.js.map +1 -1
- package/lib/langium/module.d.ts +96 -37
- package/lib/langium/module.d.ts.map +1 -1
- package/lib/langium/module.js +41 -29
- 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 +184 -13
- package/lib/langium/project/abstract-project-manager.d.ts.map +1 -1
- package/lib/langium/project/abstract-project-manager.js +336 -16
- package/lib/langium/project/abstract-project-manager.js.map +1 -1
- package/lib/langium/project/project-change-event.d.ts +22 -3
- package/lib/langium/project/project-change-event.d.ts.map +1 -1
- package/lib/langium/project/project-manager.d.ts +28 -2
- package/lib/langium/project/project-manager.d.ts.map +1 -1
- package/lib/langium/project/single-project-manager.d.ts +7 -1
- package/lib/langium/project/single-project-manager.d.ts.map +1 -1
- package/lib/langium/project/single-project-manager.js +12 -0
- package/lib/langium/project/single-project-manager.js.map +1 -1
- package/lib/langium/residency/cst-residency-service.d.ts +92 -52
- package/lib/langium/residency/cst-residency-service.d.ts.map +1 -1
- package/lib/langium/residency/cst-residency-service.js +154 -58
- 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 +1165 -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 +78 -4
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.js +188 -5
- package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts +50 -1
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-lock.js +73 -1
- package/lib/langium/workspace/hydranium-workspace-lock.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts +105 -21
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.js +186 -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 +3 -0
- package/lib/langium/workspace/index.d.ts.map +1 -1
- package/lib/langium/workspace/index.js +3 -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/syntax-errors.d.ts +23 -0
- package/lib/langium/workspace/syntax-errors.d.ts.map +1 -0
- package/lib/langium/workspace/syntax-errors.js +29 -0
- package/lib/langium/workspace/syntax-errors.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 +3 -2
- 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.d.ts +6 -5
- package/lib/node/server-state-snapshot.d.ts.map +1 -1
- package/lib/node/server-state-snapshot.js +20 -17
- 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 +4 -1
- package/lib/testing/node/index.d.ts.map +1 -1
- package/lib/testing/node/index.js +4 -1
- 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 +2 -1
- package/lib/testing/node/scratch-workspace.d.ts.map +1 -1
- package/lib/testing/node/scratch-workspace.js +12 -6
- package/lib/testing/node/scratch-workspace.js.map +1 -1
- package/lib/testing/node/settle-server.d.ts +33 -0
- package/lib/testing/node/settle-server.d.ts.map +1 -0
- package/lib/testing/node/settle-server.js +84 -0
- package/lib/testing/node/settle-server.js.map +1 -0
- 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/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 +25 -11
- package/lib/testing/stub-document-builder.d.ts.map +1 -1
- package/lib/testing/stub-document-builder.js +91 -2
- 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.d.ts.map +1 -1
- package/lib/testing/stub-project-manager.js +10 -0
- 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 -250
- package/src/documents/client-ids.ts +5 -22
- package/src/documents/client-session-errors.ts +26 -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 +77 -0
- package/src/documents/hydranium-text-documents.ts +1044 -615
- 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 +304 -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 +773 -106
- package/src/langium/integration-services.ts +20 -23
- package/src/langium/integrity/integrity-rule.ts +22 -8
- package/src/langium/integrity/integrity-service.ts +656 -90
- 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 +769 -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 +885 -532
- package/src/langium/module.ts +141 -65
- package/src/langium/naming/name-provider.ts +34 -8
- package/src/langium/project/abstract-project-manager.ts +409 -20
- package/src/langium/project/project-change-event.ts +25 -3
- package/src/langium/project/project-manager.ts +31 -2
- package/src/langium/project/single-project-manager.ts +16 -1
- package/src/langium/residency/cst-residency-service.ts +210 -87
- 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 +1410 -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 +239 -4
- package/src/langium/workspace/hydranium-workspace-lock.ts +101 -2
- package/src/langium/workspace/hydranium-workspace-manager.ts +214 -35
- package/src/langium/workspace/in-memory-file-system-provider.ts +54 -23
- package/src/langium/workspace/index.ts +3 -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/syntax-errors.ts +34 -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/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 +3 -4
- 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 +28 -20
- 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 +4 -1
- 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 +12 -6
- package/src/testing/node/settle-server.ts +89 -0
- package/src/testing/node/spawned-server.ts +57 -3
- 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 +128 -15
- 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-project-manager.ts +10 -0
- 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 -124
- package/lib/documents/language-client-text-shadow.d.ts.map +0 -1
- package/lib/documents/language-client-text-shadow.js +0 -190
- 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 -211
- package/src/lsp/instrument-connection.ts +0 -66
- package/src/node/process-memory.ts +0 -299
|
@@ -6,13 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
-
import { type CanonicalUri, type
|
|
9
|
+
import { type CanonicalUri, type MaybeObservableValue, type MaybePromise, ObservableValue, type TransferElement, type TextVersion, type Tracer } from '@hydranium/protocol';
|
|
10
10
|
import { type AstNode, DocumentState, type LangiumDocument, type URI } from '@hydranium/langium';
|
|
11
|
+
import { type AstDiagnostic } from '../validation/document-validator.js';
|
|
11
12
|
import { type DocumentUriPolicy } from '../workspace/document-uri-policy.js';
|
|
12
|
-
import {
|
|
13
|
-
import { AstDocument
|
|
13
|
+
import { CancellationToken, Disposable } from 'vscode-languageserver';
|
|
14
|
+
import { AstDocument } from '../../documents/ast-document-manager.js';
|
|
14
15
|
import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
16
|
+
import { type OpenOptions } from '../../documents/client-session-registry.js';
|
|
15
17
|
import { type ServerSharedServices } from '../module.js';
|
|
18
|
+
import { type ClientSession } from './client-session.js';
|
|
19
|
+
import { type ModelDeletedEvent, type ModelDirtyChangedEvent, type ModelEventFilter, type ModelPhaseFilter, type ModelReleasedEvent, type ModelSavedEvent, type ModelsBuiltEvent, type ModelUpdatedEvent } from './model-events.js';
|
|
16
20
|
/**
|
|
17
21
|
* The undo-stack entry for a server-authored write pushed to the editor.
|
|
18
22
|
*
|
|
@@ -35,74 +39,78 @@ export declare const MODEL_UPDATE_EDIT: import("@hydranium/protocol").MessageDef
|
|
|
35
39
|
*/
|
|
36
40
|
export interface ModelServiceOptions extends LogNameOptions {
|
|
37
41
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* `
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
* Langium's `DefaultDocumentUpdateHandler` dispatches its build. Default
|
|
63
|
-
* `true`.
|
|
64
|
-
*
|
|
65
|
-
* **Why it defaults on.** Unlocked, the facade's build races the LSP bridge's
|
|
66
|
-
* build of the same URI — both are legitimate (the bridge exists only under a
|
|
67
|
-
* `Connection`, so the facade stands in for it headless), but nothing
|
|
68
|
-
* serialises them, so both run a full validation pass and Langium appends the
|
|
69
|
-
* second onto the first. Every diagnostic is then duplicated, and the
|
|
70
|
-
* duplication compounds per rebuild. Serialised, Langium elides the second
|
|
71
|
-
* build entirely, so the redundant work goes too.
|
|
72
|
-
*
|
|
73
|
-
* **What `false` costs.** The facade's build is then unserialised and can run
|
|
74
|
-
* concurrently with the bridge's build of the same URI, so the affected
|
|
75
|
-
* documents are validated twice per write — double the validation work.
|
|
76
|
-
* Reported diagnostics stay correct even then, because
|
|
77
|
-
* `HydraniumDocumentBuilder.dedupeDiagnostics` collapses the byte-identical
|
|
78
|
-
* duplicates a repeated pass produces before any listener sees them; what this
|
|
79
|
-
* option removes is the wasted pass, not just its visible symptom.
|
|
80
|
-
*
|
|
81
|
-
* **What `false` buys.** `WorkspaceLock` is not reentrant. A caller that
|
|
82
|
-
* reaches `update` / `save` / `rebuild` while already holding the write lock —
|
|
83
|
-
* an integrity rule or build-phase pass that writes through this facade —
|
|
84
|
-
* deadlocks: acquiring the lock cancels the running holder, and the new
|
|
85
|
-
* acquisition then waits for that holder to release while the holder waits
|
|
86
|
-
* for this call. On `true` that shape is DETECTED and rejected with
|
|
87
|
-
* {@link ReentrantWriteLockError} rather than hanging, wherever a host
|
|
88
|
-
* installs a write-lock scope tracker (`@hydranium/core/node` does at entry
|
|
89
|
-
* load; see {@link isInsideWriteLock}). Setting `false` is the escape hatch
|
|
90
|
-
* for an adopter whose reentrant shape is unavoidable — nothing acquires the
|
|
91
|
-
* lock then, so there is nothing to be reentrant about; prefer it over
|
|
92
|
-
* unserialised builds only in that case.
|
|
42
|
+
* Let the facade's build run without the workspace write lock when its
|
|
43
|
+
* caller already holds it: an integrity rule or build-phase pass that
|
|
44
|
+
* writes back through a session's `update` / `save`, or calls `rebuild`.
|
|
45
|
+
* Default `false`.
|
|
46
|
+
*
|
|
47
|
+
* `WorkspaceLock` is not reentrant. Taking it from inside a holder cancels
|
|
48
|
+
* that holder and then waits for it to end, while the holder waits for this
|
|
49
|
+
* call, so neither completes. On `false` that call fails with
|
|
50
|
+
* {@link ReentrantWriteLockError} instead, wherever a host installs a
|
|
51
|
+
* write-lock scope tracker (`@hydranium/core/node` does at entry load); on
|
|
52
|
+
* `true` its build takes no lock. The wait after that build can still hang,
|
|
53
|
+
* because a document no build will carry is re-queued through the lock, and
|
|
54
|
+
* the re-queue waits for the holder to end.
|
|
55
|
+
*
|
|
56
|
+
* A session's delete is refused that way on either value, since its builds
|
|
57
|
+
* always take the lock.
|
|
58
|
+
*
|
|
59
|
+
* Every other facade build takes the lock on either value. Unlocked, it can
|
|
60
|
+
* overlap another build of the same document: both run a full validation
|
|
61
|
+
* pass that Langium appends, and a caller can be handed a version that an
|
|
62
|
+
* integrity repair still running in the other build then moves past. Without
|
|
63
|
+
* a tracker the two cases cannot be told apart (see
|
|
64
|
+
* {@link isWriteLockScopeInstalled}), so `true` builds without the lock every
|
|
65
|
+
* time and accepts both.
|
|
93
66
|
*
|
|
94
67
|
* Accepts a {@link MaybeObservableValue} so it can be bound to a setting and
|
|
95
68
|
* flipped without a restart.
|
|
96
69
|
*/
|
|
97
|
-
readonly
|
|
70
|
+
readonly allowReentrantBuilds?: MaybeObservableValue<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* Let a structured write keep the text the document's root was parsed from
|
|
73
|
+
* when that text serializes to the same text as the written model, so an
|
|
74
|
+
* update that changes nothing in the model leaves hand formatting alone.
|
|
75
|
+
* Default `false`: every structured write applies the canonical text.
|
|
76
|
+
*
|
|
77
|
+
* Costs a parse, an encode and a serialization per write whose text
|
|
78
|
+
* differs; remembering the text last written instead would not cover a
|
|
79
|
+
* file formatted outside the framework. Text with lexer or parser errors is
|
|
80
|
+
* replaced as usual by {@link ModelService.modelToText}, though a session
|
|
81
|
+
* refuses to write a model there.
|
|
82
|
+
*
|
|
83
|
+
* Accepts a {@link MaybeObservableValue} so it can be bound to a setting.
|
|
84
|
+
*/
|
|
85
|
+
readonly keepUnchangedText?: MaybeObservableValue<boolean>;
|
|
86
|
+
}
|
|
87
|
+
/** One {@link ModelService.onModelUpdated} subscription; `uri` is canonical, absent for every document. */
|
|
88
|
+
export interface ModelUpdateSubscriber<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic> {
|
|
89
|
+
readonly uri?: CanonicalUri;
|
|
90
|
+
readonly listener: (event: ModelUpdatedEvent<TAst, TDiagnostic>) => void;
|
|
91
|
+
}
|
|
92
|
+
/** Options for a {@link DefaultModelService} wait on one document. */
|
|
93
|
+
export interface SyncedWaitOptions {
|
|
94
|
+
/**
|
|
95
|
+
* Build a root parsed from text older than the store's at the call, and
|
|
96
|
+
* reject once that build, or one the builder re-queues, is given up. Without
|
|
97
|
+
* it, such a root is left to other builds, and a wait they never end stays
|
|
98
|
+
* pending until its token is cancelled.
|
|
99
|
+
*/
|
|
100
|
+
readonly sync?: boolean;
|
|
98
101
|
}
|
|
99
102
|
/**
|
|
103
|
+
* The seam every non-LSP head talks to: the data server, the GLSP head and an
|
|
104
|
+
* adopter's own services reach documents through this slot rather than through
|
|
105
|
+
* the workspace stores.
|
|
106
|
+
*
|
|
100
107
|
* In-process facade over the framework's document plumbing
|
|
101
108
|
* (`HydraniumTextDocuments`, `LangiumDocuments`,
|
|
102
|
-
* `DocumentBuilder`, `WritableFileSystemProvider`). Owns the
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
* doesn't have to be re-implemented per
|
|
109
|
+
* `DocumentBuilder`, `WritableFileSystemProvider`). Owns the document
|
|
110
|
+
* lifecycle the data-server and GLSP heads delegate to — client sessions that
|
|
111
|
+
* open, update, save and close documents, the phase reads, and `ready` — so
|
|
112
|
+
* coordinating those primitives doesn't have to be re-implemented per head.
|
|
113
|
+
* Every open and write goes through a session from {@link createSession}.
|
|
106
114
|
*
|
|
107
115
|
* "Model" here means the parsed AST — distinct from the wire-shape
|
|
108
116
|
* `TransferDocument` in `@hydranium/protocol`.
|
|
@@ -112,9 +120,9 @@ export interface ModelServiceOptions extends LogNameOptions {
|
|
|
112
120
|
* Multiple in-process consumers want the same workspace-level
|
|
113
121
|
* operations:
|
|
114
122
|
* - The data-server head turns these into typed RPC methods.
|
|
115
|
-
* - The GLSP head uses the same lifecycle for diagram-driven edits
|
|
116
|
-
*
|
|
117
|
-
*
|
|
123
|
+
* - The GLSP head uses the same lifecycle for diagram-driven edits: GModel
|
|
124
|
+
* operation handlers write through the diagram's session and wait on phases
|
|
125
|
+
* before reading.
|
|
118
126
|
* - Server-internal callers (integrity service, ad-hoc bridges, tests)
|
|
119
127
|
* want the same operations without the wire serialisation step.
|
|
120
128
|
*
|
|
@@ -127,15 +135,16 @@ export interface ModelServiceOptions extends LogNameOptions {
|
|
|
127
135
|
*
|
|
128
136
|
* **Read-latest supersession**
|
|
129
137
|
*
|
|
130
|
-
*
|
|
131
|
-
* `DocumentBuilder.waitUntil` to wait for the integrity-settled
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* event. Adopters wanting strict
|
|
136
|
-
* with vN's snapshot specifically, log
|
|
137
|
-
*
|
|
138
|
-
*
|
|
138
|
+
* A session's default `update` and `save` use Langium's per-URI
|
|
139
|
+
* `DocumentBuilder.waitUntil` to wait for `Validated` (the integrity-settled
|
|
140
|
+
* landmark {@link IntegrityService.SettledState} when rebuilds do not
|
|
141
|
+
* validate), then read the post-build state. Concurrent in-process callers
|
|
142
|
+
* on the same URI all see the latest post-build snapshot — none deadlock
|
|
143
|
+
* waiting for a specific version's settled event. Adopters wanting strict
|
|
144
|
+
* version-matched semantics (resolve with vN's snapshot specifically, log
|
|
145
|
+
* "vN superseded by vM at vN+1") override
|
|
146
|
+
* `DefaultClientSession.updateDocument` to attach a phase-listener with
|
|
147
|
+
* explicit version checks; the framework default doesn't need it for safety.
|
|
139
148
|
*
|
|
140
149
|
* **Returns AST snapshots, not wire envelopes**
|
|
141
150
|
*
|
|
@@ -148,32 +157,26 @@ export interface ModelServiceOptions extends LogNameOptions {
|
|
|
148
157
|
* the injected `TransferEncoder` — symmetric with the
|
|
149
158
|
* `getModelDocument` envelope path.
|
|
150
159
|
*
|
|
151
|
-
* **Subscriptions** (
|
|
152
|
-
*
|
|
153
|
-
* `
|
|
154
|
-
* `HydraniumTextDocuments.onDidSave` / `onDidClose`. Filtering
|
|
155
|
-
* by URI happens here so consumers can subscribe per-document without
|
|
156
|
-
* implementing the URI gate at each callsite.
|
|
160
|
+
* **Subscriptions** (`on*`) are how a head follows documents; it subscribes
|
|
161
|
+
* here rather than to the builder or the text store. Each takes a filter, and
|
|
162
|
+
* one without a `uri` hears every document.
|
|
157
163
|
*
|
|
158
|
-
* **
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
*
|
|
169
|
-
* adopter's own services reach documents through this slot rather than through
|
|
170
|
-
* the workspace stores.
|
|
164
|
+
* **Two families.** `waitFor*` only waits: it rejects for a URI with no
|
|
165
|
+
* document, and for a root behind the store's text it waits for whatever
|
|
166
|
+
* builds it next, so it never ends if nothing does. `ensureDocumentState` and
|
|
167
|
+
* the phase shorthands over it build a missing document, and build a root
|
|
168
|
+
* behind its text, rejecting when that build fails twice. Both re-queue a
|
|
169
|
+
* document the builder's last build left short of the state.
|
|
170
|
+
*
|
|
171
|
+
* Both resolve at the state with a root parsed from text no older than the
|
|
172
|
+
* store's version at the call; inside the write lock, at the state alone, since
|
|
173
|
+
* the build that would sync the document to that version cannot start until
|
|
174
|
+
* it is released.
|
|
171
175
|
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* documents are awaited, cold ones are built.
|
|
176
|
+
* Do not await one inside a build phase listener: a browser host installs no
|
|
177
|
+
* write-lock scope, so the wait cannot tell it is inside a build and waits for
|
|
178
|
+
* one that cannot start. Nor inside a `WorkspaceLock.read`: the lock starts no
|
|
179
|
+
* write, the build included, while a read runs.
|
|
177
180
|
*
|
|
178
181
|
* **Diagnostics are typed `never` below `Validated`.** Validation is the last
|
|
179
182
|
* phase, so at any earlier landmark the array either is not yet computed or
|
|
@@ -189,10 +192,23 @@ export interface ModelServiceOptions extends LogNameOptions {
|
|
|
189
192
|
* The waits resolve at or ABOVE their target, so an already-validated document
|
|
190
193
|
* does carry usable diagnostics and the `never` over-forbids there. That
|
|
191
194
|
* direction is the safe one: the alternative permits stale reads silently. A
|
|
192
|
-
* member taking a phase as a PARAMETER
|
|
193
|
-
*
|
|
195
|
+
* member taking a phase as a PARAMETER returns `TDiagnostic`, and leaves them
|
|
196
|
+
* absent for a phase below `Validated`.
|
|
197
|
+
*
|
|
198
|
+
* **Generic parameters.**
|
|
199
|
+
* - `TAst` — the AST root type each consumer expects on the returned
|
|
200
|
+
* {@link AstDocument}. Constrained to {@link AstNode}.
|
|
201
|
+
* - `TDiagnostic` — the AST-layer diagnostic: whatever the build left on
|
|
202
|
+
* `LangiumDocument.diagnostics`, carried through on the returned
|
|
203
|
+
* {@link AstDocument}. Defaults to {@link AstDiagnostic}.
|
|
204
|
+
* **Not the `TransferEncoder`'s parameter of the same name**, which is
|
|
205
|
+
* that encoder's OUTPUT and so names the wire shape. This one names its
|
|
206
|
+
* input, and an adopter binds the two to different types.
|
|
207
|
+
* - `TTransfer` — transfer-model root a session's `update` / `save` accept
|
|
208
|
+
* args. Constrained to {@link TransferElement}. Defaults to the
|
|
209
|
+
* structural base.
|
|
194
210
|
*/
|
|
195
|
-
export interface ModelService<TAst extends AstNode, TDiagnostic =
|
|
211
|
+
export interface ModelService<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic, TTransfer extends TransferElement = TransferElement> {
|
|
196
212
|
/**
|
|
197
213
|
* Resolves once the workspace has been initialised and its first build has
|
|
198
214
|
* completed — the gate every read should wait behind, since a document
|
|
@@ -208,24 +224,116 @@ export interface ModelService<TAst extends AstNode, TDiagnostic = TransferDiagno
|
|
|
208
224
|
waitForBuilderState(state: DocumentState, cancelToken?: CancellationToken): Promise<void>;
|
|
209
225
|
ensureDocumentState(uri: string, state?: DocumentState, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
210
226
|
rebuild(uri: string, state?: DocumentState, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
227
|
+
/**
|
|
228
|
+
* Throw where {@link rebuild} would reject as reentrant. A write calls it
|
|
229
|
+
* before applying its text: a text applied and then refused stays applied
|
|
230
|
+
* with no build to follow it.
|
|
231
|
+
*/
|
|
232
|
+
assertCanBuild(uri: string): void;
|
|
211
233
|
parsed(uri: string, cancelToken?: CancellationToken): Promise<AstDocument<TAst, never>>;
|
|
212
234
|
linked(uri: string, cancelToken?: CancellationToken): Promise<AstDocument<TAst, never>>;
|
|
213
235
|
settled(uri: string, cancelToken?: CancellationToken): Promise<AstDocument<TAst, never>>;
|
|
214
236
|
indexed(uri: string, cancelToken?: CancellationToken): Promise<AstDocument<TAst, never>>;
|
|
215
237
|
validated(uri: string, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
216
|
-
update(args: TransferUpdateArgs<TTransfer>, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
217
|
-
save(args: TransferSaveArgs<TTransfer>, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
218
|
-
open(args: OpenModelArgs): Promise<Disposable>;
|
|
219
|
-
close(args: CloseModelArgs): Promise<void>;
|
|
220
238
|
isOpen(uri: string): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* The version the document at `uri` was opened at, which a client's write
|
|
241
|
+
* or an integrity repair steps past; `undefined` while it is not open.
|
|
242
|
+
*/
|
|
243
|
+
openedVersion(uri: string): TextVersion | undefined;
|
|
244
|
+
snapshot(uri: string): AstDocument<TAst, TDiagnostic> | undefined;
|
|
245
|
+
/**
|
|
246
|
+
* The text a session's write of `model` to `uri` applies: a textual model
|
|
247
|
+
* as given, a structured one rewritten and serialised. Also the text to
|
|
248
|
+
* create a document with: for a `uri` with no text the trivia preservers
|
|
249
|
+
* still run, so it gets their defaults, such as
|
|
250
|
+
* `DocumentEndingPreserver.DEFAULT_ENDING`. With
|
|
251
|
+
* {@link ModelServiceOptions.keepUnchangedText} set, a model equal to the
|
|
252
|
+
* document's gives the text its root was parsed from instead.
|
|
253
|
+
*/
|
|
254
|
+
modelToText(uri: string, model: TTransfer | string, cancelToken?: CancellationToken): Promise<string>;
|
|
221
255
|
getDocument(uri: string): LangiumDocument | undefined;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
256
|
+
/**
|
|
257
|
+
* Resolve once the document's build has settled and the language client
|
|
258
|
+
* has answered the push of its text, applied or refused and logged, so a
|
|
259
|
+
* save answering after it does not race that push. Does not wait again for
|
|
260
|
+
* a push an earlier settle timed out on and the client has not answered
|
|
261
|
+
* since. Never rejects: past its bound it warns and resolves, and a failed
|
|
262
|
+
* wait is logged and resolves.
|
|
263
|
+
*/
|
|
264
|
+
settleLanguageClient(uri: string, cancelToken?: CancellationToken): Promise<void>;
|
|
265
|
+
/**
|
|
266
|
+
* Whether a push of the document's text into the language client awaits the
|
|
267
|
+
* client's answer. A push a settle already timed out on does not count: that
|
|
268
|
+
* settle has warned about it.
|
|
269
|
+
*/
|
|
270
|
+
isLanguageClientPushPending(uri: string): boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Fires as a document reaches the filter's phase, `Validated` by default.
|
|
273
|
+
* Listeners run inside the build, so one that throws is logged and the
|
|
274
|
+
* others still run.
|
|
275
|
+
*/
|
|
276
|
+
onModelUpdated(listener: (event: ModelUpdatedEvent<TAst, TDiagnostic>) => void, filter?: ModelPhaseFilter): Disposable;
|
|
277
|
+
/**
|
|
278
|
+
* Fires once per build that reaches the phase, with every document it
|
|
279
|
+
* carried there. A listener that throws is logged, as for {@link onModelUpdated}.
|
|
280
|
+
*/
|
|
281
|
+
onModelsBuilt(listener: (event: ModelsBuiltEvent) => void, filter?: Pick<ModelPhaseFilter, 'phase'>): Disposable;
|
|
282
|
+
/**
|
|
283
|
+
* Fires for every save, whichever client made it, as the store announces
|
|
284
|
+
* it. A document saved before its first build arrives as an empty envelope
|
|
285
|
+
* at `UNRECORDED_VERSION`, whose `root` is `undefined` despite its type.
|
|
286
|
+
*/
|
|
287
|
+
onModelSaved(listener: (event: ModelSavedEvent<TAst, TDiagnostic>) => void, filter?: ModelEventFilter): Disposable;
|
|
288
|
+
/**
|
|
289
|
+
* Fires for every document a build removes, with the session whose
|
|
290
|
+
* `delete` removed it, as `AstDocumentManager.attributeDeletion` names it.
|
|
291
|
+
*/
|
|
292
|
+
onModelDeleted(listener: (event: ModelDeletedEvent) => void, filter?: ModelEventFilter): Disposable;
|
|
293
|
+
/** Fires when a document's text starts or stops differing from its file. */
|
|
294
|
+
onDirtyChanged(listener: (event: ModelDirtyChangedEvent) => void, filter?: ModelEventFilter): Disposable;
|
|
295
|
+
/**
|
|
296
|
+
* Fires when the store releases a document no client has open any more.
|
|
297
|
+
* What the build keeps for it is up to the
|
|
298
|
+
* `DocumentReleaseHandler` slot; the default reverts it to disk, and that
|
|
299
|
+
* rebuild follows as an {@link onModelUpdated} event, unless a client opens
|
|
300
|
+
* the document first or its file is deleted.
|
|
301
|
+
*/
|
|
302
|
+
onModelReleased(listener: (event: ModelReleasedEvent) => void, filter?: ModelEventFilter): Disposable;
|
|
303
|
+
/** Fires when `filter.clientId` closes `filter.uri`, its session ending included. */
|
|
304
|
+
onClientClosed(listener: () => void, filter: {
|
|
305
|
+
readonly uri: string;
|
|
306
|
+
readonly clientId: string;
|
|
307
|
+
}): Disposable;
|
|
308
|
+
/**
|
|
309
|
+
* Start a client session, the only way to open and write documents through
|
|
310
|
+
* this service. Pass a `label` naming the participant; without one it is
|
|
311
|
+
* `session`. The id defaults to `label#` plus a random UUID; a fixed
|
|
312
|
+
* `clientId` is taken as given. Throws `ReservedClientIdError` when the id
|
|
313
|
+
* is reserved by the framework, and `DuplicateClientIdError` when it is
|
|
314
|
+
* held by another live session or has documents open under it as a client
|
|
315
|
+
* that is not a session.
|
|
316
|
+
*
|
|
317
|
+
* A `resumeToken` matching the one the live session under `clientId` was
|
|
318
|
+
* started with ends that session as lost first, so the documents it was
|
|
319
|
+
* last to hold keep their unsaved text for the new one. The token guards
|
|
320
|
+
* against taking over a session by accident, not against a peer: anyone who
|
|
321
|
+
* knows it can end the session.
|
|
322
|
+
*
|
|
323
|
+
* `TOpenOptions` types the options the session's `open` takes and its
|
|
324
|
+
* `openOptions` returns. The narrowing is an unchecked cast, and it holds
|
|
325
|
+
* only for the caller that started the session: a holder reached through
|
|
326
|
+
* {@link getSession} sees plain `OpenOptions`.
|
|
327
|
+
*/
|
|
328
|
+
createSession<TOpenOptions extends OpenOptions = OpenOptions>(label?: string, clientId?: string, options?: {
|
|
329
|
+
readonly resumeToken?: string;
|
|
330
|
+
}): ClientSession<TAst, TDiagnostic, TTransfer, TOpenOptions>;
|
|
331
|
+
/** The live session started under `clientId`, or `undefined` once it has ended or was never started. */
|
|
332
|
+
getSession(clientId: string): ClientSession<TAst, TDiagnostic, TTransfer> | undefined;
|
|
225
333
|
}
|
|
226
|
-
export declare class DefaultModelService<TAst extends AstNode, TDiagnostic =
|
|
334
|
+
export declare class DefaultModelService<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic,
|
|
227
335
|
/**
|
|
228
|
-
* Structured payload
|
|
336
|
+
* Structured payload a session's `update` / `save` accept. Constrained to
|
|
229
337
|
* {@link TransferElement} — the minimal `{ readonly $type: string }`
|
|
230
338
|
* shape. Both transfer-model overlay roots (which extend
|
|
231
339
|
* `TransferElement` explicitly) and AST root types (which have
|
|
@@ -245,14 +353,10 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
245
353
|
* (see {@link DocumentUriPolicy}).
|
|
246
354
|
*/
|
|
247
355
|
protected readonly uriPolicy: DocumentUriPolicy;
|
|
248
|
-
/**
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
*/
|
|
253
|
-
protected readonly slowUpdateWarn?: ObservableValue<number>;
|
|
254
|
-
/** See {@link ModelServiceOptions.serializeBuilds}. Defaults to `true`. */
|
|
255
|
-
protected readonly serializeBuilds: ObservableValue<boolean>;
|
|
356
|
+
/** See {@link ModelServiceOptions.allowReentrantBuilds}. Defaults to `false`. */
|
|
357
|
+
protected readonly allowReentrantBuilds: ObservableValue<boolean>;
|
|
358
|
+
/** See {@link ModelServiceOptions.keepUnchangedText}. Defaults to `false`. */
|
|
359
|
+
protected readonly keepUnchangedText: ObservableValue<boolean>;
|
|
256
360
|
/**
|
|
257
361
|
* Per-URI applyEdit coalescing: at most one in-flight `applyEditToLanguageClient`
|
|
258
362
|
* RPC per URI, newest text wins. A newer settle while the current RPC is in
|
|
@@ -261,6 +365,29 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
261
365
|
*/
|
|
262
366
|
protected readonly syncChains: Map<string, Promise<void>>;
|
|
263
367
|
protected readonly pendingSync: Map<string, string>;
|
|
368
|
+
/**
|
|
369
|
+
* The sync chains a settle timed out on, until the client answers their
|
|
370
|
+
* push. A later settle does not wait on one meanwhile: GLSP runs a diagram's
|
|
371
|
+
* saves one at a time, so each would add the full bound and a queued save
|
|
372
|
+
* outlast its client's timeout.
|
|
373
|
+
*/
|
|
374
|
+
protected readonly timedOutSyncChains: WeakSet<Promise<void>>;
|
|
375
|
+
/** The live sessions this service started, by client id, for {@link getSession}. */
|
|
376
|
+
protected readonly sessions: Map<string, ClientSession<TAst, TDiagnostic, TTransfer, object>>;
|
|
377
|
+
/**
|
|
378
|
+
* Drops an ended session from {@link sessions}. Subscribed by the first
|
|
379
|
+
* {@link createSession} rather than at construction, so a services tree with
|
|
380
|
+
* no text store, or one that knows nothing of sessions, still constructs
|
|
381
|
+
* this service.
|
|
382
|
+
*/
|
|
383
|
+
protected sessionCloseListener?: Disposable;
|
|
384
|
+
/** The token each live session was started with, by client id, for a takeover by {@link createSession}. */
|
|
385
|
+
protected readonly resumeTokens: Map<string, string>;
|
|
386
|
+
/**
|
|
387
|
+
* The {@link onModelUpdated} subscribers, by phase. One builder listener per
|
|
388
|
+
* phase serves them all, kept for the life of the service.
|
|
389
|
+
*/
|
|
390
|
+
protected readonly updateSubscribers: Map<DocumentState, Set<ModelUpdateSubscriber<TAst, TDiagnostic>>>;
|
|
264
391
|
/**
|
|
265
392
|
* Workspace-level readiness gate. Resolves when the framework has
|
|
266
393
|
* finished its first workspace build cycle and the `ModelService`
|
|
@@ -296,10 +423,12 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
296
423
|
readonly ready: Promise<void>;
|
|
297
424
|
constructor(services: ServerSharedServices, options?: ModelServiceOptions);
|
|
298
425
|
/**
|
|
299
|
-
* Wait for the document at `uri` to reach `state
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
426
|
+
* Wait for the document at `uri` to reach `state` with a root no older than
|
|
427
|
+
* the store's text at the call. Rejects if `uri` is not in the document
|
|
428
|
+
* registry. A root behind its text is not built: the wait lasts until
|
|
429
|
+
* something else builds it, so use {@link ensureDocumentState} where
|
|
430
|
+
* nothing may. Builds that keep failing leave the wait pending, to its
|
|
431
|
+
* cancellation token.
|
|
303
432
|
*
|
|
304
433
|
* Wrapped in a debug-level timing log via {@link Tracer.time} so
|
|
305
434
|
* slow per-URI waits surface in build telemetry; the URI is
|
|
@@ -310,8 +439,7 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
310
439
|
* Wait for the document at `uri` to reach the integrity-settled landmark
|
|
311
440
|
* ({@link IntegrityService.SettledState}) — the earliest phase at which the
|
|
312
441
|
* AST + serialised text are stable post-integrity. Convenience wrapper over
|
|
313
|
-
* {@link waitForDocumentState}
|
|
314
|
-
* case (e.g. settling a save). Pure wait — does not trigger a build.
|
|
442
|
+
* {@link waitForDocumentState}, and like it builds nothing behind its text.
|
|
315
443
|
*/
|
|
316
444
|
waitForDocumentSettled(uri: string, cancelToken?: CancellationToken): Promise<AstDocument<TAst, never>>;
|
|
317
445
|
/**
|
|
@@ -323,8 +451,31 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
323
451
|
* the identity once instead of re-running the (filesystem-touching) `realpath`
|
|
324
452
|
* at every wait. The `CanonicalUri` parameter type enforces that — a raw
|
|
325
453
|
* `string` cannot be passed without minting through the URI policy.
|
|
454
|
+
*
|
|
455
|
+
* With `options.sync`, a root behind the store's text is built, as in
|
|
456
|
+
* {@link ensureDocumentState}; without it, the root is left to other builds,
|
|
457
|
+
* as in {@link waitForDocumentState}. Below `Validated` the envelope has no
|
|
458
|
+
* diagnostics: see {@link withoutDiagnostics}.
|
|
459
|
+
*/
|
|
460
|
+
protected waitForDocumentStateCanonical(uri: CanonicalUri, state: DocumentState, cancelToken?: CancellationToken, options?: SyncedWaitOptions): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
461
|
+
/**
|
|
462
|
+
* Wait for `state` with a root parsed from text at `textVersion` or later. A
|
|
463
|
+
* root no factory recorded counts as synced, since no build records it.
|
|
464
|
+
* With `options.sync`, a root still behind is built through
|
|
465
|
+
* `VersionSyncService.syncTo`, and the wait rejects once that build, or one
|
|
466
|
+
* the builder re-queues to reach `state`, is given up. Without it, the wait
|
|
467
|
+
* lasts until another build parses the text, and stays pending when the
|
|
468
|
+
* builder gives up re-queuing the document.
|
|
469
|
+
*/
|
|
470
|
+
protected waitUntilSynced(uri: URI, state: DocumentState, textVersion: TextVersion | undefined, cancelToken?: CancellationToken, options?: SyncedWaitOptions): Promise<void>;
|
|
471
|
+
/**
|
|
472
|
+
* Resolves once a parse of `uri` has been recorded or a build has deleted
|
|
473
|
+
* it, rejecting with `OperationCancelled` when `cancelToken` is cancelled
|
|
474
|
+
* first, and with an error when `build`, the build requested for it, is
|
|
475
|
+
* given up. A `Parsed` phase listener cannot serve: a cancel right after the
|
|
476
|
+
* parse skips it, and the resumed build does not parse again.
|
|
326
477
|
*/
|
|
327
|
-
protected
|
|
478
|
+
protected nextParseOrDeletion(uri: URI, cancelToken?: CancellationToken, build?: Promise<void>): Promise<void>;
|
|
328
479
|
/**
|
|
329
480
|
* Wait for the document builder to reach `state` across its currently-
|
|
330
481
|
* queued documents. Pure wait — does not trigger a build. Used by
|
|
@@ -339,31 +490,35 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
339
490
|
* Force a fresh build of the document at `uri` and wait for it to
|
|
340
491
|
* reach `state` (or the integrity-settled landmark
|
|
341
492
|
* {@link IntegrityService.SettledState} if omitted).
|
|
342
|
-
* Always
|
|
343
|
-
*
|
|
344
|
-
* you want to re-process from scratch.
|
|
493
|
+
* Always builds the document, whether or not it is already in the
|
|
494
|
+
* registry, in a build of its own or in one already scheduled that carries
|
|
495
|
+
* it — call this when you want to re-process from scratch.
|
|
345
496
|
*
|
|
346
|
-
* The facade is responsible for
|
|
347
|
-
* directly because Langium's `DefaultDocumentUpdateHandler.didChangeContent`
|
|
497
|
+
* The facade is responsible for requesting the build itself because Langium's `DefaultDocumentUpdateHandler.didChangeContent`
|
|
348
498
|
* (the standard text-document → builder bridge) only runs under an
|
|
349
499
|
* LSP `Connection`. Running headless the bridge never fires; the
|
|
350
500
|
* facade stands in for it on its own update path.
|
|
351
501
|
*
|
|
352
502
|
* Coexistence with an LSP head running on the same `DocumentBuilder` is
|
|
353
|
-
* fine
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
* and Langium appends the second set onto the first, duplicating every
|
|
360
|
-
* diagnostic.
|
|
361
|
-
* {@link ModelServiceOptions.
|
|
362
|
-
* non-reentrancy hazard
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
503
|
+
* fine: the LSP head builds from the LSP-driven event and the facade from
|
|
504
|
+
* its own RPC-driven event — both legitimate — and both go through
|
|
505
|
+
* `HydraniumDocumentBuilder.scheduleUpdate`, which serialises them under
|
|
506
|
+
* the workspace WRITE lock and lets the second share the first's build
|
|
507
|
+
* where that build carries it. Langium alone does not coalesce concurrent
|
|
508
|
+
* builds of one URI: two unserialised builds each run a full validation
|
|
509
|
+
* pass and Langium appends the second set onto the first, duplicating every
|
|
510
|
+
* diagnostic. A caller that already holds the lock builds without it only
|
|
511
|
+
* under {@link ModelServiceOptions.allowReentrantBuilds} — see there for the
|
|
512
|
+
* non-reentrancy hazard.
|
|
513
|
+
*
|
|
514
|
+
* An override calls the base before it awaits. Under an LSP connection the
|
|
515
|
+
* store's change event has already asked the update handler to build a
|
|
516
|
+
* session's write; an override whose await outlasts that build makes the
|
|
517
|
+
* base's request start a build of its own, so the write is built and
|
|
518
|
+
* delivered twice.
|
|
519
|
+
*
|
|
520
|
+
* Rejects when the build leaves no document for `uri`, as for a URI with
|
|
521
|
+
* neither a file nor text: the wait after it has nothing to wait on.
|
|
367
522
|
*
|
|
368
523
|
* Consumers wanting "give me this doc at state X, building only if
|
|
369
524
|
* needed" — use the per-state methods ({@link parsed} / {@link linked}
|
|
@@ -372,22 +527,20 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
372
527
|
rebuild(uri: string, state?: DocumentState, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
373
528
|
/**
|
|
374
529
|
* Internal build core operating on an already-{@link CanonicalUri canonical}
|
|
375
|
-
* URI — the build counterpart to {@link waitForDocumentStateCanonical}.
|
|
376
|
-
*
|
|
530
|
+
* URI — the build counterpart to {@link waitForDocumentStateCanonical}.
|
|
531
|
+
* Requests the build, then waits via the canonical wait core, so the
|
|
377
532
|
* identity is resolved once at the public door and neither sink re-runs the
|
|
378
533
|
* `realpath`. (`DocumentBuilder.update` still resolves each URI internally for
|
|
379
534
|
* directory flattening — that is the build's own existence-aware resolution,
|
|
380
535
|
* not a redundant identity canonicalisation.)
|
|
381
536
|
*/
|
|
382
537
|
protected rebuildCanonical(uri: CanonicalUri, state?: DocumentState, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
538
|
+
assertCanBuild(uri: string): void;
|
|
383
539
|
/**
|
|
384
540
|
* Per-state typed convenience methods. Each ensures the document at
|
|
385
541
|
* `uri` reaches the named phase and returns the AST envelope with
|
|
386
|
-
* the narrowest accurate diagnostics type for that phase
|
|
387
|
-
*
|
|
388
|
-
* registry) just waits via {@link waitForDocumentState}; cold path
|
|
389
|
-
* triggers a build via {@link rebuild}. Consumers do not need to
|
|
390
|
-
* know which path was taken.
|
|
542
|
+
* the narrowest accurate diagnostics type for that phase, building as
|
|
543
|
+
* {@link ensureDocumentState} does.
|
|
391
544
|
*
|
|
392
545
|
* Phase invariants encoded in the return type:
|
|
393
546
|
* - `parsed` / `linked` / `settled` / `indexed` return
|
|
@@ -396,16 +549,13 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
396
549
|
* - `validated` returns `AstDocument<TAst, TDiagnostic>` — diagnostics
|
|
397
550
|
* are populated.
|
|
398
551
|
*
|
|
399
|
-
* **The `never` is
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
* exactly that. So read an empty array as "none were computed, or there are
|
|
407
|
-
* none", never as "this document is clean", and call {@link validated} when
|
|
408
|
-
* the answer has to mean the second.
|
|
552
|
+
* **The `never` is enforced, not merely declared.** The wait underneath
|
|
553
|
+
* resolves at or ABOVE the requested state, so a document something else
|
|
554
|
+
* already carried past `Validated` would otherwise come back from
|
|
555
|
+
* `settled()` carrying a full diagnostics array typed `never`; these four
|
|
556
|
+
* strip it. An empty array here therefore means "this read does not report
|
|
557
|
+
* diagnostics", never "this document is clean" — call {@link validated}
|
|
558
|
+
* when the answer has to mean the second.
|
|
409
559
|
*
|
|
410
560
|
* `settled` is the integrity-overlay name for "all integrity rules
|
|
411
561
|
* have fired"; it maps to {@link IntegrityService.SettledState} (which
|
|
@@ -421,18 +571,13 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
421
571
|
/**
|
|
422
572
|
* Ensure the document at `uri` reaches `state` (or the integrity-settled
|
|
423
573
|
* landmark {@link IntegrityService.SettledState} if omitted) and return its
|
|
424
|
-
* AST envelope.
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
* document. Also pairs with {@link waitForDocumentState} — the verb
|
|
432
|
-
* difference (`ensure` vs `waitFor`) signals the side-effect
|
|
433
|
-
* difference. The per-state convenience methods (`parsed` / `linked`
|
|
434
|
-
* / `settled` / `indexed` / `validated`) all delegate here with an
|
|
435
|
-
* explicit phase.
|
|
574
|
+
* AST envelope, with a root no older than the store's text at the call.
|
|
575
|
+
* A document not in `LangiumDocuments` is built via {@link rebuild}; a
|
|
576
|
+
* loaded one whose root is behind its text is built through
|
|
577
|
+
* `VersionSyncService.syncTo`. Until `state` is reached, the call rejects
|
|
578
|
+
* once that build, or one the builder re-queues, has failed twice, or the
|
|
579
|
+
* builder stops re-queuing the document. A loaded, current document is only
|
|
580
|
+
* awaited.
|
|
436
581
|
*/
|
|
437
582
|
ensureDocumentState(uri: string, state?: DocumentState, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
438
583
|
/**
|
|
@@ -447,80 +592,49 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
447
592
|
*/
|
|
448
593
|
protected ensureDocumentStateCanonical(uri: CanonicalUri, state?: DocumentState, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
449
594
|
/**
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
* structured), pushed into the multi-client text-document store with
|
|
453
|
-
* a fresh version, drives a build to the target phase, and returns
|
|
454
|
-
* the post-build AST snapshot.
|
|
455
|
-
*
|
|
456
|
-
* **Read-latest supersession**: concurrent callers on the same URI
|
|
457
|
-
* all see the same post-build state once `waitUntil` resolves; none
|
|
458
|
-
* deadlock waiting for a specific version's settled event. The
|
|
459
|
-
* framework emits a post-resolution `debug` log line distinguishing
|
|
460
|
-
* "vN ready" from "vN ready at vM (superseded)" so callers can
|
|
461
|
-
* observe when their write was overtaken by a newer one before
|
|
462
|
-
* settling — purely observability, doesn't change resolution
|
|
463
|
-
* semantics. Adopters wanting version-matched resolution (resolve
|
|
464
|
-
* with vN's specific settled snapshot, intermediate-phase
|
|
465
|
-
* observability, slow-warn / hard-timeout behaviour) override this
|
|
466
|
-
* method.
|
|
467
|
-
*/
|
|
468
|
-
update(args: TransferUpdateArgs<TTransfer>, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
469
|
-
/**
|
|
470
|
-
* Persist `uri` to disk. Same content-change + settled-phase flow as
|
|
471
|
-
* {@link update}, then writes via the
|
|
472
|
-
* `WritableFileSystemProvider` and notifies the multi-client
|
|
473
|
-
* text-document store of the save (so any open LSP-side editor sees
|
|
474
|
-
* the `onDidSave` event regardless of who originated the persist).
|
|
475
|
-
*
|
|
476
|
-
* Returns the post-save AST snapshot.
|
|
477
|
-
*/
|
|
478
|
-
save(args: TransferSaveArgs<TTransfer>, cancelToken?: CancellationToken): Promise<AstDocument<TAst, TDiagnostic>>;
|
|
479
|
-
/**
|
|
480
|
-
* Wait for the document at `uri` to reach the integrity-settled landmark and
|
|
595
|
+
* Wait for the document at `uri` to reach the integrity-settled landmark,
|
|
596
|
+
* building a root behind its text as {@link ensureDocumentState} does, and
|
|
481
597
|
* drain any in-flight write-path applyEdit sync chain (see {@link syncChains})
|
|
482
|
-
* so
|
|
483
|
-
*
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
* client closes it. If `args.text` is omitted the document content
|
|
498
|
-
* is read from the `FileSystemProvider`.
|
|
499
|
-
*
|
|
500
|
-
* Returns a {@link Disposable} that closes the registration when
|
|
501
|
-
* disposed — useful for `using` blocks and shutdown cleanup.
|
|
502
|
-
*
|
|
503
|
-
* Delegates to the framework-bound
|
|
504
|
-
* `services.workspace.AstDocumentManager`. Adopter subclasses with
|
|
505
|
-
* extra open-time behaviour (logging, sync-chain bootstrapping)
|
|
506
|
-
* override on their `ModelService` subclass and call `super.open`.
|
|
507
|
-
*
|
|
508
|
-
* The open path does not thread cancellation: `AstDocumentManager.open`
|
|
509
|
-
* and the filesystem read behind it take no token, so a cancelled caller
|
|
510
|
-
* still completes the open.
|
|
511
|
-
*/
|
|
512
|
-
open(args: OpenModelArgs): Promise<Disposable>;
|
|
513
|
-
/**
|
|
514
|
-
* Close the document at `args.uri` for `args.clientId`. Counterpart
|
|
515
|
-
* to {@link open}; the underlying document stays open until every
|
|
516
|
-
* registered client has closed.
|
|
517
|
-
*/
|
|
518
|
-
close(args: CloseModelArgs): Promise<void>;
|
|
598
|
+
* so the language client has answered the push of the latest content before
|
|
599
|
+
* this returns; a push it refused twice is logged, not retried. No-op tail
|
|
600
|
+
* for headless adopters — `syncChains` is empty without an LSP client.
|
|
601
|
+
* Bounded at 10 s so a hung build, or an applyEdit reverse-RPC deadlock,
|
|
602
|
+
* can't freeze the caller; it returns rather than throwing, warning on
|
|
603
|
+
* timeout. A failed wait is logged at `error`, at `debug` when cancelled and
|
|
604
|
+
* at `warn` when the document is gone.
|
|
605
|
+
*
|
|
606
|
+
* The framework's save handlers call this after their persist, the data
|
|
607
|
+
* head's updates after their write and the GLSP head's settle request for
|
|
608
|
+
* each document a save writes; an adopter's own save path that answers a
|
|
609
|
+
* client calls it after its `save` too.
|
|
610
|
+
*/
|
|
611
|
+
settleLanguageClient(uri: string, cancelToken?: CancellationToken): Promise<void>;
|
|
612
|
+
isLanguageClientPushPending(uri: string): boolean;
|
|
519
613
|
/**
|
|
520
614
|
* True when the document at `uri` is currently open for at least one
|
|
521
615
|
* client. Pure read; no side effects.
|
|
522
616
|
*/
|
|
523
617
|
isOpen(uri: string): boolean;
|
|
618
|
+
openedVersion(uri: string): TextVersion | undefined;
|
|
619
|
+
/**
|
|
620
|
+
* Snapshot of `uri` as it stands RIGHT NOW — the synchronous sibling of the
|
|
621
|
+
* phase reads, which all wait. `undefined` when no document is registered,
|
|
622
|
+
* or only the builder's placeholder for one its build has not parsed yet:
|
|
623
|
+
* that root is no parse of any text, and its version gates no write.
|
|
624
|
+
*
|
|
625
|
+
* **This is what a writer wants, and {@link getDocument} is not.** The
|
|
626
|
+
* envelope's `version` is copied by value at projection time, so it cannot
|
|
627
|
+
* move afterwards; a version read off the live document at write time is
|
|
628
|
+
* whatever the server is at *now*, which is the number an optimistic gate is
|
|
629
|
+
* about to compare it against.
|
|
630
|
+
*
|
|
631
|
+
* Diagnostics only from a document that has reached `Validated`, and absent
|
|
632
|
+
* otherwise. Unlike the phase reads this one names no phase, so
|
|
633
|
+
* the state it finds is the only thing that can say whether the array
|
|
634
|
+
* describes the content being handed back or whatever an earlier build left.
|
|
635
|
+
* A caller that needs them unconditionally waits, via {@link validated}.
|
|
636
|
+
*/
|
|
637
|
+
snapshot(uri: string): AstDocument<TAst, TDiagnostic> | undefined;
|
|
524
638
|
/**
|
|
525
639
|
* The built {@link LangiumDocument} for `uri`, looked up by canonical identity —
|
|
526
640
|
* the synchronous, phase-agnostic sibling of {@link ensureDocumentState} /
|
|
@@ -529,24 +643,49 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
529
643
|
* into `LangiumDocuments` directly: a symlinked / `..` / case-divergent URI
|
|
530
644
|
* still resolves to the one document the build keys by its real path. Returns
|
|
531
645
|
* `undefined` if no document is registered for `uri`.
|
|
646
|
+
*
|
|
647
|
+
* **Live, so do not take a base version off it.** `textDocument` is the
|
|
648
|
+
* store's own object rather than a copy, so `.version` read here answers for
|
|
649
|
+
* the moment of the READ, not the moment of the earlier content — pass it to
|
|
650
|
+
* a write and the server compares its current version against itself, the
|
|
651
|
+
* gate passes unconditionally, and a concurrent edit is overwritten with
|
|
652
|
+
* nothing logged. Use {@link snapshot} for that, or a phase read.
|
|
532
653
|
*/
|
|
533
654
|
getDocument(uri: string): LangiumDocument | undefined;
|
|
655
|
+
createSession<TOpenOptions extends OpenOptions = OpenOptions>(label?: string, clientId?: string, options?: {
|
|
656
|
+
readonly resumeToken?: string;
|
|
657
|
+
}): ClientSession<TAst, TDiagnostic, TTransfer, TOpenOptions>;
|
|
658
|
+
getSession(clientId: string): ClientSession<TAst, TDiagnostic, TTransfer> | undefined;
|
|
659
|
+
/**
|
|
660
|
+
* Convert a structured-or-textual `model` payload to its textual form.
|
|
661
|
+
*
|
|
662
|
+
* Textual payloads (LSP / pre-serialised callers) pass through untouched.
|
|
663
|
+
* Structured payloads run the per-language `UpdateRewriteService` chain
|
|
664
|
+
* (transfer-model transforms; diff-aware rewrites see the previous AST root),
|
|
665
|
+
* then serialise. The chain is the single transfer-model-transform seam — a
|
|
666
|
+
* unary normalisation is just a rewrite that ignores `previous`, as
|
|
667
|
+
* `NormalizeEmptyStringsContribution` does. The chain is empty by
|
|
668
|
+
* default, so this is a no-op for adopters that register none.
|
|
669
|
+
*
|
|
670
|
+
* The serialised text then takes the trivia of the text it replaces, or of
|
|
671
|
+
* an empty one when `uri` has none, so a created document gets the
|
|
672
|
+
* preservers' defaults rather than the serializer's bare output. Under
|
|
673
|
+
* {@link ModelServiceOptions.keepUnchangedText} the document's own text is
|
|
674
|
+
* returned when it parses to a model that serializes to the same text.
|
|
675
|
+
*/
|
|
676
|
+
modelToText(uri: string, model: TTransfer | string, cancelToken?: CancellationToken): Promise<string>;
|
|
534
677
|
/**
|
|
535
678
|
* Mirror a server-side change of `document` back to the LSP textual language
|
|
536
679
|
* client, run per document as it reaches the post-integrity settled phase.
|
|
537
680
|
* The single framework caller of
|
|
538
|
-
* `HydraniumTextDocuments.applyEditToLanguageClient
|
|
539
|
-
* `HydraniumTextDocuments.stagePendingContent`.
|
|
681
|
+
* `HydraniumTextDocuments.applyEditToLanguageClient`.
|
|
540
682
|
*
|
|
541
|
-
*
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
* - **Closed in the language client** → {@link stageClosedDocument}: stage the
|
|
548
|
-
* text for the eventual first `didOpen`, gated by **provenance**
|
|
549
|
-
* ({@link isNonLanguageClientEdit}).
|
|
683
|
+
* Only a document open in the language client is mirrored, through
|
|
684
|
+
* {@link syncOpenDocument}, routed purely by **content**. A document open
|
|
685
|
+
* only in another client needs nothing: a language client opening it joins
|
|
686
|
+
* the existing entry and is refreshed from the store. A session writes only
|
|
687
|
+
* what it has open, so no session edit of a closed document waits here for
|
|
688
|
+
* the language client's next open.
|
|
550
689
|
*
|
|
551
690
|
* The decision is **re-derived from the current settled state every time** (it
|
|
552
691
|
* is not a one-shot enrolment), which is what makes it self-healing: a doc
|
|
@@ -567,35 +706,6 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
567
706
|
* author-based skip is needed.
|
|
568
707
|
*/
|
|
569
708
|
protected syncOpenDocument(uri: string, text: string): void;
|
|
570
|
-
/**
|
|
571
|
-
* Stage the settled text of a document closed in the language client so the
|
|
572
|
-
* eventual first `didOpen` sees this in-memory text instead of stale disk —
|
|
573
|
-
* but only for a {@link isNonLanguageClientEdit genuine non-language-client edit}.
|
|
574
|
-
* A document rebuilt by an internal build is skipped, leaving disk authoritative
|
|
575
|
-
* on the next open.
|
|
576
|
-
*/
|
|
577
|
-
protected stageClosedDocument(document: LangiumDocument): void;
|
|
578
|
-
/**
|
|
579
|
-
* Whether `document`'s settled state is a genuine edit by a client *other than
|
|
580
|
-
* the language client* — a write a form / GLSP / integrity client actually made.
|
|
581
|
-
* Excludes two non-edits: the **language client** itself (the LSP/Monaco text
|
|
582
|
-
* client — it already holds its own edits, and the staging here exists to feed
|
|
583
|
-
* it) and an **internal build** (workspace startup, a cascade relink, a
|
|
584
|
-
* `didClose`-reload). This is the gate for {@link stageClosedDocument}: staging
|
|
585
|
-
* an internal build would
|
|
586
|
-
* (a) pre-stage every file on boot and (b) re-stage discarded content after
|
|
587
|
-
* close (e.g. a disposing GLSP session's debounced submit firing after close),
|
|
588
|
-
* which then shadows clean disk on the next open.
|
|
589
|
-
*
|
|
590
|
-
* The signal is "a known client other than the language client authored this
|
|
591
|
-
* version **and** the URI was in the last build's changed set
|
|
592
|
-
* (`isTriggeringEdit`)". A framework-internal rebuild reports no author
|
|
593
|
-
* (`getAuthor` → `undefined`), so it fails `hasKnownAuthor` without comparing
|
|
594
|
-
* against a sentinel. This is NOT redundant with content/registration — it
|
|
595
|
-
* distinguishes "client edited" from "framework rebuilt", which neither the
|
|
596
|
-
* shadow nor `isTriggeringEdit` alone can.
|
|
597
|
-
*/
|
|
598
|
-
protected isNonLanguageClientEdit(document: LangiumDocument): boolean;
|
|
599
709
|
/**
|
|
600
710
|
* Enqueue a sync to the language client. The pending slot per URI holds only
|
|
601
711
|
* the latest text: if a newer settle fires while the current RPC is in
|
|
@@ -615,32 +725,25 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
615
725
|
*/
|
|
616
726
|
protected editLabel(): string;
|
|
617
727
|
protected drainSyncQueue(uri: string): Promise<void>;
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
* the
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
onModelSaved(uri: string, listener: (event: AstDocumentSavedEvent<TAst, TDiagnostic>) => void): Disposable;
|
|
638
|
-
/**
|
|
639
|
-
* Subscribe to the `(uri, clientId)` close event. Delegates to the
|
|
640
|
-
* manager so the listener registry is shared with any direct
|
|
641
|
-
* `HydraniumTextDocuments.onClientClosed` subscriber.
|
|
642
|
-
*/
|
|
643
|
-
onClientClosed(uri: string, clientId: string, listener: () => void): Disposable;
|
|
728
|
+
onModelUpdated(listener: (event: ModelUpdatedEvent<TAst, TDiagnostic>) => void, filter?: ModelPhaseFilter): Disposable;
|
|
729
|
+
onModelsBuilt(listener: (event: ModelsBuiltEvent) => void, filter?: Pick<ModelPhaseFilter, 'phase'>): Disposable;
|
|
730
|
+
onModelSaved(listener: (event: ModelSavedEvent<TAst, TDiagnostic>) => void, filter?: ModelEventFilter): Disposable;
|
|
731
|
+
onModelDeleted(listener: (event: ModelDeletedEvent) => void, filter?: ModelEventFilter): Disposable;
|
|
732
|
+
onDirtyChanged(listener: (event: ModelDirtyChangedEvent) => void, filter?: ModelEventFilter): Disposable;
|
|
733
|
+
onModelReleased(listener: (event: ModelReleasedEvent) => void, filter?: ModelEventFilter): Disposable;
|
|
734
|
+
onClientClosed(listener: () => void, filter: {
|
|
735
|
+
readonly uri: string;
|
|
736
|
+
readonly clientId: string;
|
|
737
|
+
}): Disposable;
|
|
738
|
+
protected filterUri(filter: ModelEventFilter): CanonicalUri | undefined;
|
|
739
|
+
protected matches(target: CanonicalUri | undefined, uri: CanonicalUri): boolean;
|
|
740
|
+
/**
|
|
741
|
+
* Hand every subscriber of `phase` for `document` one event, built once, so
|
|
742
|
+
* all of them see the same attribution. Built inside the build's listener
|
|
743
|
+
* and handed out without an await: after one, another build can have reset
|
|
744
|
+
* the document.
|
|
745
|
+
*/
|
|
746
|
+
protected deliverUpdate(phase: DocumentState, subscribers: ReadonlySet<ModelUpdateSubscriber<TAst, TDiagnostic>>, document: LangiumDocument, cancelToken: CancellationToken): void;
|
|
644
747
|
/**
|
|
645
748
|
* Serialise a transfer-model root via the language-specific
|
|
646
749
|
* `Serializer` bound at `services.serializer.Serializer`,
|
|
@@ -652,28 +755,25 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
652
755
|
* Adopters whose serializer call shape differs (custom service
|
|
653
756
|
* names, generator-driven YAML pretty printers, etc.) override this
|
|
654
757
|
* method. Routes through `Serializer.serializeTransfer` because
|
|
655
|
-
* `
|
|
758
|
+
* a session's `update` / `save` always receive a
|
|
656
759
|
* transfer-model shape (cross-references as plain strings) from
|
|
657
760
|
* adopter callers — the AST-shape entry point is `serializeAst`.
|
|
658
761
|
*
|
|
659
762
|
* Returns {@link MaybePromise} so adopter `Serializer` overrides can be
|
|
660
763
|
* async (remote schema lookup, external canonical-value resolution); the
|
|
661
|
-
* single caller ({@link modelToText}
|
|
764
|
+
* single caller ({@link modelToText}) is already `async`,
|
|
662
765
|
* so a naive `await` covers both branches without extra ceremony.
|
|
663
766
|
*/
|
|
664
767
|
protected serialize(uri: string, root: TTransfer): MaybePromise<string>;
|
|
665
768
|
/**
|
|
666
|
-
*
|
|
667
|
-
*
|
|
668
|
-
*
|
|
669
|
-
*
|
|
670
|
-
*
|
|
671
|
-
*
|
|
672
|
-
* unary normalisation is just a rewrite that ignores `previous`, as
|
|
673
|
-
* `NormalizeEmptyStringsContribution` does. The chain is empty by
|
|
674
|
-
* default, so this is a no-op for adopters that register none.
|
|
769
|
+
* The text a write into a document not yet built should take its trivia
|
|
770
|
+
* from: the store's, which a write always has, since it writes only a
|
|
771
|
+
* document its client has open. `undefined` when the store holds no text
|
|
772
|
+
* for `uri`: a document not yet created, or a file on disk that the
|
|
773
|
+
* workspace has not read and no client has open. The preservers then run
|
|
774
|
+
* over empty text, as for a created document; no answer skips them.
|
|
675
775
|
*/
|
|
676
|
-
protected
|
|
776
|
+
protected textToTakeTriviaFrom(uri: string, _target: URI): Promise<string | undefined>;
|
|
677
777
|
/**
|
|
678
778
|
* Run the per-language transfer-model rewrite chain. Resolves the
|
|
679
779
|
* `UpdateRewriteService` per-URI (like {@link serialize}) and threads
|
|
@@ -684,11 +784,29 @@ TTransfer extends TransferElement = TransferElement> implements ModelService<TAs
|
|
|
684
784
|
protected rewriteModel(uri: string, model: TTransfer, cancelToken?: CancellationToken): Promise<TTransfer>;
|
|
685
785
|
/**
|
|
686
786
|
* Build an {@link AstDocument} envelope from the current
|
|
687
|
-
* {@link LangiumDocument} state via
|
|
688
|
-
* projection. Returns an empty envelope (built via
|
|
787
|
+
* {@link LangiumDocument} state via `AstDocumentManager.toAstDocument`,
|
|
788
|
+
* the projection events use too. Returns an empty envelope (built via
|
|
689
789
|
* {@link AstDocument.create}) when the document is absent from the
|
|
690
|
-
* registry — adopters that prefer to throw override on their subclass.
|
|
790
|
+
* registry — adopters that prefer to throw override on their subclass. Its
|
|
791
|
+
* version is {@link UNRECORDED_VERSION}, so a write based on it conflicts.
|
|
691
792
|
*/
|
|
692
793
|
protected toAstDocument(uri: URI): AstDocument<TAst, TDiagnostic>;
|
|
794
|
+
/**
|
|
795
|
+
* The same envelope with no diagnostics, for a read that names a phase below
|
|
796
|
+
* `Validated`. Absent rather than `[]`, which says the document was validated
|
|
797
|
+
* and found clean.
|
|
798
|
+
*
|
|
799
|
+
* Langium fills `LangiumDocument.diagnostics` from inside `validateDocument`
|
|
800
|
+
* and from nowhere else, so below that phase the array holds whatever an
|
|
801
|
+
* EARLIER build left — a verdict about text the document may no longer have.
|
|
802
|
+
* The wait underneath resolves at or above the phase asked for, so a document
|
|
803
|
+
* something else carried past `Validated` would otherwise hand a full array
|
|
804
|
+
* back from `parsed()`.
|
|
805
|
+
*
|
|
806
|
+
* A copy rather than a clear: the envelope is freshly built here, but
|
|
807
|
+
* {@link toAstDocument} is overridable and an adopter's version may return
|
|
808
|
+
* one it also keeps.
|
|
809
|
+
*/
|
|
810
|
+
protected withoutDiagnostics(document: AstDocument<TAst, TDiagnostic>): AstDocument<TAst, never>;
|
|
693
811
|
}
|
|
694
812
|
//# sourceMappingURL=model-service.d.ts.map
|