@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,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
|
-
import { type AstNodeDescription, type ReferenceInfo, type Stream } from '@hydranium/langium';
|
|
9
|
+
import { type AstNodeDescription, type LangiumDocument, type ReferenceInfo, type Stream } from '@hydranium/langium';
|
|
10
10
|
import { DefaultCompletionProvider, type CompletionContext, type CompletionValueItem } from '@hydranium/langium/lsp';
|
|
11
|
-
import type
|
|
11
|
+
import { CompletionList, type CancellationToken, type CompletionItem, type CompletionParams, type Position } from 'vscode-languageserver';
|
|
12
12
|
import { type ReferenceCandidateProvider } from '../../langium/scope/reference-candidate-provider.js';
|
|
13
13
|
import { type ServerLanguageServices } from '../../langium/language-module.js';
|
|
14
14
|
/**
|
|
@@ -50,10 +50,52 @@ import { type ServerLanguageServices } from '../../langium/language-module.js';
|
|
|
50
50
|
* elements. The provider owns that pipeline in one place, so the
|
|
51
51
|
* text-editor dropdown and the protocol candidate picker stay in sync; this
|
|
52
52
|
* class keeps only the LSP-specific {@link fillCompletionItem} upgrade.
|
|
53
|
+
*
|
|
54
|
+
* **A comment is not a completion site.** Langium's context builder reads the
|
|
55
|
+
* non-hidden token stream alone, so a cursor in a comment is indistinguishable
|
|
56
|
+
* from one in the whitespace between the tokens surrounding it: the grammar's
|
|
57
|
+
* follow-set goes out as keyword proposals, and none of them is filtered,
|
|
58
|
+
* because the characters the user typed belong to the hidden token and the
|
|
59
|
+
* prefix matched against is therefore empty. {@link isInsideComment} suppresses
|
|
60
|
+
* the request instead.
|
|
53
61
|
*/
|
|
54
62
|
export declare class HydraniumCompletionProvider extends DefaultCompletionProvider {
|
|
55
63
|
protected readonly candidateProvider: ReferenceCandidateProvider;
|
|
56
64
|
constructor(services: ServerLanguageServices);
|
|
65
|
+
/**
|
|
66
|
+
* Answer no proposals at all when the cursor is inside a comment.
|
|
67
|
+
*
|
|
68
|
+
* Suppressing the whole request is what makes the rule hold for every
|
|
69
|
+
* proposal kind at once. Filtering the built contexts instead has to catch
|
|
70
|
+
* each context kind the base builds separately, and a kind added upstream
|
|
71
|
+
* arrives unguarded.
|
|
72
|
+
*
|
|
73
|
+
* The list is marked incomplete so the client re-asks on the next keystroke
|
|
74
|
+
* and proposals resume the moment the cursor leaves the comment.
|
|
75
|
+
*/
|
|
76
|
+
getCompletion(document: LangiumDocument, params: CompletionParams, cancelToken?: CancellationToken): Promise<CompletionList | undefined>;
|
|
77
|
+
/**
|
|
78
|
+
* Whether `position` falls in text a comment terminal claims.
|
|
79
|
+
*
|
|
80
|
+
* The two comment kinds part company at their far edge. A single-line
|
|
81
|
+
* comment runs to the line break, so a cursor at its end offset is still in
|
|
82
|
+
* prose and that offset counts as inside. A multi-line comment is
|
|
83
|
+
* terminated, so a cursor at its end offset has passed the terminator and is
|
|
84
|
+
* back in code. A cursor ON the opening delimiter is outside either way,
|
|
85
|
+
* that offset being a legal position for whatever token the comment
|
|
86
|
+
* displaced.
|
|
87
|
+
*
|
|
88
|
+
* The hidden token stream decides rather than the CST. A leaf lookup by
|
|
89
|
+
* offset misses the position a cursor reaches by typing prose into a
|
|
90
|
+
* trailing comment, because that comment ends AT the line break and
|
|
91
|
+
* whitespace is discarded before a CST node is built over it — so the
|
|
92
|
+
* lookup answers nothing exactly where proposals are least wanted.
|
|
93
|
+
*
|
|
94
|
+
* An adopter whose comment syntax carries completable content — a
|
|
95
|
+
* documentation tag naming a type — narrows this to return `false` over that
|
|
96
|
+
* region rather than replacing {@link getCompletion}.
|
|
97
|
+
*/
|
|
98
|
+
protected isInsideComment(document: LangiumDocument, position: Position): boolean;
|
|
57
99
|
/**
|
|
58
100
|
* Delegate cross-reference candidate gathering to the candidate provider
|
|
59
101
|
* so the LSP completion dropdown applies the same filter / canonical
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-completion-provider.d.ts","sourceRoot":"","sources":["../../../src/lsp/completion/hydranium-completion-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"hydranium-completion-provider.d.ts","sourceRoot":"","sources":["../../../src/lsp/completion/hydranium-completion-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpH,OAAO,EAAE,yBAAyB,EAAE,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACrH,OAAO,EACJ,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EAErB,KAAK,QAAQ,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBAAa,2BAA4B,SAAQ,yBAAyB;IACvE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,0BAA0B,CAAC;gBAErD,QAAQ,EAAE,sBAAsB;IAK5C;;;;;;;;;;OAUG;IACY,aAAa,CACzB,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,gBAAgB,EACxB,WAAW,CAAC,EAAE,iBAAiB,GAC/B,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAOtC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO;IAsBjF;;;;;;;OAOG;cACgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAAC,kBAAkB,CAAC;cAIvG,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,mBAAmB,GAAG,cAAc,GAAG,SAAS;IAsBxH;;;;;;;;;;;;;;;;;;;OAmBG;IACH,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM;CAcnE"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
import { DefaultCompletionProvider } from '@hydranium/langium/lsp';
|
|
10
|
+
import { CompletionList } from 'vscode-languageserver';
|
|
10
11
|
/**
|
|
11
12
|
* Completion provider that upgrades Langium's default `TextEdit` to
|
|
12
13
|
* {@link InsertReplaceEdit} so accepting a suggestion over an existing token
|
|
@@ -46,6 +47,14 @@ import { DefaultCompletionProvider } from '@hydranium/langium/lsp';
|
|
|
46
47
|
* elements. The provider owns that pipeline in one place, so the
|
|
47
48
|
* text-editor dropdown and the protocol candidate picker stay in sync; this
|
|
48
49
|
* class keeps only the LSP-specific {@link fillCompletionItem} upgrade.
|
|
50
|
+
*
|
|
51
|
+
* **A comment is not a completion site.** Langium's context builder reads the
|
|
52
|
+
* non-hidden token stream alone, so a cursor in a comment is indistinguishable
|
|
53
|
+
* from one in the whitespace between the tokens surrounding it: the grammar's
|
|
54
|
+
* follow-set goes out as keyword proposals, and none of them is filtered,
|
|
55
|
+
* because the characters the user typed belong to the hidden token and the
|
|
56
|
+
* prefix matched against is therefore empty. {@link isInsideComment} suppresses
|
|
57
|
+
* the request instead.
|
|
49
58
|
*/
|
|
50
59
|
export class HydraniumCompletionProvider extends DefaultCompletionProvider {
|
|
51
60
|
candidateProvider;
|
|
@@ -53,6 +62,65 @@ export class HydraniumCompletionProvider extends DefaultCompletionProvider {
|
|
|
53
62
|
super(services);
|
|
54
63
|
this.candidateProvider = services.references.CandidateProvider;
|
|
55
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Answer no proposals at all when the cursor is inside a comment.
|
|
67
|
+
*
|
|
68
|
+
* Suppressing the whole request is what makes the rule hold for every
|
|
69
|
+
* proposal kind at once. Filtering the built contexts instead has to catch
|
|
70
|
+
* each context kind the base builds separately, and a kind added upstream
|
|
71
|
+
* arrives unguarded.
|
|
72
|
+
*
|
|
73
|
+
* The list is marked incomplete so the client re-asks on the next keystroke
|
|
74
|
+
* and proposals resume the moment the cursor leaves the comment.
|
|
75
|
+
*/
|
|
76
|
+
async getCompletion(document, params, cancelToken) {
|
|
77
|
+
if (this.isInsideComment(document, params.position)) {
|
|
78
|
+
return CompletionList.create([], true);
|
|
79
|
+
}
|
|
80
|
+
return super.getCompletion(document, params, cancelToken);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Whether `position` falls in text a comment terminal claims.
|
|
84
|
+
*
|
|
85
|
+
* The two comment kinds part company at their far edge. A single-line
|
|
86
|
+
* comment runs to the line break, so a cursor at its end offset is still in
|
|
87
|
+
* prose and that offset counts as inside. A multi-line comment is
|
|
88
|
+
* terminated, so a cursor at its end offset has passed the terminator and is
|
|
89
|
+
* back in code. A cursor ON the opening delimiter is outside either way,
|
|
90
|
+
* that offset being a legal position for whatever token the comment
|
|
91
|
+
* displaced.
|
|
92
|
+
*
|
|
93
|
+
* The hidden token stream decides rather than the CST. A leaf lookup by
|
|
94
|
+
* offset misses the position a cursor reaches by typing prose into a
|
|
95
|
+
* trailing comment, because that comment ends AT the line break and
|
|
96
|
+
* whitespace is discarded before a CST node is built over it — so the
|
|
97
|
+
* lookup answers nothing exactly where proposals are least wanted.
|
|
98
|
+
*
|
|
99
|
+
* An adopter whose comment syntax carries completable content — a
|
|
100
|
+
* documentation tag naming a type — narrows this to return `false` over that
|
|
101
|
+
* region rather than replacing {@link getCompletion}.
|
|
102
|
+
*/
|
|
103
|
+
isInsideComment(document, position) {
|
|
104
|
+
const text = document.textDocument.getText();
|
|
105
|
+
const offset = document.textDocument.offsetAt(position);
|
|
106
|
+
const multilineCommentRules = this.grammarConfig.multilineCommentRules;
|
|
107
|
+
for (const token of this.lexer.tokenize(text).hidden) {
|
|
108
|
+
if (token.startOffset >= offset) {
|
|
109
|
+
// Hidden tokens arrive in document order, so no later one reaches back over the cursor.
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
// `endOffset` is optional on the token type and the image is not, so
|
|
113
|
+
// the width comes from the image and needs no absent-value branch.
|
|
114
|
+
const endOffset = token.startOffset + token.image.length;
|
|
115
|
+
if (offset < endOffset) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
if (offset === endOffset && !multilineCommentRules.includes(token.tokenType.name)) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
56
124
|
/**
|
|
57
125
|
* Delegate cross-reference candidate gathering to the candidate provider
|
|
58
126
|
* so the LSP completion dropdown applies the same filter / canonical
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-completion-provider.js","sourceRoot":"","sources":["../../../src/lsp/completion/hydranium-completion-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,yBAAyB,EAAoD,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"hydranium-completion-provider.js","sourceRoot":"","sources":["../../../src/lsp/completion/hydranium-completion-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,yBAAyB,EAAoD,MAAM,wBAAwB,CAAC;AACrH,OAAO,EACJ,cAAc,EAMhB,MAAM,uBAAuB,CAAC;AAI/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,OAAO,2BAA4B,SAAQ,yBAAyB;IACpD,iBAAiB,CAA6B;IAEjE,YAAY,QAAgC;QACzC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,UAAU,CAAC,iBAAiB,CAAC;IAClE,CAAC;IAED;;;;;;;;;;OAUG;IACM,KAAK,CAAC,aAAa,CACzB,QAAyB,EACzB,MAAwB,EACxB,WAA+B;QAE/B,IAAI,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnD,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,KAAK,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACO,eAAe,CAAC,QAAyB,EAAE,QAAkB;QACpE,MAAM,IAAI,GAAG,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAC7C,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACxD,MAAM,qBAAqB,GAAG,IAAI,CAAC,aAAa,CAAC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AAC;QACzB,CAAC;QACD,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC;QACzC,MAAM,iBAAiB,GAAsB;YAC1C,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,MAAM,EAAE,QAAQ,CAAC,KAAK;YACtB,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;SAClG,CAAC;QACF,cAAc,CAAC,QAAQ,GAAG,iBAAiB,CAAC;QAC5C,OAAO,cAAc,CAAC;IACzB,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACO,mBAAmB,CAAC,OAA0B;QACrD,IAAI,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAC3C,OAAO,OAAO,CAAC,cAAc,CAAC;QACjC,CAAC;QACD,wEAAwE;QACxE,qDAAqD;QACrD,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;QAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;QACjD,IAAI,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;QACzB,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC7D,GAAG,EAAE,CAAC;QACT,CAAC;QACD,OAAO,GAAG,CAAC;IACd,CAAC;CACH"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
import { type Features } from 'vscode-languageserver';
|
|
10
|
+
/**
|
|
11
|
+
* Add Hydranium's connection-liveness handling to a language-server
|
|
12
|
+
* connection's console. The upstream `RemoteConsole` catches every failed log
|
|
13
|
+
* notification and prints `Sending log message failed`, so every ordinary
|
|
14
|
+
* teardown reports a failure; this console drops only a failure that
|
|
15
|
+
* {@link isConnectionGoneError} recognises and re-raises any other as an
|
|
16
|
+
* unhandled rejection.
|
|
17
|
+
*
|
|
18
|
+
* Supply it where the connection is created. `createConnection` builds the
|
|
19
|
+
* console from these features, so a connection that already exists keeps the
|
|
20
|
+
* upstream console for its whole lifetime.
|
|
21
|
+
*/
|
|
22
|
+
export declare function withHydraniumLspFeatures<T extends Features>(features: T): T;
|
|
23
|
+
//# sourceMappingURL=connection-features.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection-features.d.ts","sourceRoot":"","sources":["../../src/lsp/connection-features.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAuC,KAAK,QAAQ,EAAsB,MAAM,uBAAuB,CAAC;AAG/G;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CA0C3E"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
import { LogMessageNotification, MessageType } from 'vscode-languageserver';
|
|
10
|
+
import { isConnectionGoneError } from '../util/connection-liveness.js';
|
|
11
|
+
/**
|
|
12
|
+
* Add Hydranium's connection-liveness handling to a language-server
|
|
13
|
+
* connection's console. The upstream `RemoteConsole` catches every failed log
|
|
14
|
+
* notification and prints `Sending log message failed`, so every ordinary
|
|
15
|
+
* teardown reports a failure; this console drops only a failure that
|
|
16
|
+
* {@link isConnectionGoneError} recognises and re-raises any other as an
|
|
17
|
+
* unhandled rejection.
|
|
18
|
+
*
|
|
19
|
+
* Supply it where the connection is created. `createConnection` builds the
|
|
20
|
+
* console from these features, so a connection that already exists keeps the
|
|
21
|
+
* upstream console for its whole lifetime.
|
|
22
|
+
*/
|
|
23
|
+
export function withHydraniumLspFeatures(features) {
|
|
24
|
+
return {
|
|
25
|
+
...features,
|
|
26
|
+
console: (Base) => class extends Base {
|
|
27
|
+
error(message) {
|
|
28
|
+
this.sendLogMessage(MessageType.Error, message);
|
|
29
|
+
}
|
|
30
|
+
warn(message) {
|
|
31
|
+
this.sendLogMessage(MessageType.Warning, message);
|
|
32
|
+
}
|
|
33
|
+
info(message) {
|
|
34
|
+
this.sendLogMessage(MessageType.Info, message);
|
|
35
|
+
}
|
|
36
|
+
log(message) {
|
|
37
|
+
this.sendLogMessage(MessageType.Log, message);
|
|
38
|
+
}
|
|
39
|
+
debug(message) {
|
|
40
|
+
this.sendLogMessage(MessageType.Debug, message);
|
|
41
|
+
}
|
|
42
|
+
sendLogMessage(type, message) {
|
|
43
|
+
try {
|
|
44
|
+
void this.connection.sendNotification(LogMessageNotification.type, { type, message }).catch(error => {
|
|
45
|
+
this.handleLogSendFailure(error);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
this.handleLogSendFailure(error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
handleLogSendFailure(error) {
|
|
53
|
+
if (!isConnectionGoneError(error)) {
|
|
54
|
+
void Promise.reject(error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=connection-features.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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KAAK,EAAE,CAAC;oBACd,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBACpC,CAAC;YACJ,CAAC;YAEO,oBAAoB,CAAC,KAAc;gBACxC,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC;oBACjC,KAAK,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC9B,CAAC;YACJ,CAAC;SACH;KACD,CAAC;AACV,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
import type { Connection } from 'vscode-languageserver';
|
|
10
|
+
/**
|
|
11
|
+
* Protect Langium's fire-and-forget diagnostics publish from the expected
|
|
12
|
+
* failure caused by a peer disconnecting during teardown.
|
|
13
|
+
*
|
|
14
|
+
* A publish issued after the connection is disposed throws synchronously
|
|
15
|
+
* instead of rejecting, and Langium's publisher is a document-phase listener,
|
|
16
|
+
* so an unguarded throw fails the build that validated the document. The
|
|
17
|
+
* `try` answers that case with a resolved promise; a guard on the promise
|
|
18
|
+
* alone never sees it.
|
|
19
|
+
*
|
|
20
|
+
* Otherwise the original promise is returned unchanged. The detached catch is
|
|
21
|
+
* deliberate: it marks the original promise as observed, suppresses only the
|
|
22
|
+
* expected connection-liveness error, and rethrows unexpected failures so they
|
|
23
|
+
* stay visible as unhandled rejections, as an unguarded fire-and-forget send
|
|
24
|
+
* would leave them.
|
|
25
|
+
*/
|
|
26
|
+
export declare function guardDiagnosticsConnection(connection: Connection): void;
|
|
27
|
+
//# sourceMappingURL=diagnostics-connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics-connection.d.ts","sourceRoot":"","sources":["../../src/lsp/diagnostics-connection.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKxD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAyBvE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
import { isConnectionGoneError } from '../util/connection-liveness.js';
|
|
10
|
+
const wrappedConnections = new WeakSet();
|
|
11
|
+
/**
|
|
12
|
+
* Protect Langium's fire-and-forget diagnostics publish from the expected
|
|
13
|
+
* failure caused by a peer disconnecting during teardown.
|
|
14
|
+
*
|
|
15
|
+
* A publish issued after the connection is disposed throws synchronously
|
|
16
|
+
* instead of rejecting, and Langium's publisher is a document-phase listener,
|
|
17
|
+
* so an unguarded throw fails the build that validated the document. The
|
|
18
|
+
* `try` answers that case with a resolved promise; a guard on the promise
|
|
19
|
+
* alone never sees it.
|
|
20
|
+
*
|
|
21
|
+
* Otherwise the original promise is returned unchanged. The detached catch is
|
|
22
|
+
* deliberate: it marks the original promise as observed, suppresses only the
|
|
23
|
+
* expected connection-liveness error, and rethrows unexpected failures so they
|
|
24
|
+
* stay visible as unhandled rejections, as an unguarded fire-and-forget send
|
|
25
|
+
* would leave them.
|
|
26
|
+
*/
|
|
27
|
+
export function guardDiagnosticsConnection(connection) {
|
|
28
|
+
if (wrappedConnections.has(connection)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
wrappedConnections.add(connection);
|
|
32
|
+
const sendDiagnostics = connection.sendDiagnostics.bind(connection);
|
|
33
|
+
connection.sendDiagnostics = params => {
|
|
34
|
+
let result;
|
|
35
|
+
try {
|
|
36
|
+
result = sendDiagnostics(params);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (isConnectionGoneError(error)) {
|
|
40
|
+
return Promise.resolve();
|
|
41
|
+
}
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
void result.catch(error => {
|
|
45
|
+
if (isConnectionGoneError(error)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
throw error;
|
|
49
|
+
});
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=diagnostics-connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics-connection.js","sourceRoot":"","sources":["../../src/lsp/diagnostics-connection.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAU,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAAsB;IAC9D,IAAI,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,OAAO;IACV,CAAC;IACD,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEnC,MAAM,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpE,UAAU,CAAC,eAAe,GAAG,MAAM,CAAC,EAAE;QACnC,IAAI,MAAqB,CAAC;QAC1B,IAAI,CAAC;YACF,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACvB,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC;gBAChC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;YAC5B,CAAC;YACD,MAAM,KAAK,CAAC;QACf,CAAC;QACD,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACvB,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC;gBAChC,OAAO;YACV,CAAC;YACD,MAAM,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IACjB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -9,25 +9,14 @@
|
|
|
9
9
|
import { Debouncer, type Logger, ObservableValue, type MaybeObservableValue } from '@hydranium/protocol';
|
|
10
10
|
import { URI } from '@hydranium/langium';
|
|
11
11
|
import { DefaultDocumentUpdateHandler } from '@hydranium/langium/lsp';
|
|
12
|
-
import { type HydraniumDocumentBuilder } from '../langium/document-builder/document-builder.js';
|
|
12
|
+
import { HYDRANIUM_BUILD_REASONS, type HydraniumDocumentBuilder } from '../langium/document-builder/document-builder.js';
|
|
13
13
|
import { type ServerSharedServices } from '../langium/module.js';
|
|
14
14
|
import { type SelfSaveRegistry } from '../documents/self-save-registry.js';
|
|
15
15
|
import { type WritableFileSystemProvider } from '../documents/ast-document-manager.js';
|
|
16
16
|
import { type HydraniumTextDocuments } from '../documents/hydranium-text-documents.js';
|
|
17
|
-
import { type DidChangeWatchedFilesParams, type TextDocumentChangeEvent } from 'vscode-languageserver';
|
|
17
|
+
import { type DidChangeWatchedFilesParams, type TextDocumentChangeEvent, type TextDocumentWillSaveEvent, type TextEdit } from 'vscode-languageserver';
|
|
18
18
|
import { type TextDocument } from 'vscode-languageserver-textdocument';
|
|
19
|
-
|
|
20
|
-
* Default LSP-event reasons stamped by {@link HydraniumDocumentUpdateHandler}
|
|
21
|
-
* onto the next `documentBuilder.update` call via `markNextReason`. Exposed
|
|
22
|
-
* so adopters subclassing the handler can layer additional reasons or rename
|
|
23
|
-
* existing ones without losing the canonical names the framework emits.
|
|
24
|
-
*/
|
|
25
|
-
export declare const HYDRANIUM_BUILD_REASONS: Readonly<{
|
|
26
|
-
readonly didOpen: "didOpen";
|
|
27
|
-
readonly didChangeContent: "didChangeContent";
|
|
28
|
-
readonly didChangeWatchedFiles: "didChangeWatchedFiles";
|
|
29
|
-
readonly didClose: "didClose";
|
|
30
|
-
}>;
|
|
19
|
+
export { HYDRANIUM_BUILD_REASONS };
|
|
31
20
|
/**
|
|
32
21
|
* Construction options for {@link HydraniumDocumentUpdateHandler}.
|
|
33
22
|
*/
|
|
@@ -52,6 +41,17 @@ export interface HydraniumDocumentUpdateHandlerOptions {
|
|
|
52
41
|
* load tests).
|
|
53
42
|
*/
|
|
54
43
|
readonly bypassNonLanguageClientChanges?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Longest an editor's save waits on the server, in milliseconds, at each of
|
|
46
|
+
* its two steps: the `willSaveWaitUntil` answer waits for the server's disk
|
|
47
|
+
* writes of the document already queued, and server writes queued after the
|
|
48
|
+
* answer wait for the editor's `didSave`. Either wait that runs out is
|
|
49
|
+
* logged, and the editor's write and the server's can then land in either
|
|
50
|
+
* order. Default `1000`: VS Code gives up on an answer after about 1.5 s,
|
|
51
|
+
* and switches the listener off for the session once four answers, over
|
|
52
|
+
* all documents, timed out or failed.
|
|
53
|
+
*/
|
|
54
|
+
readonly willSaveGateMs?: number;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Framework `DocumentUpdateHandler` adding these behaviours over Langium's
|
|
@@ -66,19 +66,25 @@ export interface HydraniumDocumentUpdateHandlerOptions {
|
|
|
66
66
|
* changes and watched-file changes bypass the debounce (their
|
|
67
67
|
* producers are already coalesced).
|
|
68
68
|
* 3. **Build-reason stamping** — the LSP event overrides
|
|
69
|
-
* (`didOpenDocument`, `didChangeContent`, `didChangeWatchedFiles
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
69
|
+
* (`didOpenDocument`, `didChangeContent`, `didChangeWatchedFiles`)
|
|
70
|
+
* populate {@link nextReason} with a canonical reason string.
|
|
71
|
+
* {@link fireDocumentUpdate} captures the reason; {@link dispatch} stages
|
|
72
|
+
* it on the builder via {@link HydraniumDocumentBuilder.markNextReason},
|
|
73
|
+
* so a subclass that formats build logs can tag its line with the event
|
|
74
|
+
* that caused the build without per-adopter wiring to capture it.
|
|
75
|
+
* 4. **Editor save gate** ({@link willSaveDocumentWaitUntil}) — the editor
|
|
76
|
+
* writes the file itself, so the server's disk writes of that document
|
|
77
|
+
* are ordered around it: the editor's save waits for the ones already
|
|
78
|
+
* queued, and the ones queued during its save wait for its `didSave`.
|
|
79
|
+
* Both waits are capped by
|
|
80
|
+
* {@link HydraniumDocumentUpdateHandlerOptions.willSaveGateMs}.
|
|
81
|
+
*
|
|
82
|
+
* The revert to disk after a document's last close is not dispatched here:
|
|
83
|
+
* the text store runs it for every head, the LSP head included, so a
|
|
84
|
+
* `didCloseDocument` added in a subclass would build the document twice. A
|
|
85
|
+
* change still debounced for the document is dropped when the store releases
|
|
86
|
+
* it: a `file:` document's revert rebuilds it, and a document of another
|
|
87
|
+
* scheme, which does not revert, keeps its last build.
|
|
82
88
|
*
|
|
83
89
|
* Adopters with their own handler subclass should extend this class
|
|
84
90
|
* (not Langium's `DefaultDocumentUpdateHandler`) so all of them are
|
|
@@ -87,6 +93,7 @@ export interface HydraniumDocumentUpdateHandlerOptions {
|
|
|
87
93
|
* inside the workspace-lock callback.
|
|
88
94
|
*/
|
|
89
95
|
export declare class HydraniumDocumentUpdateHandler extends DefaultDocumentUpdateHandler {
|
|
96
|
+
protected readonly services: ServerSharedServices;
|
|
90
97
|
/**
|
|
91
98
|
* Narrow Langium's `DefaultDocumentUpdateHandler.documentBuilder` typing to
|
|
92
99
|
* the framework subclass: `markNextReason` is the only method this handler
|
|
@@ -122,47 +129,48 @@ export declare class HydraniumDocumentUpdateHandler extends DefaultDocumentUpdat
|
|
|
122
129
|
* first reason in a coalesced burst).
|
|
123
130
|
*/
|
|
124
131
|
protected pendingReason?: string;
|
|
132
|
+
protected readonly willSaveGateMs: number;
|
|
133
|
+
/**
|
|
134
|
+
* Per document URI, the release of the hold an editor's save in progress
|
|
135
|
+
* keeps on the document's disk queue. A second save of the document
|
|
136
|
+
* releases the first: its hold would otherwise keep the second's answer
|
|
137
|
+
* waiting until the cap. The key is the document, not the save, so for a
|
|
138
|
+
* client that sends its next `willSaveWaitUntil` before the previous
|
|
139
|
+
* `didSave`, that late `didSave` releases the next save's hold.
|
|
140
|
+
*/
|
|
141
|
+
protected readonly editorSaves: Map<string, () => void>;
|
|
125
142
|
constructor(services: ServerSharedServices, options?: HydraniumDocumentUpdateHandlerOptions);
|
|
126
143
|
didOpenDocument(_change: TextDocumentChangeEvent<TextDocument>): void;
|
|
127
144
|
didChangeContent(change: TextDocumentChangeEvent<TextDocument>): void;
|
|
145
|
+
didChangeWatchedFiles(params: DidChangeWatchedFilesParams): void;
|
|
128
146
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* We funnel the last-client transition through the same dispatch path
|
|
138
|
-
* the other LSP events use, so the rebuild gets debouncing, workspace
|
|
139
|
-
* locking, build-reason stamping, and `markNextReason` for free. The
|
|
140
|
-
* scheme split governs the `DocumentBuilder.update` shape:
|
|
141
|
-
*
|
|
142
|
-
* - **`file:` URI** → `update([uri], [])`. Routes through
|
|
143
|
-
* `LangiumDocuments.invalidateDocument` (doc stays in the trie) and
|
|
144
|
-
* `LangiumDocumentFactory.update`, which consults the LSP-tracked
|
|
145
|
-
* open-documents map first. That map is cleared LATER in the same
|
|
146
|
-
* synchronous `notifyDidCloseTextDocument` call that fires this event,
|
|
147
|
-
* and {@link dispatch} defers the build behind `workspaceManager.ready`
|
|
148
|
-
* — so by the time the factory looks, the URI is gone: it falls back to
|
|
149
|
-
* `FileSystemProvider.readFile` and the doc rebuilds from disk,
|
|
150
|
-
* Langium's canonical close-without-save semantic. A dispatch made
|
|
151
|
-
* synchronously here would still see the open document and re-read the
|
|
152
|
-
* in-memory text instead.
|
|
153
|
-
* - **non-`file:` URI** (`builtin:`, `untitled:`) → no dispatch.
|
|
154
|
-
* Adopter-loaded schemes — documents pulled in via
|
|
155
|
-
* `loadAdditionalDocuments` — need to stay in the workspace index;
|
|
156
|
-
* dropping them on close would break every cross-reference that
|
|
157
|
-
* targets them. The framework cannot enumerate adopter schemes, so the
|
|
158
|
-
* safe default is "leave alone unless it's a file." Adopters that need
|
|
159
|
-
* ephemeral-URI cleanup handle it explicitly.
|
|
147
|
+
* Answer an editor's `willSaveWaitUntil` with no edits once the server's
|
|
148
|
+
* disk writes of the document already queued have landed, or after
|
|
149
|
+
* {@link willSaveGateMs}, whichever is first. From the moment the queue
|
|
150
|
+
* reaches this save, disk tasks of the document queued behind it wait for
|
|
151
|
+
* the editor's `didSave`, reported through
|
|
152
|
+
* `HydraniumTextDocuments.onDidSaveInLanguageClient`, or for
|
|
153
|
+
* {@link willSaveGateMs} more.
|
|
160
154
|
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
155
|
+
* The hold is a disk task that waits only for that signal or its timer:
|
|
156
|
+
* waiting on a build, a save or anything else queued for the document would
|
|
157
|
+
* wedge its queue. Resolves in every case, since a failed request counts
|
|
158
|
+
* against the listener in VS Code; Langium drops the request's cancellation,
|
|
159
|
+
* so an abandoned request still runs to the cap. A hold that runs out is
|
|
160
|
+
* logged at debug only: an editor skips `didSave` for a save it cancels or
|
|
161
|
+
* that changed nothing.
|
|
163
162
|
*/
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
willSaveDocumentWaitUntil(event: TextDocumentWillSaveEvent<TextDocument>): Promise<TextEdit[]>;
|
|
164
|
+
/**
|
|
165
|
+
* Present so that Langium advertises `save` and editors send `didSave`;
|
|
166
|
+
* without it every hold of {@link willSaveDocumentWaitUntil} waits out its
|
|
167
|
+
* cap. The hold is released on
|
|
168
|
+
* `HydraniumTextDocuments.onDidSaveInLanguageClient` instead: it fires as
|
|
169
|
+
* soon as the editor reports the save, while `onDidSave`, and so this
|
|
170
|
+
* method, follows only once the file has been read back, and not at all
|
|
171
|
+
* when the file does not hold the store's text.
|
|
172
|
+
*/
|
|
173
|
+
didSaveDocument(_event: TextDocumentChangeEvent<TextDocument>): void;
|
|
166
174
|
/**
|
|
167
175
|
* Drop watched-file changes whose path + mtime match a recent self-save
|
|
168
176
|
* record. Deletions always pass (no mtime); stat failures pass (the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-document-update-handler.d.ts","sourceRoot":"","sources":["../../src/lsp/hydranium-document-update-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"hydranium-document-update-handler.d.ts","sourceRoot":"","sources":["../../src/lsp/hydranium-document-update-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,SAAS,EAAY,KAAK,MAAM,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACnH,OAAO,EAAE,GAAG,EAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,KAAK,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AACzH,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,0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