@hydranium/core 1.0.0-next.12 → 1.0.0-next.123
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 +5 -1
- package/lib/documents/ast-document-manager.d.ts +92 -19
- package/lib/documents/ast-document-manager.d.ts.map +1 -1
- package/lib/documents/ast-document-manager.js +107 -26
- 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 +138 -0
- package/lib/documents/client-session-registry.d.ts.map +1 -0
- package/lib/documents/client-session-registry.js +184 -0
- package/lib/documents/client-session-registry.js.map +1 -0
- package/lib/documents/file-system-task-queue.d.ts +49 -0
- package/lib/documents/file-system-task-queue.d.ts.map +1 -0
- package/lib/documents/file-system-task-queue.js +34 -0
- package/lib/documents/file-system-task-queue.js.map +1 -0
- package/lib/documents/hydranium-text-documents.d.ts +324 -57
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
- package/lib/documents/hydranium-text-documents.js +590 -114
- package/lib/documents/hydranium-text-documents.js.map +1 -1
- package/lib/documents/index.d.ts +3 -0
- package/lib/documents/index.d.ts.map +1 -1
- package/lib/documents/index.js +3 -0
- package/lib/documents/index.js.map +1 -1
- package/lib/documents/language-client-text-shadow.d.ts +41 -9
- package/lib/documents/language-client-text-shadow.d.ts.map +1 -1
- package/lib/documents/language-client-text-shadow.js +56 -11
- package/lib/documents/language-client-text-shadow.js.map +1 -1
- package/lib/documents/self-save-registry.d.ts +37 -6
- package/lib/documents/self-save-registry.d.ts.map +1 -1
- package/lib/documents/self-save-registry.js +28 -15
- package/lib/documents/self-save-registry.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -1
- package/lib/langium/ast-extension/ast-node-builder.d.ts +32 -9
- package/lib/langium/ast-extension/ast-node-builder.d.ts.map +1 -1
- package/lib/langium/ast-extension/ast-node-builder.js +60 -22
- package/lib/langium/ast-extension/ast-node-builder.js.map +1 -1
- package/lib/langium/bootstrap.d.ts.map +1 -1
- package/lib/langium/bootstrap.js +16 -9
- package/lib/langium/bootstrap.js.map +1 -1
- 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/diagnostics/lsp-logger.d.ts +17 -0
- package/lib/langium/diagnostics/lsp-logger.d.ts.map +1 -1
- package/lib/langium/diagnostics/lsp-logger.js +40 -6
- package/lib/langium/diagnostics/lsp-logger.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 +32 -5
- package/lib/langium/document-builder/build-pipeline-integration.js.map +1 -1
- package/lib/langium/document-builder/build-session.d.ts +93 -0
- package/lib/langium/document-builder/build-session.d.ts.map +1 -0
- package/lib/langium/document-builder/build-session.js +72 -0
- package/lib/langium/document-builder/build-session.js.map +1 -0
- package/lib/langium/document-builder/document-builder.d.ts +165 -9
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
- package/lib/langium/document-builder/document-builder.js +313 -13
- package/lib/langium/document-builder/document-builder.js.map +1 -1
- package/lib/langium/document-builder/index.d.ts +1 -0
- package/lib/langium/document-builder/index.d.ts.map +1 -1
- package/lib/langium/document-builder/index.js +1 -0
- package/lib/langium/document-builder/index.js.map +1 -1
- package/lib/langium/integration-services.d.ts +45 -1
- package/lib/langium/integration-services.d.ts.map +1 -1
- package/lib/langium/integration-services.js +10 -5
- package/lib/langium/integration-services.js.map +1 -1
- package/lib/langium/integrity/integrity-rule.d.ts +13 -5
- 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 +54 -6
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-service.js +192 -17
- package/lib/langium/integrity/integrity-service.js.map +1 -1
- package/lib/langium/keys/containment.d.ts +64 -0
- package/lib/langium/keys/containment.d.ts.map +1 -0
- package/lib/langium/keys/containment.js +53 -0
- package/lib/langium/keys/containment.js.map +1 -0
- package/lib/langium/keys/index.d.ts +1 -0
- package/lib/langium/keys/index.d.ts.map +1 -1
- package/lib/langium/keys/index.js +1 -0
- package/lib/langium/keys/index.js.map +1 -1
- package/lib/langium/keys/name-based-key-provider.d.ts +4 -0
- package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -1
- package/lib/langium/keys/name-based-key-provider.js +4 -0
- package/lib/langium/keys/name-based-key-provider.js.map +1 -1
- package/lib/langium/language-module.d.ts +27 -2
- package/lib/langium/language-module.d.ts.map +1 -1
- package/lib/langium/language-module.js +16 -2
- package/lib/langium/language-module.js.map +1 -1
- package/lib/langium/model-service/client-session.d.ts +299 -0
- package/lib/langium/model-service/client-session.d.ts.map +1 -0
- package/lib/langium/model-service/client-session.js +379 -0
- package/lib/langium/model-service/client-session.js.map +1 -0
- package/lib/langium/model-service/index.d.ts +1 -0
- package/lib/langium/model-service/index.d.ts.map +1 -1
- package/lib/langium/model-service/index.js +1 -0
- package/lib/langium/model-service/index.js.map +1 -1
- package/lib/langium/model-service/model-service.d.ts +224 -160
- package/lib/langium/model-service/model-service.d.ts.map +1 -1
- package/lib/langium/model-service/model-service.js +191 -288
- package/lib/langium/model-service/model-service.js.map +1 -1
- package/lib/langium/module.d.ts +95 -16
- package/lib/langium/module.d.ts.map +1 -1
- package/lib/langium/module.js +30 -12
- package/lib/langium/module.js.map +1 -1
- package/lib/langium/naming/name-provider.d.ts +25 -4
- package/lib/langium/naming/name-provider.d.ts.map +1 -1
- package/lib/langium/naming/name-provider.js +2 -1
- package/lib/langium/naming/name-provider.js.map +1 -1
- package/lib/langium/naming/name-separator-validation.d.ts +23 -0
- package/lib/langium/naming/name-separator-validation.d.ts.map +1 -1
- package/lib/langium/naming/name-separator-validation.js +30 -1
- package/lib/langium/naming/name-separator-validation.js.map +1 -1
- package/lib/langium/residency/cst-residency-service.d.ts +31 -11
- package/lib/langium/residency/cst-residency-service.d.ts.map +1 -1
- package/lib/langium/residency/cst-residency-service.js +13 -56
- package/lib/langium/residency/cst-residency-service.js.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.d.ts +48 -13
- package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.js +56 -20
- package/lib/langium/scope/hydranium-scope-provider.js.map +1 -1
- package/lib/langium/serialization/abstract-serializer.d.ts +11 -20
- package/lib/langium/serialization/abstract-serializer.d.ts.map +1 -1
- package/lib/langium/serialization/abstract-serializer.js +12 -21
- package/lib/langium/serialization/abstract-serializer.js.map +1 -1
- package/lib/langium/service-registry.d.ts +15 -1
- package/lib/langium/service-registry.d.ts.map +1 -1
- package/lib/langium/service-registry.js +16 -0
- package/lib/langium/service-registry.js.map +1 -1
- package/lib/langium/shared-services.d.ts +15 -2
- package/lib/langium/shared-services.d.ts.map +1 -1
- package/lib/langium/shared-services.js.map +1 -1
- package/lib/langium/transfer/transfer-encoder.d.ts +60 -17
- package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -1
- package/lib/langium/transfer/transfer-encoder.js +38 -16
- package/lib/langium/transfer/transfer-encoder.js.map +1 -1
- package/lib/langium/trivia/comment-preserver.d.ts +423 -0
- package/lib/langium/trivia/comment-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/comment-preserver.js +906 -0
- package/lib/langium/trivia/comment-preserver.js.map +1 -0
- package/lib/langium/trivia/document-ending-preserver.d.ts +43 -0
- package/lib/langium/trivia/document-ending-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/document-ending-preserver.js +48 -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 +50 -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/update-rewrite.d.ts +1 -1
- package/lib/langium/validation/document-validator.d.ts +294 -10
- package/lib/langium/validation/document-validator.d.ts.map +1 -1
- package/lib/langium/validation/document-validator.js +448 -5
- package/lib/langium/validation/document-validator.js.map +1 -1
- package/lib/langium/workspace/document-uri-policy.d.ts +3 -4
- package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -1
- package/lib/langium/workspace/document-uri-policy.js +3 -4
- package/lib/langium/workspace/document-uri-policy.js.map +1 -1
- package/lib/langium/workspace/file-system-provider.d.ts +9 -1
- package/lib/langium/workspace/file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/file-system-provider.js +40 -7
- package/lib/langium/workspace/file-system-provider.js.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts +25 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.js +25 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts +21 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.js +28 -0
- package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts +23 -0
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.js +55 -9
- package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
- package/lib/langium/workspace/initialize-workspace.d.ts +31 -2
- package/lib/langium/workspace/initialize-workspace.d.ts.map +1 -1
- package/lib/langium/workspace/initialize-workspace.js +13 -5
- package/lib/langium/workspace/initialize-workspace.js.map +1 -1
- package/lib/langium/workspace/langium-documents.d.ts +79 -17
- package/lib/langium/workspace/langium-documents.d.ts.map +1 -1
- package/lib/langium/workspace/langium-documents.js +83 -28
- package/lib/langium/workspace/langium-documents.js.map +1 -1
- package/lib/langium/workspace/virtual-document.d.ts +18 -3
- package/lib/langium/workspace/virtual-document.d.ts.map +1 -1
- package/lib/langium/workspace/virtual-document.js +19 -2
- package/lib/langium/workspace/virtual-document.js.map +1 -1
- package/lib/langium/workspace/write-lock-scope.d.ts +1 -1
- package/lib/langium/workspace/write-lock-scope.js +1 -1
- package/lib/locale/index.d.ts +10 -0
- package/lib/locale/index.d.ts.map +1 -0
- package/lib/locale/index.js +10 -0
- package/lib/locale/index.js.map +1 -0
- package/lib/locale/server-locale.d.ts +73 -0
- package/lib/locale/server-locale.d.ts.map +1 -0
- package/lib/locale/server-locale.js +61 -0
- package/lib/locale/server-locale.js.map +1 -0
- package/lib/lsp/completion/hydranium-completion-provider.d.ts +44 -2
- package/lib/lsp/completion/hydranium-completion-provider.d.ts.map +1 -1
- package/lib/lsp/completion/hydranium-completion-provider.js +68 -0
- package/lib/lsp/completion/hydranium-completion-provider.js.map +1 -1
- package/lib/lsp/connection-features.d.ts +23 -0
- package/lib/lsp/connection-features.d.ts.map +1 -0
- package/lib/lsp/connection-features.js +60 -0
- package/lib/lsp/connection-features.js.map +1 -0
- package/lib/lsp/diagnostics-connection.d.ts +27 -0
- package/lib/lsp/diagnostics-connection.d.ts.map +1 -0
- package/lib/lsp/diagnostics-connection.js +53 -0
- package/lib/lsp/diagnostics-connection.js.map +1 -0
- package/lib/lsp/hydranium-document-update-handler.d.ts +70 -62
- package/lib/lsp/hydranium-document-update-handler.d.ts.map +1 -1
- package/lib/lsp/hydranium-document-update-handler.js +123 -75
- package/lib/lsp/hydranium-document-update-handler.js.map +1 -1
- package/lib/lsp/index.d.ts +3 -1
- package/lib/lsp/index.d.ts.map +1 -1
- package/lib/lsp/index.js +3 -1
- package/lib/lsp/index.js.map +1 -1
- package/lib/lsp/lsp-latency.d.ts +39 -0
- package/lib/lsp/lsp-latency.d.ts.map +1 -0
- package/lib/lsp/lsp-latency.js +58 -0
- package/lib/lsp/lsp-latency.js.map +1 -0
- package/lib/lsp/semantic-token-provider.d.ts +34 -1
- package/lib/lsp/semantic-token-provider.d.ts.map +1 -1
- package/lib/lsp/semantic-token-provider.js +55 -8
- package/lib/lsp/semantic-token-provider.js.map +1 -1
- package/lib/lsp/shared-module.d.ts +4 -8
- package/lib/lsp/shared-module.d.ts.map +1 -1
- package/lib/lsp/shared-module.js.map +1 -1
- package/lib/lsp/start-language-server.d.ts +8 -7
- package/lib/lsp/start-language-server.d.ts.map +1 -1
- package/lib/lsp/start-language-server.js +13 -7
- package/lib/lsp/start-language-server.js.map +1 -1
- package/lib/messages/carriers.d.ts +54 -0
- package/lib/messages/carriers.d.ts.map +1 -0
- package/lib/messages/carriers.js +62 -0
- package/lib/messages/carriers.js.map +1 -0
- package/lib/messages/index.d.ts +25 -0
- package/lib/messages/index.d.ts.map +1 -0
- package/lib/messages/index.js +25 -0
- package/lib/messages/index.js.map +1 -0
- package/lib/messages/renderer.d.ts +142 -0
- package/lib/messages/renderer.d.ts.map +1 -0
- package/lib/messages/renderer.js +165 -0
- package/lib/messages/renderer.js.map +1 -0
- package/lib/node/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 -0
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +1 -0
- 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/measure-memory.d.ts.map +1 -1
- package/lib/node/measure-memory.js +1 -0
- package/lib/node/measure-memory.js.map +1 -1
- package/lib/node/node-file-system-provider.d.ts +35 -1
- package/lib/node/node-file-system-provider.d.ts.map +1 -1
- package/lib/node/node-file-system-provider.js +140 -45
- package/lib/node/node-file-system-provider.js.map +1 -1
- package/lib/node/profile-capture.d.ts +8 -2
- package/lib/node/profile-capture.d.ts.map +1 -1
- package/lib/node/profile-capture.js.map +1 -1
- package/lib/node/profiling-run.d.ts +2 -2
- package/lib/node/profiling-run.js +1 -1
- package/lib/node/profiling-run.js.map +1 -1
- package/lib/node/rename-over-open-readers.d.ts +52 -0
- package/lib/node/rename-over-open-readers.d.ts.map +1 -0
- package/lib/node/rename-over-open-readers.js +66 -0
- package/lib/node/rename-over-open-readers.js.map +1 -0
- package/lib/node/socket-launcher.d.ts +15 -0
- package/lib/node/socket-launcher.d.ts.map +1 -1
- package/lib/node/socket-launcher.js +3 -2
- package/lib/node/socket-launcher.js.map +1 -1
- package/lib/testing/fake-document.d.ts +16 -4
- package/lib/testing/fake-document.d.ts.map +1 -1
- package/lib/testing/fake-document.js +18 -3
- package/lib/testing/fake-document.js.map +1 -1
- package/lib/testing/make-noop-shared-services.d.ts +14 -0
- package/lib/testing/make-noop-shared-services.d.ts.map +1 -1
- package/lib/testing/make-noop-shared-services.js +28 -2
- package/lib/testing/make-noop-shared-services.js.map +1 -1
- package/lib/testing/make-test-services.d.ts +61 -13
- package/lib/testing/make-test-services.d.ts.map +1 -1
- package/lib/testing/make-test-services.js +25 -5
- package/lib/testing/make-test-services.js.map +1 -1
- package/lib/testing/node/index.d.ts +1 -0
- package/lib/testing/node/index.d.ts.map +1 -1
- package/lib/testing/node/index.js +1 -0
- package/lib/testing/node/index.js.map +1 -1
- package/lib/testing/node/lsp-harness.d.ts.map +1 -1
- package/lib/testing/node/lsp-harness.js +2 -0
- package/lib/testing/node/lsp-harness.js.map +1 -1
- package/lib/testing/node/lsp-server-connection.d.ts +11 -3
- package/lib/testing/node/lsp-server-connection.d.ts.map +1 -1
- package/lib/testing/node/lsp-server-connection.js +42 -9
- package/lib/testing/node/lsp-server-connection.js.map +1 -1
- package/lib/testing/node/scratch-workspace.d.ts.map +1 -1
- package/lib/testing/node/scratch-workspace.js +10 -5
- package/lib/testing/node/scratch-workspace.js.map +1 -1
- package/lib/testing/node/spawned-server.d.ts +14 -0
- package/lib/testing/node/spawned-server.d.ts.map +1 -1
- package/lib/testing/node/spawned-server.js +33 -1
- package/lib/testing/node/spawned-server.js.map +1 -1
- package/lib/testing/node/unhandled-rejections.d.ts +20 -0
- package/lib/testing/node/unhandled-rejections.d.ts.map +1 -0
- package/lib/testing/node/unhandled-rejections.js +32 -0
- package/lib/testing/node/unhandled-rejections.js.map +1 -0
- package/lib/testing/playwright/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 +14 -4
- package/lib/testing/playwright/server-log-capture.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-capture.js +21 -4
- package/lib/testing/playwright/server-log-capture.js.map +1 -1
- package/lib/testing/playwright/server-log-rename-reporter.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-rename-reporter.js +10 -1
- package/lib/testing/playwright/server-log-rename-reporter.js.map +1 -1
- package/lib/testing/run-update-pipeline.d.ts +4 -4
- package/lib/testing/run-update-pipeline.d.ts.map +1 -1
- package/lib/testing/stub-ast-document-manager.d.ts +10 -9
- package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
- package/lib/testing/stub-ast-document-manager.js +8 -9
- package/lib/testing/stub-ast-document-manager.js.map +1 -1
- package/lib/testing/stub-document-builder.d.ts +8 -0
- package/lib/testing/stub-document-builder.d.ts.map +1 -1
- package/lib/testing/stub-document-builder.js +22 -3
- package/lib/testing/stub-document-builder.js.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.d.ts +19 -6
- package/lib/testing/stub-hydranium-text-documents.d.ts.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.js +53 -15
- package/lib/testing/stub-hydranium-text-documents.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 +7 -6
- 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/util/connection-liveness.d.ts +7 -6
- package/lib/util/connection-liveness.d.ts.map +1 -1
- package/lib/util/connection-liveness.js +35 -14
- package/lib/util/connection-liveness.js.map +1 -1
- package/package.json +17 -8
- package/src/documents/ast-document-manager.ts +188 -45
- package/src/documents/client-ids.ts +5 -22
- package/src/documents/client-session-errors.ts +22 -0
- package/src/documents/client-session-registry.ts +237 -0
- package/src/documents/file-system-task-queue.ts +68 -0
- package/src/documents/hydranium-text-documents.ts +724 -142
- package/src/documents/index.ts +3 -0
- package/src/documents/language-client-text-shadow.ts +59 -11
- package/src/documents/self-save-registry.ts +52 -13
- package/src/index.ts +6 -0
- package/src/langium/ast-extension/ast-node-builder.ts +66 -22
- package/src/langium/bootstrap.ts +16 -9
- package/src/langium/config/configuration-provider.ts +119 -0
- package/src/langium/config/index.ts +1 -0
- package/src/langium/diagnostics/lsp-logger.ts +41 -6
- package/src/langium/document-builder/build-pipeline-integration.ts +50 -5
- package/src/langium/document-builder/build-session.ts +87 -0
- package/src/langium/document-builder/document-builder.ts +355 -13
- package/src/langium/document-builder/index.ts +1 -0
- package/src/langium/integration-services.ts +67 -6
- package/src/langium/integrity/integrity-rule.ts +13 -5
- package/src/langium/integrity/integrity-service.ts +201 -17
- package/src/langium/keys/containment.ts +87 -0
- package/src/langium/keys/index.ts +1 -0
- package/src/langium/keys/name-based-key-provider.ts +4 -0
- package/src/langium/language-module.ts +42 -4
- package/src/langium/model-service/client-session.ts +581 -0
- package/src/langium/model-service/index.ts +1 -0
- package/src/langium/model-service/model-service.ts +332 -274
- package/src/langium/module.ts +119 -22
- package/src/langium/naming/name-provider.ts +27 -5
- package/src/langium/naming/name-separator-validation.ts +34 -5
- package/src/langium/residency/cst-residency-service.ts +36 -14
- package/src/langium/scope/hydranium-scope-provider.ts +60 -22
- package/src/langium/serialization/abstract-serializer.ts +13 -32
- package/src/langium/service-registry.ts +19 -2
- package/src/langium/shared-services.ts +19 -2
- package/src/langium/transfer/transfer-encoder.ts +85 -24
- package/src/langium/trivia/comment-preserver.ts +1100 -0
- package/src/langium/trivia/document-ending-preserver.ts +55 -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 +54 -0
- package/src/langium/trivia/trivia-service.ts +99 -0
- package/src/langium/update-rewrite/update-rewrite.ts +1 -1
- package/src/langium/validation/document-validator.ts +537 -11
- package/src/langium/workspace/document-uri-policy.ts +3 -4
- package/src/langium/workspace/file-system-provider.ts +48 -8
- package/src/langium/workspace/hydranium-langium-document-factory.ts +34 -0
- package/src/langium/workspace/hydranium-workspace-manager.ts +30 -1
- package/src/langium/workspace/in-memory-file-system-provider.ts +62 -10
- package/src/langium/workspace/initialize-workspace.ts +43 -5
- package/src/langium/workspace/langium-documents.ts +106 -33
- package/src/langium/workspace/virtual-document.ts +21 -3
- package/src/langium/workspace/write-lock-scope.ts +1 -1
- package/src/locale/index.ts +10 -0
- package/src/locale/server-locale.ts +86 -0
- package/src/lsp/completion/hydranium-completion-provider.ts +82 -2
- package/src/lsp/connection-features.ts +67 -0
- package/src/lsp/diagnostics-connection.ts +56 -0
- package/src/lsp/hydranium-document-update-handler.ts +152 -79
- package/src/lsp/index.ts +3 -1
- package/src/lsp/lsp-latency.ts +62 -0
- package/src/lsp/semantic-token-provider.ts +74 -7
- package/src/lsp/shared-module.ts +4 -8
- package/src/lsp/start-language-server.ts +13 -7
- package/src/messages/carriers.ts +78 -0
- package/src/messages/index.ts +36 -0
- package/src/messages/renderer.ts +212 -0
- package/src/node/heap-ceiling.ts +108 -0
- package/src/node/index.ts +1 -0
- package/src/node/latency-from-env.ts +1 -1
- package/src/node/measure-memory.ts +1 -0
- package/src/node/node-file-system-provider.ts +154 -47
- package/src/node/profile-capture.ts +8 -2
- package/src/node/profiling-run.ts +3 -3
- package/src/node/rename-over-open-readers.ts +78 -0
- package/src/node/socket-launcher.ts +18 -2
- package/src/testing/fake-document.ts +24 -5
- package/src/testing/make-noop-shared-services.ts +50 -2
- package/src/testing/make-test-services.ts +99 -24
- package/src/testing/node/index.ts +1 -0
- package/src/testing/node/lsp-harness.ts +2 -0
- package/src/testing/node/lsp-server-connection.ts +61 -11
- package/src/testing/node/scratch-workspace.ts +10 -5
- package/src/testing/node/spawned-server.ts +35 -1
- package/src/testing/node/unhandled-rejections.ts +31 -0
- 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 +24 -5
- package/src/testing/playwright/server-log-rename-reporter.ts +12 -1
- package/src/testing/run-update-pipeline.ts +4 -4
- package/src/testing/stub-ast-document-manager.ts +18 -31
- package/src/testing/stub-document-builder.ts +32 -3
- package/src/testing/stub-hydranium-text-documents.ts +78 -21
- package/src/testing/stub-langium-documents.ts +3 -2
- package/src/testing/stub-model-service.ts +9 -8
- package/src/util/connection-liveness.ts +37 -14
- 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/src/lsp/instrument-connection.ts +0 -66
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
-
import {
|
|
9
|
+
import { DefaultModelService } from '../langium/model-service/model-service.js';
|
|
10
10
|
/**
|
|
11
11
|
* Implementation detail of {@link makeStubModelService}. A {@link ModelService}
|
|
12
12
|
* subclass that takes `serialize` as a constructor callback — the test stub
|
|
@@ -14,7 +14,7 @@ import { ModelService } from '../langium/model-service/model-service.js';
|
|
|
14
14
|
* path would fail. Construct it through the factory; the {@link StubModelService}
|
|
15
15
|
* type alias is the public type name.
|
|
16
16
|
*/
|
|
17
|
-
class StubModelServiceImpl extends
|
|
17
|
+
class StubModelServiceImpl extends DefaultModelService {
|
|
18
18
|
serializeFn;
|
|
19
19
|
constructor(services, serializeFn, options) {
|
|
20
20
|
super(services, options);
|
|
@@ -32,8 +32,8 @@ class StubModelServiceImpl extends ModelService {
|
|
|
32
32
|
* `makeTestServices` wires this stub automatically.
|
|
33
33
|
*
|
|
34
34
|
* `options` are the framework {@link ModelServiceOptions}, forwarded verbatim, so
|
|
35
|
-
* a test can exercise an option-gated code path (`serializeBuilds
|
|
36
|
-
*
|
|
35
|
+
* a test can exercise an option-gated code path (`serializeBuilds`) without
|
|
36
|
+
* hand-rolling a subclass just to reach the constructor.
|
|
37
37
|
*
|
|
38
38
|
* Adopters that need richer override behaviour — the framework's own extension
|
|
39
39
|
* surface is {@link ModelService.rewriteModel} alongside `serialize` — should
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stub-model-service.js","sourceRoot":"","sources":["../../src/testing/stub-model-service.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;
|
|
1
|
+
{"version":3,"file":"stub-model-service.js","sourceRoot":"","sources":["../../src/testing/stub-model-service.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAKlF,OAAO,EAAE,mBAAmB,EAA+C,MAAM,2CAA2C,CAAC;AAG7H;;;;;;GAMG;AACH,MAAM,oBAIJ,SAAQ,mBAAiD;IAGlC;IAFtB,YACG,QAA8B,EACX,WAAqD,EACxE,OAA6B;QAE7B,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAHN,gBAAW,GAAX,WAAW,CAA0C;IAI3E,CAAC;IAEkB,SAAS,CAAC,GAAW,EAAE,IAAe;QACtD,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACtC,CAAC;CACH;AASD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,oBAAoB,CAKjC,QAA8B,EAC9B,SAAmD,EACnD,OAA6B;IAE7B,OAAO,IAAI,oBAAoB,CAA+B,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAC/F,CAAC"}
|
|
@@ -10,12 +10,13 @@
|
|
|
10
10
|
* Whether `err` means "the peer is gone", as opposed to a genuine failure of
|
|
11
11
|
* the operation.
|
|
12
12
|
*
|
|
13
|
-
* The
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
13
|
+
* The two are indistinguishable at the call site otherwise, and callers act on
|
|
14
|
+
* the answer: a gone peer is logged at `debug` or dropped, a genuine failure is
|
|
15
|
+
* logged at `error` or re-raised as an unhandled rejection. Pushing an edit to
|
|
16
|
+
* a language client that has already disconnected is a no-op, not a fault — it
|
|
17
|
+
* happens on every ordinary shutdown — so a `false` here turns routine teardown
|
|
18
|
+
* into errors that look like they need investigation. A `true` for a real
|
|
19
|
+
* `applyEdit` failure (the client refused, the request malformed) hides it.
|
|
19
20
|
*
|
|
20
21
|
* Callers that only need to *survive* a dead connection rather than classify it
|
|
21
22
|
* should just catch — see `LspLogger.emit`, whose fallback path does exactly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-liveness.d.ts","sourceRoot":"","sources":["../../src/util/connection-liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;
|
|
1
|
+
{"version":3,"file":"connection-liveness.d.ts","sourceRoot":"","sources":["../../src/util/connection-liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAuClF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAO3D"}
|
|
@@ -7,38 +7,59 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
/**
|
|
10
|
-
* Phrases
|
|
11
|
-
*
|
|
10
|
+
* Phrases that mean a call lost its connection. Matched on the message because
|
|
11
|
+
* the condition surfaces in shapes that share no discriminator:
|
|
12
12
|
*
|
|
13
13
|
* - a **throw** from `throwIfClosedOrDisposed` (`Connection is disposed.` /
|
|
14
14
|
* `Connection is closed.`), a `ConnectionError` raised synchronously by
|
|
15
15
|
* `sendRequest` / `sendNotification` and by `RemoteConsole.send`;
|
|
16
16
|
* - a **rejection** of an already-issued request (`Pending response rejected
|
|
17
17
|
* since connection got disposed`), a `ResponseError` produced when the
|
|
18
|
-
* pending-response map is drained on teardown
|
|
18
|
+
* pending-response map is drained on teardown;
|
|
19
|
+
* - a **write into a destroyed transport** (`Cannot call write after a stream
|
|
20
|
+
* was destroyed`), Node's own error for a message the writer queued before
|
|
21
|
+
* the connection was disposed and flushed after its stream was destroyed.
|
|
22
|
+
* A notification rejects with Node's error itself, which
|
|
23
|
+
* {@link isDestroyedStreamError} catches by its code; a request rejects with
|
|
24
|
+
* a `ResponseError` that copies only the message, so the phrase is needed
|
|
25
|
+
* too.
|
|
19
26
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
27
|
+
* The typed errors come from different classes carrying codes from different
|
|
28
|
+
* enums, so no single code check covers them. Kept lowercase-normalised and
|
|
29
|
+
* anchored on `connection` or `stream` so an unrelated "disposed" message
|
|
30
|
+
* cannot match.
|
|
24
31
|
*/
|
|
25
|
-
const CONNECTION_GONE_PATTERNS = [
|
|
32
|
+
const CONNECTION_GONE_PATTERNS = [
|
|
33
|
+
/connection is disposed/,
|
|
34
|
+
/connection is closed/,
|
|
35
|
+
/connection got disposed/,
|
|
36
|
+
/connection got closed/,
|
|
37
|
+
/after a stream was destroyed/
|
|
38
|
+
];
|
|
39
|
+
const DESTROYED_STREAM_CODE = 'ERR_STREAM_DESTROYED';
|
|
40
|
+
function isDestroyedStreamError(err) {
|
|
41
|
+
return err instanceof Error && 'code' in err && err.code === DESTROYED_STREAM_CODE;
|
|
42
|
+
}
|
|
26
43
|
/**
|
|
27
44
|
* Whether `err` means "the peer is gone", as opposed to a genuine failure of
|
|
28
45
|
* the operation.
|
|
29
46
|
*
|
|
30
|
-
* The
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
47
|
+
* The two are indistinguishable at the call site otherwise, and callers act on
|
|
48
|
+
* the answer: a gone peer is logged at `debug` or dropped, a genuine failure is
|
|
49
|
+
* logged at `error` or re-raised as an unhandled rejection. Pushing an edit to
|
|
50
|
+
* a language client that has already disconnected is a no-op, not a fault — it
|
|
51
|
+
* happens on every ordinary shutdown — so a `false` here turns routine teardown
|
|
52
|
+
* into errors that look like they need investigation. A `true` for a real
|
|
53
|
+
* `applyEdit` failure (the client refused, the request malformed) hides it.
|
|
36
54
|
*
|
|
37
55
|
* Callers that only need to *survive* a dead connection rather than classify it
|
|
38
56
|
* should just catch — see `LspLogger.emit`, whose fallback path does exactly
|
|
39
57
|
* that, since a logger has nowhere to report a logging failure anyway.
|
|
40
58
|
*/
|
|
41
59
|
export function isConnectionGoneError(err) {
|
|
60
|
+
if (isDestroyedStreamError(err)) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
42
63
|
const message = err instanceof Error ? err.message : String(err);
|
|
43
64
|
const normalized = message.toLowerCase();
|
|
44
65
|
return CONNECTION_GONE_PATTERNS.some(pattern => pattern.test(normalized));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection-liveness.js","sourceRoot":"","sources":["../../src/util/connection-liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF
|
|
1
|
+
{"version":3,"file":"connection-liveness.js","sourceRoot":"","sources":["../../src/util/connection-liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,wBAAwB,GAAG;IAC9B,wBAAwB;IACxB,sBAAsB;IACtB,yBAAyB;IACzB,uBAAuB;IACvB,8BAA8B;CAChC,CAAC;AAEF,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD,SAAS,sBAAsB,CAAC,GAAY;IACzC,OAAO,GAAG,YAAY,KAAK,IAAI,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,KAAK,qBAAqB,CAAC;AACtF,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAY;IAC/C,IAAI,sBAAsB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACf,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;AAC7E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/core",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.123",
|
|
4
4
|
"description": "Foundational runtime of the hydranium framework: AST coordination layer (services, integrity, AST extension, serialization, multi-client documents) plus the LSP textual head at the /lsp subpath. Consumed by protocol-head packages (@hydranium/data-server, @hydranium/glsp-server).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hydranium",
|
|
@@ -72,6 +72,14 @@
|
|
|
72
72
|
"./lib/testing/playwright": {
|
|
73
73
|
"types": "./lib/testing/playwright/index.d.ts",
|
|
74
74
|
"default": "./lib/testing/playwright/index.js"
|
|
75
|
+
},
|
|
76
|
+
"./messages": {
|
|
77
|
+
"types": "./lib/messages/index.d.ts",
|
|
78
|
+
"default": "./lib/messages/index.js"
|
|
79
|
+
},
|
|
80
|
+
"./lib/messages": {
|
|
81
|
+
"types": "./lib/messages/index.d.ts",
|
|
82
|
+
"default": "./lib/messages/index.js"
|
|
75
83
|
}
|
|
76
84
|
},
|
|
77
85
|
"main": "lib/index.js",
|
|
@@ -96,8 +104,8 @@
|
|
|
96
104
|
"diff": "^5.2.0"
|
|
97
105
|
},
|
|
98
106
|
"devDependencies": {
|
|
99
|
-
"@hydranium/langium": "1.0.0-next.
|
|
100
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
107
|
+
"@hydranium/langium": "1.0.0-next.123",
|
|
108
|
+
"@hydranium/protocol": "1.0.0-next.123",
|
|
101
109
|
"@playwright/test": "^1.40.0",
|
|
102
110
|
"@types/diff": "^5.2.0",
|
|
103
111
|
"rimraf": "^5.0.0",
|
|
@@ -109,12 +117,12 @@
|
|
|
109
117
|
"vscode-languageserver-types": "^3.17.5"
|
|
110
118
|
},
|
|
111
119
|
"peerDependencies": {
|
|
112
|
-
"@hydranium/langium": "1.0.0-next.
|
|
113
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
120
|
+
"@hydranium/langium": "1.0.0-next.123",
|
|
121
|
+
"@hydranium/protocol": "1.0.0-next.123",
|
|
114
122
|
"@playwright/test": "^1.40.0",
|
|
115
|
-
"vscode-jsonrpc": "
|
|
116
|
-
"vscode-languageserver": "
|
|
117
|
-
"vscode-languageserver-protocol": "
|
|
123
|
+
"vscode-jsonrpc": "9.0.1",
|
|
124
|
+
"vscode-languageserver": "~10.0.1",
|
|
125
|
+
"vscode-languageserver-protocol": "~3.18.1",
|
|
118
126
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
119
127
|
"vscode-languageserver-types": "^3.17.5"
|
|
120
128
|
},
|
|
@@ -129,6 +137,7 @@
|
|
|
129
137
|
"publishConfig": {
|
|
130
138
|
"access": "public"
|
|
131
139
|
},
|
|
140
|
+
"//peerDependencies": "`vscode-jsonrpc` is EXACT rather than a range, because it is one link of an atomic chain with no independently movable link: `vscode-languageserver-protocol` depends on it at exactly 9.0.1, so any other value an adopter supplies is a SECOND physical copy rather than an upgrade. This wire stack breaks on copy identity rather than on structure — `ParameterStructures.auto` is a singleton compared by `===` in connection.js, so a request type built by one copy and sent over a connection owned by the other throws `Unknown parameter structure auto`. A caret or union range was rejected because npm then resolves a `vscode-jsonrpc@8.2.0` tree SILENTLY, with no diagnostic at all, and the failure surfaces only later at server init. Exact does not fail the install either — npm downgrades an unsatisfiable peer to a warning — but it is a NAMED ERESOLVE warning printing the required version beside the found one, and a hard error for anyone installing with `--strict-peer-deps`. It does NOT prevent a NESTED copy — `@eclipse-glsp/*` carries its own exact `vscode-jsonrpc@8.2.0` dependency and root `overrides` do not ship — so a consumer of the GLSP head must pin the chain in its own manifest, and docs/adopting/requirements.md carries the block to paste. This manifest declares the two links ABOVE the transport as well, and they carry `~` for the same reason: each admits exactly what `langium@4.3.1` itself admits, and a wider range reaches a `vscode-languageserver@9` / `vscode-languageserver-protocol@3.17.x` that depends on the 8.x transport, which is the same split one level up. `vscode-languageserver-types` and `vscode-languageserver-textdocument` are deliberately NOT narrowed: both declare zero dependencies and expose structural APIs, so a duplicate of either drags no transport in and no identity check reads it.",
|
|
132
141
|
"//prepack": "The publish guard, and it deliberately is NOT a `prepare`: npm runs a workspace `prepare` BEFORE the root `postinstall` that applies patches/vscode-jsonrpc+9.0.1.patch, so building there fails on a cold clone and npm rolls the entire install back. `prepack` runs only when a tarball is made (`npm pack`, `npm publish`) and never on install, so it cannot break the install it has no business touching. It FAILS rather than rebuilds, because the rebuild is exactly the part that ordering defeats. What it defends against: `files` lists `lib`, `lib` is gitignored, and a `files` entry matching nothing is skipped SILENTLY — so `npm publish` from an unbuilt tree emits a tarball of `src` and nothing else, with no error.",
|
|
133
142
|
"//sideEffects": "NOT `false`: two barrels do work at module load that their re-exports do not account for, and a bundler skips an unflagged re-export barrel outright. `node/index.js` calls `installNodeLogFileSink()` and `installNodeWriteLockScope()`, which is how a Node host gets the log file-tee and write-lock reentrancy detection merely by importing `@hydranium/core/node`. `util/index.js` carries a bare `import '@hydranium/langium'` so the `UriUtils` namespace augmentation stays loaded for anything importing from here. Both failures are runtime-only and silent — a missing log file, a `UriUtils.toUri` that is `undefined`."
|
|
134
143
|
}
|
|
@@ -8,11 +8,14 @@
|
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
|
+
type CanonicalUri,
|
|
11
12
|
type CloseModelArgs,
|
|
12
13
|
type Tracer,
|
|
13
14
|
type TransferSavedEvent,
|
|
14
15
|
type TransferUpdatedEvent,
|
|
15
|
-
type OpenModelArgs
|
|
16
|
+
type OpenModelArgs,
|
|
17
|
+
asSnapshotVersion,
|
|
18
|
+
type SnapshotVersion
|
|
16
19
|
} from '@hydranium/protocol';
|
|
17
20
|
import {
|
|
18
21
|
type AstNode,
|
|
@@ -24,6 +27,7 @@ import {
|
|
|
24
27
|
UriUtils
|
|
25
28
|
} from '@hydranium/langium';
|
|
26
29
|
import { type LogNameOptions } from '../langium/diagnostics/logger.js';
|
|
30
|
+
import { type AstDiagnostic } from '../langium/validation/document-validator.js';
|
|
27
31
|
|
|
28
32
|
/**
|
|
29
33
|
* File-system provider extension that supports writes. Langium's standard
|
|
@@ -102,19 +106,18 @@ export interface UpdateInfo {
|
|
|
102
106
|
* twins; the type-system distinction is the generic constraint, and the
|
|
103
107
|
* conversion seam between them is the framework `TransferEncoder`.
|
|
104
108
|
*/
|
|
105
|
-
export interface AstDocument<TAst extends AstNode, TDiagnostic> {
|
|
109
|
+
export interface AstDocument<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic> {
|
|
106
110
|
root: TAst;
|
|
107
111
|
diagnostics: TDiagnostic[];
|
|
108
112
|
uri: string;
|
|
109
113
|
/**
|
|
110
114
|
* Text-document version this snapshot was taken at — read from
|
|
111
115
|
* `LangiumDocument.textDocument.version`. Symmetric with
|
|
112
|
-
* `TransferDocument.version` on the wire side: in-process
|
|
113
|
-
*
|
|
114
|
-
* `
|
|
115
|
-
* into the conflict gate.
|
|
116
|
+
* `TransferDocument.version` on the wire side: an in-process caller that
|
|
117
|
+
* holds an `AstDocument` and mutates it sends this straight back as the
|
|
118
|
+
* `basedOn` of its session's write, and the conflict gate arms on it.
|
|
116
119
|
*/
|
|
117
|
-
version:
|
|
120
|
+
version: SnapshotVersion;
|
|
118
121
|
}
|
|
119
122
|
|
|
120
123
|
export namespace AstDocument {
|
|
@@ -124,13 +127,13 @@ export namespace AstDocument {
|
|
|
124
127
|
* don't need to repeat the empty array at every call site. Mirrors
|
|
125
128
|
* `TransferDocument.create` on the wire side.
|
|
126
129
|
*/
|
|
127
|
-
export function create<TAst extends AstNode, TDiagnostic =
|
|
130
|
+
export function create<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic>(
|
|
128
131
|
uri: string,
|
|
129
132
|
version: number,
|
|
130
133
|
root: TAst,
|
|
131
134
|
diagnostics: TDiagnostic[] = []
|
|
132
135
|
): AstDocument<TAst, TDiagnostic> {
|
|
133
|
-
return { uri, version, root, diagnostics };
|
|
136
|
+
return { uri, version: asSnapshotVersion(version), root, diagnostics };
|
|
134
137
|
}
|
|
135
138
|
|
|
136
139
|
/**
|
|
@@ -146,25 +149,85 @@ export namespace AstDocument {
|
|
|
146
149
|
* carry that identity, not the subscriber's (possibly non-canonical) URI:
|
|
147
150
|
* a subscriber already knows the URI it subscribed with, so the useful
|
|
148
151
|
* thing to surface is the canonical one every other layer keys by.
|
|
152
|
+
*
|
|
153
|
+
* Narrowing `TDiagnostic` below the constraint asserts that the validators
|
|
154
|
+
* in play produce that shape, and nothing here checks it: the build fills the
|
|
155
|
+
* array, so a document carrying a diagnostic from elsewhere — a lexer error,
|
|
156
|
+
* another validator — satisfies the declared type and not the narrowed one.
|
|
149
157
|
*/
|
|
150
|
-
export function from<TAst extends AstNode, TDiagnostic =
|
|
158
|
+
export function from<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic>(
|
|
159
|
+
document: LangiumDocument
|
|
160
|
+
): AstDocument<TAst, TDiagnostic> {
|
|
151
161
|
return create<TAst, TDiagnostic>(
|
|
152
162
|
document.textDocument.uri,
|
|
153
163
|
document.textDocument.version,
|
|
154
164
|
document.parseResult.value as TAst,
|
|
155
|
-
(document.diagnostics ?? []) as
|
|
165
|
+
(document.diagnostics ?? []) as TDiagnostic[]
|
|
156
166
|
);
|
|
157
167
|
}
|
|
158
168
|
}
|
|
159
169
|
|
|
160
170
|
/** Update event delivered by {@link AstDocumentManager.onUpdate} — typed alias over the generic event wrapper. */
|
|
161
|
-
export type AstDocumentUpdatedEvent<TAst extends AstNode, TDiagnostic> = TransferUpdatedEvent<
|
|
171
|
+
export type AstDocumentUpdatedEvent<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic> = TransferUpdatedEvent<
|
|
172
|
+
AstDocument<TAst, TDiagnostic>
|
|
173
|
+
>;
|
|
162
174
|
|
|
163
175
|
/** Save event delivered by {@link AstDocumentManager.onSave} — typed alias over the generic event wrapper. */
|
|
164
|
-
export type AstDocumentSavedEvent<TAst extends AstNode, TDiagnostic> = TransferSavedEvent<
|
|
176
|
+
export type AstDocumentSavedEvent<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic> = TransferSavedEvent<
|
|
177
|
+
AstDocument<TAst, TDiagnostic>
|
|
178
|
+
>;
|
|
165
179
|
|
|
166
180
|
/** Construction options for {@link AstDocumentManager}. */
|
|
167
|
-
export
|
|
181
|
+
export interface AstDocumentManagerOptions extends LogNameOptions {
|
|
182
|
+
/**
|
|
183
|
+
* Skip a queued save of a URI when a newer save of it is queued behind. The
|
|
184
|
+
* newer save took its text later, so disk ends the same with fewer writes.
|
|
185
|
+
* A skipped save announces nothing and takes the newer save's outcome: it
|
|
186
|
+
* resolves when that one lands and rejects with its error when it fails,
|
|
187
|
+
* since disk then holds neither text. Defaults to `false`: every save
|
|
188
|
+
* writes. The framework binds the manager without options, so turning this
|
|
189
|
+
* on means rebinding `AstDocumentManager` with them.
|
|
190
|
+
*/
|
|
191
|
+
readonly coalesceSaves?: boolean;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* The document slot the model server and the integrity service talk to:
|
|
196
|
+
* open/close/update/save plus the AST-typed event streams, with the LSP
|
|
197
|
+
* plumbing hidden.
|
|
198
|
+
*
|
|
199
|
+
* Generic over `<TAst extends AstNode, TDiagnostic>` so each consumer projects
|
|
200
|
+
* its own AST root type and diagnostic shape into the emitted
|
|
201
|
+
* {@link AstDocument} envelopes.
|
|
202
|
+
*
|
|
203
|
+
* **URI contract.** Every URI-accepting member takes a URI in *any* spelling
|
|
204
|
+
* (canonical, symlinked, `..`/case-divergent) and canonicalizes internally
|
|
205
|
+
* through the {@link DocumentUriPolicy}, so a caller never has to canonicalize
|
|
206
|
+
* first and an implementation may not require it.
|
|
207
|
+
*/
|
|
208
|
+
export interface AstDocumentManager<TAst extends AstNode, TDiagnostic extends AstDiagnostic = AstDiagnostic> {
|
|
209
|
+
open(args: OpenModelArgs): Promise<Disposable>;
|
|
210
|
+
close(args: CloseModelArgs): Promise<void>;
|
|
211
|
+
isOpen(uri: string): boolean;
|
|
212
|
+
|
|
213
|
+
/** Apply `text` as `clientId`'s edit. Resolves to the resulting text-document version. */
|
|
214
|
+
update(uri: string, text: string, clientId: string): Promise<number>;
|
|
215
|
+
/**
|
|
216
|
+
* Write the document's current text to disk through `FileSystemTaskQueue`.
|
|
217
|
+
* The text is taken when this is called, so saves of one file land in the
|
|
218
|
+
* order they were called.
|
|
219
|
+
*/
|
|
220
|
+
save(uri: string, clientId: string): Promise<void>;
|
|
221
|
+
|
|
222
|
+
onUpdate(uri: string, listener: (event: AstDocumentUpdatedEvent<TAst, TDiagnostic>) => void): Disposable;
|
|
223
|
+
onSave(uri: string, listener: (event: AstDocumentSavedEvent<TAst, TDiagnostic>) => void | Promise<void>): Disposable;
|
|
224
|
+
onClientClosed(uri: string, clientId: string, listener: () => void): Disposable;
|
|
225
|
+
|
|
226
|
+
getDocument(uri: string): LangiumDocument | undefined;
|
|
227
|
+
|
|
228
|
+
/** Client id that authored the document's current version, or `undefined` for a framework-internal build. */
|
|
229
|
+
getAuthor(document: LangiumDocument): string | undefined;
|
|
230
|
+
}
|
|
168
231
|
|
|
169
232
|
/**
|
|
170
233
|
* Higher-level facade over {@link HydraniumTextDocuments} that speaks the
|
|
@@ -186,9 +249,16 @@ export type AstDocumentManagerOptions = LogNameOptions;
|
|
|
186
249
|
* resolution (the egress `applyEditToLanguageClient`) stay on
|
|
187
250
|
* {@link HydraniumTextDocuments}, their owner.
|
|
188
251
|
*/
|
|
189
|
-
export class
|
|
252
|
+
export class DefaultAstDocumentManager<
|
|
253
|
+
TAst extends AstNode,
|
|
254
|
+
TDiagnostic extends AstDiagnostic = AstDiagnostic
|
|
255
|
+
> implements AstDocumentManager<TAst, TDiagnostic> {
|
|
190
256
|
protected lastUpdate?: UpdateInfo;
|
|
191
257
|
|
|
258
|
+
/** Per canonical URI, the newest save queued for it, which {@link coalesceSaves} lets older queued saves defer to. */
|
|
259
|
+
protected readonly newestSaves = new Map<CanonicalUri, Promise<void>>();
|
|
260
|
+
protected readonly coalesceSaves: boolean;
|
|
261
|
+
|
|
192
262
|
protected readonly textDocuments: HydraniumTextDocuments<TextDocument>;
|
|
193
263
|
protected readonly fileSystemProvider: WritableFileSystemProvider;
|
|
194
264
|
protected readonly langiumDocs: LangiumDocuments;
|
|
@@ -206,12 +276,19 @@ export class AstDocumentManager<TAst extends AstNode = AstNode, TDiagnostic = un
|
|
|
206
276
|
this.documentBuilder = services.workspace.DocumentBuilder;
|
|
207
277
|
this.uriPolicy = services.workspace.DocumentUriPolicy;
|
|
208
278
|
this.tracer = services.Tracer.for(options.logName ?? 'AstDocumentManager').trace('instantiated');
|
|
279
|
+
this.coalesceSaves = options.coalesceSaves ?? false;
|
|
209
280
|
this.textDocuments.onDidOpen(event =>
|
|
210
281
|
this.open({ clientId: event.clientId, uri: event.document.uri, languageId: event.document.languageId })
|
|
211
282
|
);
|
|
212
283
|
this.textDocuments.onDidClose(event => this.close({ clientId: event.clientId, uri: event.document.uri }));
|
|
213
284
|
this.documentBuilder.onUpdate((changed, deleted) => {
|
|
214
285
|
this.lastUpdate = { changed, deleted };
|
|
286
|
+
// The only place a deletion is observable: `DocumentBuilder.update`
|
|
287
|
+
// removes a deleted document before it builds anything, so no phase
|
|
288
|
+
// listener ever sees it.
|
|
289
|
+
for (const uri of deleted) {
|
|
290
|
+
this.textDocuments.notifyDocumentDeleted(uri.toString());
|
|
291
|
+
}
|
|
215
292
|
});
|
|
216
293
|
// Content transitions for CLOSED documents bypass the text store: the
|
|
217
294
|
// last-close revert and watched-file changes rebuild from disk into a
|
|
@@ -311,11 +388,12 @@ export class AstDocumentManager<TAst extends AstNode = AstNode, TDiagnostic = un
|
|
|
311
388
|
const event: TransferUpdatedEvent<AstDocument<TAst, TDiagnostic>> = {
|
|
312
389
|
document: this.toAstDocument(document),
|
|
313
390
|
sourceClientId,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
391
|
+
// No `'deleted'` arm: `DocumentBuilder.update` drops a deleted
|
|
392
|
+
// document from `LangiumDocuments` before deriving the rebuild set
|
|
393
|
+
// from it, so a deleted URI is never built and never reaches this
|
|
394
|
+
// phase listener. A subscriber needing deletions has to be told on
|
|
395
|
+
// a channel that does not require a built document.
|
|
396
|
+
reason: this.lastUpdate?.changed.some(changed => UriUtils.equals(changed, document.uri)) ? 'changed' : 'rebuilt'
|
|
319
397
|
};
|
|
320
398
|
this.tracer.with(uri).trace(`emitUpdate start: source=${sourceClientId}, reason=${event.reason}`);
|
|
321
399
|
listener(event);
|
|
@@ -328,21 +406,21 @@ export class AstDocumentManager<TAst extends AstNode = AstNode, TDiagnostic = un
|
|
|
328
406
|
* The client that authored `document`'s current version, or `undefined` when
|
|
329
407
|
* no client wrote it — a framework-internal rebuild (workspace startup, a
|
|
330
408
|
* cascade relink, a `didClose`-reload) or a genuine author gap. Honest about
|
|
331
|
-
* absence so routing
|
|
332
|
-
*
|
|
409
|
+
* absence so a routing consumer tests `undefined` directly rather than
|
|
410
|
+
* against a sentinel; the presentation
|
|
333
411
|
* default ({@link UNKNOWN_CLIENT_ID}) is applied at the boundary that needs a
|
|
334
412
|
* concrete value (the `onUpdate` event's `sourceClientId`, the data-server's
|
|
335
413
|
* `resolveSourceClientId`).
|
|
336
414
|
*/
|
|
337
|
-
getAuthor(document: LangiumDocument
|
|
415
|
+
getAuthor(document: LangiumDocument): string | undefined {
|
|
338
416
|
return this.textDocuments.getAuthor(document.textDocument.uri, document.textDocument.version);
|
|
339
417
|
}
|
|
340
418
|
|
|
341
419
|
async open(args: OpenModelArgs): Promise<Disposable> {
|
|
342
420
|
// `open()` is the RPC-level "ensure this document is loaded" call. It is issued
|
|
343
|
-
// by a
|
|
344
|
-
//
|
|
345
|
-
//
|
|
421
|
+
// by a session opening the document, including by every additional client
|
|
422
|
+
// attaching to the same URI and the several sub-editors a composite view
|
|
423
|
+
// opens. When the document is already loaded there is nothing to
|
|
346
424
|
// do here but hand back the close-disposable — callers that want the current
|
|
347
425
|
// state read it from this method's surrounding RPC response, not from a re-build.
|
|
348
426
|
//
|
|
@@ -355,7 +433,18 @@ export class AstDocumentManager<TAst extends AstNode = AstNode, TDiagnostic = un
|
|
|
355
433
|
// transiently breaks cross-document linking mid-rebuild (a dependent briefly
|
|
356
434
|
// seeing an `extends`/`type` reference unresolved). And because the constructor
|
|
357
435
|
// wires `onDidOpen -> this.open`, it would fire a second, identical rebuild on
|
|
358
|
-
// every first open.
|
|
436
|
+
// every first open.
|
|
437
|
+
//
|
|
438
|
+
// So an already-open `open()` records the attaching client's open and nothing
|
|
439
|
+
// else. The open is per `(uri, clientId)` and the last-close revert counts down
|
|
440
|
+
// to it, so skipping it lets the first client's close tear down a document
|
|
441
|
+
// another client is still reading. A document waiting out the revert grace
|
|
442
|
+
// is still loaded: a client lost from it within its own grace attaches and
|
|
443
|
+
// keeps its text, and for any other client the attach releases it, so the
|
|
444
|
+
// open reads the file.
|
|
445
|
+
if (this.isOpen(args.uri)) {
|
|
446
|
+
this.textDocuments.attachClient(args.uri, args.clientId);
|
|
447
|
+
}
|
|
359
448
|
if (!this.isOpen(args.uri)) {
|
|
360
449
|
const textDocument = await this.createDocumentFromTextOrFileSystem(args.uri, args.languageId, args.version, args.text);
|
|
361
450
|
this.textDocuments.notifyDidOpenTextDocument({ textDocument }, args.clientId);
|
|
@@ -393,31 +482,80 @@ export class AstDocumentManager<TAst extends AstNode = AstNode, TDiagnostic = un
|
|
|
393
482
|
* callers don't need to pass it — the manager owns content and version
|
|
394
483
|
* sequencing.
|
|
395
484
|
*
|
|
485
|
+
* The text is taken synchronously, before the save waits in the file's task
|
|
486
|
+
* queue; the compare and the write run in the queue. Taken later, a save
|
|
487
|
+
* that waits behind another writes whatever the store holds when its turn
|
|
488
|
+
* comes, edits made after the call included, and announces that text under
|
|
489
|
+
* its own client id.
|
|
490
|
+
*
|
|
491
|
+
* **The write is skipped when the file already holds that text; the
|
|
492
|
+
* notification is not.** A save announces that the content is on disk, which
|
|
493
|
+
* is true either way — so a subscriber clearing a dirty marker or reacting to
|
|
494
|
+
* a persist behaves the same, while an mtime is not moved for byte-identical
|
|
495
|
+
* content that a downstream mtime-keyed build would then read as new work.
|
|
496
|
+
*
|
|
396
497
|
* Throws if no document is open for `uri`.
|
|
397
498
|
*/
|
|
398
499
|
async save(uri: string, clientId: string): Promise<void> {
|
|
399
|
-
|
|
500
|
+
// Canonical throughout: the write and the read that gates it must address
|
|
501
|
+
// the same file the store was keyed by, or a divergent spelling compares
|
|
502
|
+
// one file and writes another.
|
|
503
|
+
const canonical = this.uriPolicy.canonicalUri(uri);
|
|
504
|
+
const document = this.textDocuments.get(canonical);
|
|
400
505
|
if (!document) {
|
|
401
506
|
throw new Error(`Document ${uri} hasn't been opened for saving yet`);
|
|
402
507
|
}
|
|
403
508
|
const text = document.getText();
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
(
|
|
408
|
-
|
|
409
|
-
|
|
509
|
+
let supersededBy: Promise<void> | undefined;
|
|
510
|
+
const saved: Promise<void> = this.services.workspace.FileSystemTaskQueue.enqueue(canonical, async () => {
|
|
511
|
+
const newest = this.newestSaves.get(canonical);
|
|
512
|
+
if (this.coalesceSaves && newest !== saved) {
|
|
513
|
+
supersededBy = newest;
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
await this.writeSave(canonical, text, clientId);
|
|
517
|
+
})
|
|
518
|
+
.then(() => supersededBy)
|
|
519
|
+
.finally(() => {
|
|
520
|
+
if (this.newestSaves.get(canonical) === saved) {
|
|
521
|
+
this.newestSaves.delete(canonical);
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
this.newestSaves.set(canonical, saved);
|
|
525
|
+
return saved;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/** Write `text` to `uri` unless the file already holds it, then announce the save. Runs inside the file's task queue. */
|
|
529
|
+
protected async writeSave(uri: CanonicalUri, text: string, clientId: string): Promise<void> {
|
|
530
|
+
if (!(await this.matchesDisk(uri, text))) {
|
|
531
|
+
await this.tracer.with(uri).time(
|
|
532
|
+
`Write file (${text.length} bytes, from ${clientId})`,
|
|
533
|
+
// Async write so a slow disk does not block the event loop for the duration of the fs call.
|
|
534
|
+
() => this.fileSystemProvider.writeFile(UriUtils.toUri(uri), text),
|
|
535
|
+
'debug'
|
|
536
|
+
);
|
|
537
|
+
}
|
|
410
538
|
this.textDocuments.notifyDidSaveTextDocument({ textDocument: TextDocumentIdentifier.create(uri), text }, clientId);
|
|
411
539
|
}
|
|
412
540
|
|
|
413
|
-
|
|
414
|
-
|
|
541
|
+
/**
|
|
542
|
+
* Whether the file at `uri` already holds `text`.
|
|
543
|
+
*
|
|
544
|
+
* Compared by CONTENT rather than against a remembered version, so a write
|
|
545
|
+
* from outside this server is still corrected: a version this manager already
|
|
546
|
+
* saved says nothing about what is on disk now. `false` when the file cannot
|
|
547
|
+
* be read at all, which is the answer that writes — a document whose file does
|
|
548
|
+
* not exist yet is exactly the one a first save has to create.
|
|
549
|
+
*/
|
|
550
|
+
protected async matchesDisk(uri: string, text: string): Promise<boolean> {
|
|
551
|
+
return this.fileSystemProvider
|
|
552
|
+
.readFile(UriUtils.toUri(uri))
|
|
553
|
+
.then(onDisk => onDisk === text)
|
|
554
|
+
.catch(() => false);
|
|
415
555
|
}
|
|
416
556
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
const canonical = this.uriPolicy.canonicalUri(uri);
|
|
420
|
-
return this.lastUpdate?.changed.some(changed => this.uriPolicy.canonicalUri(changed) === canonical) ?? false;
|
|
557
|
+
isOpen(uri: string): boolean {
|
|
558
|
+
return !!this.textDocuments.get(uri);
|
|
421
559
|
}
|
|
422
560
|
|
|
423
561
|
/**
|
|
@@ -437,11 +575,16 @@ export class AstDocumentManager<TAst extends AstNode = AstNode, TDiagnostic = un
|
|
|
437
575
|
version = 0,
|
|
438
576
|
text?: string
|
|
439
577
|
): Promise<TextDocumentItem> {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
578
|
+
// Read in the file's task queue: a read beside a queued save of the file
|
|
579
|
+
// returns the text from before it, and the document then opens on that.
|
|
580
|
+
return {
|
|
581
|
+
uri,
|
|
582
|
+
languageId,
|
|
583
|
+
version,
|
|
584
|
+
text:
|
|
585
|
+
text ??
|
|
586
|
+
(await this.services.workspace.FileSystemTaskQueue.enqueue(uri, () => this.fileSystemProvider.readFile(UriUtils.toUri(uri))))
|
|
587
|
+
};
|
|
445
588
|
}
|
|
446
589
|
|
|
447
590
|
/**
|
|
@@ -8,26 +8,9 @@
|
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* client, and/or a structured-form client. Each kind carries a stable id so
|
|
16
|
-
* the server can route outbound corrections, edits, and notifications to the
|
|
17
|
-
* right transport.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/** Identifier for an LSP-text client (Monaco, VS Code, …). */
|
|
21
|
-
export const LANGUAGE_CLIENT_ID = 'language-client';
|
|
22
|
-
|
|
23
|
-
/** Fallback identifier when a document's author is unknown (e.g. cold workspace-init load). */
|
|
24
|
-
export const UNKNOWN_CLIENT_ID = 'unknown';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Synthetic author id on the `onDocumentUpdated` broadcast a data-server
|
|
28
|
-
* emits after the LAST client closed a document and the framework rebuilt it
|
|
29
|
-
* from its disk content (discarding unsaved in-session edits). Not a real
|
|
30
|
-
* client: it lets consumers distinguish the revert broadcast from
|
|
31
|
-
* client-authored updates.
|
|
11
|
+
* Re-export, because these are WIRE values and the side that has to recognise
|
|
12
|
+
* them is the client. They are defined in `@hydranium/protocol` so a frontend
|
|
13
|
+
* can name them without depending on the server tier; this path stays so
|
|
14
|
+
* server-side code keeps importing them from where it already does.
|
|
32
15
|
*/
|
|
33
|
-
export
|
|
16
|
+
export { FRAMEWORK_CLIENT_IDS, LANGUAGE_CLIENT_ID, REVERT_ON_CLOSE_CLIENT_ID, UNKNOWN_CLIENT_ID } from '@hydranium/protocol';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Re-export, because these errors cross the wire and the side that has to
|
|
12
|
+
* recognise them is the client. They are defined in `@hydranium/protocol` so a
|
|
13
|
+
* frontend can name them without depending on the server tier.
|
|
14
|
+
*/
|
|
15
|
+
export {
|
|
16
|
+
DocumentNotOpenError,
|
|
17
|
+
DuplicateClientIdError,
|
|
18
|
+
SessionClosedError,
|
|
19
|
+
isDocumentNotOpenError,
|
|
20
|
+
isDuplicateClientIdError,
|
|
21
|
+
isSessionClosedError
|
|
22
|
+
} from '@hydranium/protocol';
|