@hydranium/core 1.0.0-next.39 → 1.0.0-next.391
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -82
- package/lib/browser/host-heads-in-worker.d.ts +77 -0
- package/lib/browser/host-heads-in-worker.d.ts.map +1 -0
- package/lib/browser/host-heads-in-worker.js +169 -0
- package/lib/browser/host-heads-in-worker.js.map +1 -0
- package/lib/browser/index.d.ts +12 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +17 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/indexeddb-file-system-store.d.ts +82 -0
- package/lib/browser/indexeddb-file-system-store.d.ts.map +1 -0
- package/lib/browser/indexeddb-file-system-store.js +181 -0
- package/lib/browser/indexeddb-file-system-store.js.map +1 -0
- package/lib/browser/start-language-server-in-worker.d.ts +32 -0
- package/lib/browser/start-language-server-in-worker.d.ts.map +1 -0
- package/lib/browser/start-language-server-in-worker.js +40 -0
- package/lib/browser/start-language-server-in-worker.js.map +1 -0
- package/lib/documents/ast-document-manager.d.ts +254 -140
- package/lib/documents/ast-document-manager.d.ts.map +1 -1
- package/lib/documents/ast-document-manager.js +311 -128
- package/lib/documents/ast-document-manager.js.map +1 -1
- package/lib/documents/client-ids.d.ts +5 -19
- package/lib/documents/client-ids.d.ts.map +1 -1
- package/lib/documents/client-ids.js +5 -19
- package/lib/documents/client-ids.js.map +1 -1
- package/lib/documents/client-session-errors.d.ts +15 -0
- package/lib/documents/client-session-errors.d.ts.map +1 -0
- package/lib/documents/client-session-errors.js +15 -0
- package/lib/documents/client-session-errors.js.map +1 -0
- package/lib/documents/client-session-registry.d.ts +146 -0
- package/lib/documents/client-session-registry.d.ts.map +1 -0
- package/lib/documents/client-session-registry.js +207 -0
- package/lib/documents/client-session-registry.js.map +1 -0
- package/lib/documents/dirty-state-tracker.d.ts +101 -0
- package/lib/documents/dirty-state-tracker.d.ts.map +1 -0
- package/lib/documents/dirty-state-tracker.js +85 -0
- package/lib/documents/dirty-state-tracker.js.map +1 -0
- package/lib/documents/document-release-handler.d.ts +204 -0
- package/lib/documents/document-release-handler.d.ts.map +1 -0
- package/lib/documents/document-release-handler.js +317 -0
- package/lib/documents/document-release-handler.js.map +1 -0
- package/lib/documents/document-release-scheduler.d.ts +67 -0
- package/lib/documents/document-release-scheduler.d.ts.map +1 -0
- package/lib/documents/document-release-scheduler.js +80 -0
- package/lib/documents/document-release-scheduler.js.map +1 -0
- package/lib/documents/file-system-task-queue.d.ts +52 -0
- package/lib/documents/file-system-task-queue.d.ts.map +1 -0
- package/lib/documents/file-system-task-queue.js +40 -0
- package/lib/documents/file-system-task-queue.js.map +1 -0
- package/lib/documents/hydranium-text-documents.d.ts +453 -282
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
- package/lib/documents/hydranium-text-documents.js +918 -504
- package/lib/documents/hydranium-text-documents.js.map +1 -1
- package/lib/documents/index.d.ts +10 -2
- package/lib/documents/index.d.ts.map +1 -1
- package/lib/documents/index.js +10 -2
- package/lib/documents/index.js.map +1 -1
- package/lib/documents/language-client-shadow.d.ts +234 -0
- package/lib/documents/language-client-shadow.d.ts.map +1 -0
- package/lib/documents/language-client-shadow.js +306 -0
- package/lib/documents/language-client-shadow.js.map +1 -0
- package/lib/documents/model-ledger.d.ts +47 -0
- package/lib/documents/model-ledger.d.ts.map +1 -0
- package/lib/documents/model-ledger.js +30 -0
- package/lib/documents/model-ledger.js.map +1 -0
- package/lib/documents/text-ledger.d.ts +64 -0
- package/lib/documents/text-ledger.d.ts.map +1 -0
- package/lib/documents/text-ledger.js +63 -0
- package/lib/documents/text-ledger.js.map +1 -0
- package/lib/documents/version-sync-service.d.ts +153 -0
- package/lib/documents/version-sync-service.d.ts.map +1 -0
- package/lib/documents/version-sync-service.js +186 -0
- package/lib/documents/version-sync-service.js.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/lib/langium/ast-extension/ast-extension-service.d.ts +42 -31
- package/lib/langium/ast-extension/ast-extension-service.d.ts.map +1 -1
- package/lib/langium/ast-extension/ast-extension-service.js +45 -19
- package/lib/langium/ast-extension/ast-extension-service.js.map +1 -1
- package/lib/langium/ast-extension/ast-node-builder.d.ts +12 -7
- package/lib/langium/ast-extension/ast-node-builder.d.ts.map +1 -1
- package/lib/langium/ast-extension/ast-node-builder.js +25 -9
- package/lib/langium/ast-extension/ast-node-builder.js.map +1 -1
- package/lib/langium/bootstrap.d.ts +49 -36
- package/lib/langium/bootstrap.d.ts.map +1 -1
- package/lib/langium/bootstrap.js +75 -36
- package/lib/langium/bootstrap.js.map +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass-service.d.ts +9 -9
- package/lib/langium/build-phase-pass/build-phase-pass-service.d.ts.map +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass-service.js +25 -16
- package/lib/langium/build-phase-pass/build-phase-pass-service.js.map +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass.d.ts +20 -8
- package/lib/langium/build-phase-pass/build-phase-pass.d.ts.map +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass.js +20 -0
- package/lib/langium/build-phase-pass/build-phase-pass.js.map +1 -1
- package/lib/langium/composite-ast-reflection.d.ts +46 -0
- package/lib/langium/composite-ast-reflection.d.ts.map +1 -0
- package/lib/langium/composite-ast-reflection.js +97 -0
- package/lib/langium/composite-ast-reflection.js.map +1 -0
- package/lib/langium/config/configuration-provider.d.ts +81 -0
- package/lib/langium/config/configuration-provider.d.ts.map +1 -0
- package/lib/langium/config/configuration-provider.js +112 -0
- package/lib/langium/config/configuration-provider.js.map +1 -0
- package/lib/langium/config/index.d.ts +1 -0
- package/lib/langium/config/index.d.ts.map +1 -1
- package/lib/langium/config/index.js +1 -0
- package/lib/langium/config/index.js.map +1 -1
- package/lib/langium/config/settings.js.map +1 -1
- package/lib/langium/diagnostics/console-tee.d.ts +27 -0
- package/lib/langium/diagnostics/console-tee.d.ts.map +1 -0
- package/lib/langium/diagnostics/console-tee.js +141 -0
- package/lib/langium/diagnostics/console-tee.js.map +1 -0
- package/lib/langium/diagnostics/hydranium-langium-profiler.d.ts +9 -20
- package/lib/langium/diagnostics/hydranium-langium-profiler.d.ts.map +1 -1
- package/lib/langium/diagnostics/hydranium-langium-profiler.js +15 -24
- package/lib/langium/diagnostics/hydranium-langium-profiler.js.map +1 -1
- package/lib/langium/diagnostics/log-preamble.js +1 -1
- package/lib/langium/diagnostics/log-preamble.js.map +1 -1
- package/lib/langium/diagnostics/logger.d.ts +25 -6
- package/lib/langium/diagnostics/logger.d.ts.map +1 -1
- package/lib/langium/diagnostics/logger.js +49 -17
- package/lib/langium/diagnostics/logger.js.map +1 -1
- package/lib/langium/diagnostics/lsp-logger.d.ts +25 -0
- package/lib/langium/diagnostics/lsp-logger.d.ts.map +1 -1
- package/lib/langium/diagnostics/lsp-logger.js +81 -46
- package/lib/langium/diagnostics/lsp-logger.js.map +1 -1
- package/lib/langium/diagnostics/server-tracer.d.ts.map +1 -1
- package/lib/langium/diagnostics/server-tracer.js.map +1 -1
- package/lib/langium/document-builder/build-pipeline-integration.d.ts +21 -1
- package/lib/langium/document-builder/build-pipeline-integration.d.ts.map +1 -1
- package/lib/langium/document-builder/build-pipeline-integration.js +43 -30
- package/lib/langium/document-builder/build-pipeline-integration.js.map +1 -1
- package/lib/langium/document-builder/build-session.d.ts +6 -5
- package/lib/langium/document-builder/build-session.d.ts.map +1 -1
- package/lib/langium/document-builder/build-session.js +5 -5
- package/lib/langium/document-builder/build-session.js.map +1 -1
- package/lib/langium/document-builder/document-builder.d.ts +390 -40
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
- package/lib/langium/document-builder/document-builder.js +635 -102
- package/lib/langium/document-builder/document-builder.js.map +1 -1
- package/lib/langium/documentation/comment-provider.d.ts.map +1 -1
- package/lib/langium/documentation/comment-provider.js.map +1 -1
- package/lib/langium/integration-services.d.ts +20 -23
- package/lib/langium/integration-services.d.ts.map +1 -1
- package/lib/langium/integration-services.js.map +1 -1
- package/lib/langium/integrity/integrity-rule.d.ts +22 -8
- package/lib/langium/integrity/integrity-rule.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-rule.js.map +1 -1
- package/lib/langium/integrity/integrity-service.d.ts +217 -29
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-service.js +588 -84
- package/lib/langium/integrity/integrity-service.js.map +1 -1
- package/lib/langium/keys/containment.d.ts +3 -2
- package/lib/langium/keys/containment.d.ts.map +1 -1
- package/lib/langium/keys/containment.js.map +1 -1
- package/lib/langium/keys/name-based-key-provider.d.ts +17 -10
- package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -1
- package/lib/langium/keys/name-based-key-provider.js +24 -12
- package/lib/langium/keys/name-based-key-provider.js.map +1 -1
- package/lib/langium/keys/positional-key-provider.d.ts.map +1 -1
- package/lib/langium/keys/positional-key-provider.js.map +1 -1
- package/lib/langium/labeling/label-provider.d.ts.map +1 -1
- package/lib/langium/labeling/label-provider.js.map +1 -1
- package/lib/langium/language-module.d.ts +30 -5
- package/lib/langium/language-module.d.ts.map +1 -1
- package/lib/langium/language-module.js +21 -5
- package/lib/langium/language-module.js.map +1 -1
- package/lib/langium/model-service/client-session.d.ts +405 -0
- package/lib/langium/model-service/client-session.d.ts.map +1 -0
- package/lib/langium/model-service/client-session.js +479 -0
- package/lib/langium/model-service/client-session.js.map +1 -0
- package/lib/langium/model-service/index.d.ts +2 -0
- package/lib/langium/model-service/index.d.ts.map +1 -1
- package/lib/langium/model-service/index.js +2 -0
- package/lib/langium/model-service/index.js.map +1 -1
- package/lib/langium/model-service/model-events.d.ts +68 -0
- package/lib/langium/model-service/model-events.d.ts.map +1 -0
- package/lib/langium/model-service/model-events.js +10 -0
- package/lib/langium/model-service/model-events.js.map +1 -0
- package/lib/langium/model-service/model-service.d.ts +441 -323
- package/lib/langium/model-service/model-service.d.ts.map +1 -1
- package/lib/langium/model-service/model-service.js +602 -407
- package/lib/langium/model-service/model-service.js.map +1 -1
- package/lib/langium/module.d.ts +96 -37
- package/lib/langium/module.d.ts.map +1 -1
- package/lib/langium/module.js +41 -29
- package/lib/langium/module.js.map +1 -1
- package/lib/langium/naming/name-provider.d.ts +32 -7
- package/lib/langium/naming/name-provider.d.ts.map +1 -1
- package/lib/langium/naming/name-provider.js +10 -4
- package/lib/langium/naming/name-provider.js.map +1 -1
- package/lib/langium/naming/name-separator-validation.d.ts.map +1 -1
- package/lib/langium/project/abstract-project-manager.d.ts +184 -13
- package/lib/langium/project/abstract-project-manager.d.ts.map +1 -1
- package/lib/langium/project/abstract-project-manager.js +336 -16
- package/lib/langium/project/abstract-project-manager.js.map +1 -1
- package/lib/langium/project/project-change-event.d.ts +22 -3
- package/lib/langium/project/project-change-event.d.ts.map +1 -1
- package/lib/langium/project/project-manager.d.ts +28 -2
- package/lib/langium/project/project-manager.d.ts.map +1 -1
- package/lib/langium/project/single-project-manager.d.ts +7 -1
- package/lib/langium/project/single-project-manager.d.ts.map +1 -1
- package/lib/langium/project/single-project-manager.js +12 -0
- package/lib/langium/project/single-project-manager.js.map +1 -1
- package/lib/langium/residency/cst-residency-service.d.ts +92 -52
- package/lib/langium/residency/cst-residency-service.d.ts.map +1 -1
- package/lib/langium/residency/cst-residency-service.js +154 -58
- package/lib/langium/residency/cst-residency-service.js.map +1 -1
- package/lib/langium/scope/ast-node-description-provider.d.ts +46 -10
- package/lib/langium/scope/ast-node-description-provider.d.ts.map +1 -1
- package/lib/langium/scope/ast-node-description-provider.js +88 -15
- package/lib/langium/scope/ast-node-description-provider.js.map +1 -1
- package/lib/langium/scope/built-local-symbols.d.ts +12 -0
- package/lib/langium/scope/built-local-symbols.d.ts.map +1 -0
- package/lib/langium/scope/built-local-symbols.js +11 -0
- package/lib/langium/scope/built-local-symbols.js.map +1 -0
- package/lib/langium/scope/fallback-scope.d.ts +27 -0
- package/lib/langium/scope/fallback-scope.d.ts.map +1 -0
- package/lib/langium/scope/fallback-scope.js +35 -0
- package/lib/langium/scope/fallback-scope.js.map +1 -0
- package/lib/langium/scope/hydranium-scope-computation.d.ts +21 -18
- package/lib/langium/scope/hydranium-scope-computation.d.ts.map +1 -1
- package/lib/langium/scope/hydranium-scope-computation.js +38 -39
- package/lib/langium/scope/hydranium-scope-computation.js.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.d.ts +122 -32
- package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.js +217 -39
- package/lib/langium/scope/hydranium-scope-provider.js.map +1 -1
- package/lib/langium/scope/index.d.ts +1 -0
- package/lib/langium/scope/index.d.ts.map +1 -1
- package/lib/langium/scope/index.js +1 -0
- package/lib/langium/scope/index.js.map +1 -1
- package/lib/langium/scope/reference-builder.d.ts.map +1 -1
- package/lib/langium/scope/reference-builder.js.map +1 -1
- package/lib/langium/scope/reference-candidate-provider.d.ts +6 -5
- package/lib/langium/scope/reference-candidate-provider.d.ts.map +1 -1
- package/lib/langium/scope/reference-candidate-provider.js +3 -2
- package/lib/langium/scope/reference-candidate-provider.js.map +1 -1
- package/lib/langium/scope/scope-extension-service.d.ts +69 -37
- package/lib/langium/scope/scope-extension-service.d.ts.map +1 -1
- package/lib/langium/scope/scope-extension-service.js +102 -29
- package/lib/langium/scope/scope-extension-service.js.map +1 -1
- package/lib/langium/scope/scoped-ast-node-description.d.ts +1 -3
- package/lib/langium/scope/scoped-ast-node-description.d.ts.map +1 -1
- package/lib/langium/scope/scoped-ast-node-description.js +1 -3
- package/lib/langium/scope/scoped-ast-node-description.js.map +1 -1
- package/lib/langium/serialization/abstract-serializer.d.ts +38 -27
- package/lib/langium/serialization/abstract-serializer.d.ts.map +1 -1
- package/lib/langium/serialization/abstract-serializer.js +54 -30
- package/lib/langium/serialization/abstract-serializer.js.map +1 -1
- package/lib/langium/serialization/json-serializer.d.ts +8 -1
- package/lib/langium/serialization/json-serializer.d.ts.map +1 -1
- package/lib/langium/serialization/json-serializer.js +13 -3
- package/lib/langium/serialization/json-serializer.js.map +1 -1
- package/lib/langium/serialization/serializer.d.ts +1 -1
- package/lib/langium/serialization/yaml-serializer.d.ts +12 -0
- package/lib/langium/serialization/yaml-serializer.d.ts.map +1 -1
- package/lib/langium/serialization/yaml-serializer.js +24 -4
- package/lib/langium/serialization/yaml-serializer.js.map +1 -1
- package/lib/langium/service-registry.d.ts +29 -1
- package/lib/langium/service-registry.d.ts.map +1 -1
- package/lib/langium/service-registry.js +37 -0
- package/lib/langium/service-registry.js.map +1 -1
- package/lib/langium/shared-services.d.ts +10 -4
- package/lib/langium/shared-services.d.ts.map +1 -1
- package/lib/langium/shared-services.js.map +1 -1
- package/lib/langium/single-langium-copy.d.ts +22 -0
- package/lib/langium/single-langium-copy.d.ts.map +1 -0
- package/lib/langium/single-langium-copy.js +36 -0
- package/lib/langium/single-langium-copy.js.map +1 -0
- package/lib/langium/transfer/transfer-encoder.d.ts +60 -39
- package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -1
- package/lib/langium/transfer/transfer-encoder.js +35 -24
- package/lib/langium/transfer/transfer-encoder.js.map +1 -1
- package/lib/langium/trivia/comment-preserver.d.ts +543 -0
- package/lib/langium/trivia/comment-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/comment-preserver.js +1165 -0
- package/lib/langium/trivia/comment-preserver.js.map +1 -0
- package/lib/langium/trivia/document-ending-preserver.d.ts +51 -0
- package/lib/langium/trivia/document-ending-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/document-ending-preserver.js +62 -0
- package/lib/langium/trivia/document-ending-preserver.js.map +1 -0
- package/lib/langium/trivia/index.d.ts +14 -0
- package/lib/langium/trivia/index.d.ts.map +1 -0
- package/lib/langium/trivia/index.js +14 -0
- package/lib/langium/trivia/index.js.map +1 -0
- package/lib/langium/trivia/trivia-contribution.d.ts +37 -0
- package/lib/langium/trivia/trivia-contribution.d.ts.map +1 -0
- package/lib/langium/trivia/trivia-contribution.js +10 -0
- package/lib/langium/trivia/trivia-contribution.js.map +1 -0
- package/lib/langium/trivia/trivia-preserver.d.ts +52 -0
- package/lib/langium/trivia/trivia-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/trivia-preserver.js +10 -0
- package/lib/langium/trivia/trivia-preserver.js.map +1 -0
- package/lib/langium/trivia/trivia-service.d.ts +70 -0
- package/lib/langium/trivia/trivia-service.d.ts.map +1 -0
- package/lib/langium/trivia/trivia-service.js +56 -0
- package/lib/langium/trivia/trivia-service.js.map +1 -0
- package/lib/langium/update-rewrite/normalize-empty-strings.d.ts.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite-service.d.ts +1 -1
- package/lib/langium/update-rewrite/update-rewrite-service.d.ts.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite-service.js.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite.d.ts +1 -1
- package/lib/langium/validation/document-validator.d.ts +168 -23
- package/lib/langium/validation/document-validator.d.ts.map +1 -1
- package/lib/langium/validation/document-validator.js +264 -26
- package/lib/langium/validation/document-validator.js.map +1 -1
- package/lib/langium/validation/validation-contribution-collector.d.ts +9 -1
- package/lib/langium/validation/validation-contribution-collector.d.ts.map +1 -1
- package/lib/langium/validation/validation-contribution-collector.js +1 -1
- package/lib/langium/validation/validation-contribution-collector.js.map +1 -1
- package/lib/langium/workspace/ast-node-locator.d.ts +24 -0
- package/lib/langium/workspace/ast-node-locator.d.ts.map +1 -0
- package/lib/langium/workspace/ast-node-locator.js +32 -0
- package/lib/langium/workspace/ast-node-locator.js.map +1 -0
- package/lib/langium/workspace/document-uri-policy.d.ts +24 -15
- package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -1
- package/lib/langium/workspace/document-uri-policy.js +22 -13
- package/lib/langium/workspace/document-uri-policy.js.map +1 -1
- package/lib/langium/workspace/file-not-found.d.ts +23 -0
- package/lib/langium/workspace/file-not-found.d.ts.map +1 -0
- package/lib/langium/workspace/file-not-found.js +31 -0
- package/lib/langium/workspace/file-not-found.js.map +1 -0
- package/lib/langium/workspace/file-system-provider.d.ts +167 -8
- package/lib/langium/workspace/file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/file-system-provider.js +115 -13
- package/lib/langium/workspace/file-system-provider.js.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts +78 -4
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.js +188 -5
- package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts +50 -1
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-lock.js +73 -1
- package/lib/langium/workspace/hydranium-workspace-lock.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts +105 -21
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.js +186 -31
- package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts +26 -9
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.js +45 -22
- package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
- package/lib/langium/workspace/index-manager.d.ts.map +1 -1
- package/lib/langium/workspace/index-manager.js.map +1 -1
- package/lib/langium/workspace/index.d.ts +3 -0
- package/lib/langium/workspace/index.d.ts.map +1 -1
- package/lib/langium/workspace/index.js +3 -0
- package/lib/langium/workspace/index.js.map +1 -1
- package/lib/langium/workspace/initialize-workspace.d.ts +40 -3
- package/lib/langium/workspace/initialize-workspace.d.ts.map +1 -1
- package/lib/langium/workspace/initialize-workspace.js +68 -3
- package/lib/langium/workspace/initialize-workspace.js.map +1 -1
- package/lib/langium/workspace/langium-documents.d.ts +7 -0
- package/lib/langium/workspace/langium-documents.d.ts.map +1 -1
- package/lib/langium/workspace/langium-documents.js +18 -1
- package/lib/langium/workspace/langium-documents.js.map +1 -1
- package/lib/langium/workspace/persistent-file-system-provider.d.ts +16 -10
- package/lib/langium/workspace/persistent-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/persistent-file-system-provider.js +25 -13
- package/lib/langium/workspace/persistent-file-system-provider.js.map +1 -1
- package/lib/{documents → langium/workspace}/self-save-registry.d.ts +7 -9
- package/lib/langium/workspace/self-save-registry.d.ts.map +1 -0
- package/lib/{documents → langium/workspace}/self-save-registry.js +9 -11
- package/lib/langium/workspace/self-save-registry.js.map +1 -0
- package/lib/langium/workspace/syntax-errors.d.ts +23 -0
- package/lib/langium/workspace/syntax-errors.d.ts.map +1 -0
- package/lib/langium/workspace/syntax-errors.js +29 -0
- package/lib/langium/workspace/syntax-errors.js.map +1 -0
- package/lib/langium/workspace/virtual-document.d.ts +55 -21
- package/lib/langium/workspace/virtual-document.d.ts.map +1 -1
- package/lib/langium/workspace/virtual-document.js +87 -24
- package/lib/langium/workspace/virtual-document.js.map +1 -1
- package/lib/langium/workspace/write-lock-scope.d.ts +22 -10
- package/lib/langium/workspace/write-lock-scope.d.ts.map +1 -1
- package/lib/langium/workspace/write-lock-scope.js +15 -5
- package/lib/langium/workspace/write-lock-scope.js.map +1 -1
- package/lib/launcher/integrated-server.d.ts +3 -1
- package/lib/launcher/integrated-server.d.ts.map +1 -1
- package/lib/locale/server-locale.d.ts +6 -6
- package/lib/locale/server-locale.d.ts.map +1 -1
- package/lib/locale/server-locale.js.map +1 -1
- package/lib/lsp/completion/hydranium-completion-provider.d.ts +44 -2
- package/lib/lsp/completion/hydranium-completion-provider.d.ts.map +1 -1
- package/lib/lsp/completion/hydranium-completion-provider.js +68 -0
- package/lib/lsp/completion/hydranium-completion-provider.js.map +1 -1
- package/lib/lsp/connection-features.d.ts +23 -0
- package/lib/lsp/connection-features.d.ts.map +1 -0
- package/lib/lsp/connection-features.js +60 -0
- package/lib/lsp/connection-features.js.map +1 -0
- package/lib/lsp/diagnostics-connection.d.ts +27 -0
- package/lib/lsp/diagnostics-connection.d.ts.map +1 -0
- package/lib/lsp/diagnostics-connection.js +53 -0
- package/lib/lsp/diagnostics-connection.js.map +1 -0
- package/lib/lsp/edit-requests-guard.d.ts +31 -0
- package/lib/lsp/edit-requests-guard.d.ts.map +1 -0
- package/lib/lsp/edit-requests-guard.js +125 -0
- package/lib/lsp/edit-requests-guard.js.map +1 -0
- package/lib/lsp/hydranium-document-update-handler.d.ts +126 -82
- package/lib/lsp/hydranium-document-update-handler.d.ts.map +1 -1
- package/lib/lsp/hydranium-document-update-handler.js +234 -101
- package/lib/lsp/hydranium-document-update-handler.js.map +1 -1
- package/lib/lsp/index.d.ts +6 -2
- package/lib/lsp/index.d.ts.map +1 -1
- package/lib/lsp/index.js +6 -2
- package/lib/lsp/index.js.map +1 -1
- package/lib/lsp/lsp-latency.d.ts +39 -0
- package/lib/lsp/lsp-latency.d.ts.map +1 -0
- package/lib/lsp/lsp-latency.js +58 -0
- package/lib/lsp/lsp-latency.js.map +1 -0
- package/lib/lsp/save-text-document.d.ts +31 -0
- package/lib/lsp/save-text-document.d.ts.map +1 -0
- package/lib/lsp/save-text-document.js +52 -0
- package/lib/lsp/save-text-document.js.map +1 -0
- package/lib/lsp/semantic-token-provider.d.ts +58 -2
- package/lib/lsp/semantic-token-provider.d.ts.map +1 -1
- package/lib/lsp/semantic-token-provider.js +98 -9
- package/lib/lsp/semantic-token-provider.js.map +1 -1
- package/lib/lsp/shared-module.d.ts +4 -8
- package/lib/lsp/shared-module.d.ts.map +1 -1
- package/lib/lsp/shared-module.js.map +1 -1
- package/lib/lsp/start-language-server.d.ts +12 -7
- package/lib/lsp/start-language-server.d.ts.map +1 -1
- package/lib/lsp/start-language-server.js +21 -7
- package/lib/lsp/start-language-server.js.map +1 -1
- package/lib/messages/carriers.d.ts +4 -6
- package/lib/messages/carriers.d.ts.map +1 -1
- package/lib/messages/carriers.js +4 -6
- package/lib/messages/carriers.js.map +1 -1
- package/lib/messages/index.d.ts +2 -2
- package/lib/messages/index.d.ts.map +1 -1
- package/lib/messages/index.js +2 -2
- package/lib/messages/index.js.map +1 -1
- package/lib/messages/renderer.d.ts +10 -4
- package/lib/messages/renderer.d.ts.map +1 -1
- package/lib/messages/renderer.js +6 -0
- package/lib/messages/renderer.js.map +1 -1
- package/lib/node/event-loop-monitor.d.ts.map +1 -1
- package/lib/node/event-loop-monitor.js +3 -2
- package/lib/node/event-loop-monitor.js.map +1 -1
- package/lib/node/heap-ceiling.d.ts +61 -0
- package/lib/node/heap-ceiling.d.ts.map +1 -0
- package/lib/node/heap-ceiling.js +72 -0
- package/lib/node/heap-ceiling.js.map +1 -0
- package/lib/node/index.d.ts +1 -1
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +5 -1
- package/lib/node/index.js.map +1 -1
- package/lib/node/latency-from-env.d.ts +1 -1
- package/lib/node/latency-from-env.js +1 -1
- package/lib/node/lint-grammar.js.map +1 -1
- package/lib/node/log-file-sink.d.ts +3 -2
- package/lib/node/log-file-sink.d.ts.map +1 -1
- package/lib/node/log-file-sink.js +6 -2
- package/lib/node/log-file-sink.js.map +1 -1
- package/lib/node/log-preamble-node.d.ts +5 -3
- package/lib/node/log-preamble-node.d.ts.map +1 -1
- package/lib/node/log-preamble-node.js +13 -10
- package/lib/node/log-preamble-node.js.map +1 -1
- package/lib/node/measure-memory.d.ts.map +1 -1
- package/lib/node/measure-memory.js +5 -4
- package/lib/node/measure-memory.js.map +1 -1
- package/lib/node/memory-monitor.d.ts +2 -2
- package/lib/node/memory-monitor.d.ts.map +1 -1
- package/lib/node/memory-monitor.js +9 -10
- package/lib/node/memory-monitor.js.map +1 -1
- package/lib/node/node-file-system-provider.d.ts +67 -9
- package/lib/node/node-file-system-provider.d.ts.map +1 -1
- package/lib/node/node-file-system-provider.js +198 -53
- package/lib/node/node-file-system-provider.js.map +1 -1
- package/lib/node/profile-capture.d.ts +12 -4
- package/lib/node/profile-capture.d.ts.map +1 -1
- package/lib/node/profile-capture.js +8 -6
- package/lib/node/profile-capture.js.map +1 -1
- package/lib/node/profile-digest.js.map +1 -1
- package/lib/node/profiling-run.d.ts +13 -3
- package/lib/node/profiling-run.d.ts.map +1 -1
- package/lib/node/profiling-run.js +17 -8
- package/lib/node/profiling-run.js.map +1 -1
- package/lib/node/rename-over-open-readers.d.ts +61 -0
- package/lib/node/rename-over-open-readers.d.ts.map +1 -0
- package/lib/node/rename-over-open-readers.js +80 -0
- package/lib/node/rename-over-open-readers.js.map +1 -0
- package/lib/node/server-diagnostics.js +1 -1
- package/lib/node/server-diagnostics.js.map +1 -1
- package/lib/node/server-state-snapshot.d.ts +6 -5
- package/lib/node/server-state-snapshot.d.ts.map +1 -1
- package/lib/node/server-state-snapshot.js +20 -17
- package/lib/node/server-state-snapshot.js.map +1 -1
- package/lib/node/socket-launcher.d.ts +43 -7
- package/lib/node/socket-launcher.d.ts.map +1 -1
- package/lib/node/socket-launcher.js +42 -7
- package/lib/node/socket-launcher.js.map +1 -1
- package/lib/node/startup-cpu-profile.d.ts +29 -0
- package/lib/node/startup-cpu-profile.d.ts.map +1 -0
- package/lib/node/startup-cpu-profile.js +91 -0
- package/lib/node/startup-cpu-profile.js.map +1 -0
- package/lib/node/stdio-launcher.d.ts +13 -13
- package/lib/node/stdio-launcher.d.ts.map +1 -1
- package/lib/node/stdio-launcher.js +21 -11
- package/lib/node/stdio-launcher.js.map +1 -1
- package/lib/node/validate-workspace.d.ts +1 -1
- package/lib/node/validate-workspace.d.ts.map +1 -1
- package/lib/node/validate-workspace.js +5 -1
- package/lib/node/validate-workspace.js.map +1 -1
- package/lib/testing/document-uri-policy-conformance.js +1 -1
- package/lib/testing/document-uri-policy-conformance.js.map +1 -1
- package/lib/testing/fake-description.js.map +1 -1
- package/lib/testing/fake-document.d.ts +2 -1
- package/lib/testing/fake-document.d.ts.map +1 -1
- package/lib/testing/fake-document.js.map +1 -1
- package/lib/testing/index.d.ts +1 -1
- package/lib/testing/index.d.ts.map +1 -1
- package/lib/testing/index.js +2 -1
- package/lib/testing/index.js.map +1 -1
- package/lib/testing/langium-test-helpers.d.ts.map +1 -1
- package/lib/testing/langium-test-helpers.js +1 -0
- package/lib/testing/langium-test-helpers.js.map +1 -1
- package/lib/testing/make-noop-language-services.js.map +1 -1
- package/lib/testing/make-noop-shared-services.js.map +1 -1
- package/lib/testing/make-test-services.d.ts +45 -14
- package/lib/testing/make-test-services.d.ts.map +1 -1
- package/lib/testing/make-test-services.js +23 -7
- package/lib/testing/make-test-services.js.map +1 -1
- package/lib/testing/make-test-tracer.d.ts +12 -0
- package/lib/testing/make-test-tracer.d.ts.map +1 -1
- package/lib/testing/make-test-tracer.js +13 -0
- package/lib/testing/make-test-tracer.js.map +1 -1
- package/lib/testing/node/applied-edit-capture.d.ts +29 -0
- package/lib/testing/node/applied-edit-capture.d.ts.map +1 -0
- package/lib/testing/node/applied-edit-capture.js +117 -0
- package/lib/testing/node/applied-edit-capture.js.map +1 -0
- package/lib/testing/node/golden-corpus.js.map +1 -1
- package/lib/testing/node/index.d.ts +4 -1
- package/lib/testing/node/index.d.ts.map +1 -1
- package/lib/testing/node/index.js +4 -1
- package/lib/testing/node/index.js.map +1 -1
- package/lib/testing/node/lsp-harness.d.ts.map +1 -1
- package/lib/testing/node/lsp-harness.js +2 -0
- package/lib/testing/node/lsp-harness.js.map +1 -1
- package/lib/testing/node/lsp-server-connection.d.ts +21 -6
- package/lib/testing/node/lsp-server-connection.d.ts.map +1 -1
- package/lib/testing/node/lsp-server-connection.js +49 -106
- package/lib/testing/node/lsp-server-connection.js.map +1 -1
- package/lib/testing/node/scratch-workspace.d.ts +2 -1
- package/lib/testing/node/scratch-workspace.d.ts.map +1 -1
- package/lib/testing/node/scratch-workspace.js +12 -6
- package/lib/testing/node/scratch-workspace.js.map +1 -1
- package/lib/testing/node/settle-server.d.ts +33 -0
- package/lib/testing/node/settle-server.d.ts.map +1 -0
- package/lib/testing/node/settle-server.js +84 -0
- package/lib/testing/node/settle-server.js.map +1 -0
- package/lib/testing/node/spawned-server.d.ts +30 -1
- package/lib/testing/node/spawned-server.d.ts.map +1 -1
- package/lib/testing/node/spawned-server.js +39 -2
- package/lib/testing/node/spawned-server.js.map +1 -1
- package/lib/testing/playwright/browser-capture-bridge.js.map +1 -1
- package/lib/testing/playwright/e2e-profiling.js.map +1 -1
- package/lib/testing/playwright/flaky-network-proxy.d.ts +76 -0
- package/lib/testing/playwright/flaky-network-proxy.d.ts.map +1 -0
- package/lib/testing/playwright/flaky-network-proxy.js +164 -0
- package/lib/testing/playwright/flaky-network-proxy.js.map +1 -0
- package/lib/testing/playwright/index.d.ts +1 -0
- package/lib/testing/playwright/index.d.ts.map +1 -1
- package/lib/testing/playwright/index.js +1 -0
- package/lib/testing/playwright/index.js.map +1 -1
- package/lib/testing/playwright/server-log-capture.d.ts +46 -16
- package/lib/testing/playwright/server-log-capture.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-capture.js +111 -40
- package/lib/testing/playwright/server-log-capture.js.map +1 -1
- package/lib/testing/playwright/server-log-fixture.d.ts +16 -0
- package/lib/testing/playwright/server-log-fixture.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-fixture.js +25 -6
- package/lib/testing/playwright/server-log-fixture.js.map +1 -1
- package/lib/testing/playwright/server-log-region.d.ts +15 -0
- package/lib/testing/playwright/server-log-region.d.ts.map +1 -0
- package/lib/testing/playwright/server-log-region.js +30 -0
- package/lib/testing/playwright/server-log-region.js.map +1 -0
- package/lib/testing/playwright/server-log-rename-reporter.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-rename-reporter.js +4 -3
- package/lib/testing/playwright/server-log-rename-reporter.js.map +1 -1
- package/lib/testing/run-update-pipeline.d.ts +8 -5
- package/lib/testing/run-update-pipeline.d.ts.map +1 -1
- package/lib/testing/run-update-pipeline.js.map +1 -1
- package/lib/testing/stub-ast-document-manager.d.ts +11 -51
- package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
- package/lib/testing/stub-ast-document-manager.js +31 -59
- package/lib/testing/stub-ast-document-manager.js.map +1 -1
- package/lib/testing/stub-document-builder.d.ts +25 -11
- package/lib/testing/stub-document-builder.d.ts.map +1 -1
- package/lib/testing/stub-document-builder.js +91 -2
- package/lib/testing/stub-document-builder.js.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.d.ts +33 -10
- package/lib/testing/stub-hydranium-text-documents.d.ts.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.js +132 -16
- package/lib/testing/stub-hydranium-text-documents.js.map +1 -1
- package/lib/testing/stub-index-manager.js.map +1 -1
- package/lib/testing/stub-langium-documents.d.ts +3 -2
- package/lib/testing/stub-langium-documents.d.ts.map +1 -1
- package/lib/testing/stub-langium-documents.js.map +1 -1
- package/lib/testing/stub-model-service.d.ts +8 -7
- package/lib/testing/stub-model-service.d.ts.map +1 -1
- package/lib/testing/stub-model-service.js +4 -4
- package/lib/testing/stub-model-service.js.map +1 -1
- package/lib/testing/stub-project-manager.d.ts.map +1 -1
- package/lib/testing/stub-project-manager.js +10 -0
- package/lib/testing/stub-project-manager.js.map +1 -1
- package/lib/testing/stub-self-save-registry.d.ts +1 -1
- package/lib/testing/stub-self-save-registry.d.ts.map +1 -1
- package/lib/testing/stub-service-registry.d.ts +1 -1
- package/lib/testing/stub-service-registry.js.map +1 -1
- package/lib/testing/stub-writable-file-system.d.ts +1 -1
- package/lib/testing/stub-writable-file-system.d.ts.map +1 -1
- package/lib/testing/stub-writable-file-system.js +2 -1
- package/lib/testing/stub-writable-file-system.js.map +1 -1
- package/lib/util/connection-liveness.d.ts +22 -6
- package/lib/util/connection-liveness.d.ts.map +1 -1
- package/lib/util/connection-liveness.js +75 -15
- package/lib/util/connection-liveness.js.map +1 -1
- package/lib/util/environment.d.ts +7 -0
- package/lib/util/environment.d.ts.map +1 -1
- package/lib/util/environment.js +15 -1
- package/lib/util/environment.js.map +1 -1
- package/lib/util/registry.d.ts.map +1 -1
- package/package.json +41 -60
- package/src/browser/host-heads-in-worker.ts +218 -0
- package/src/browser/index.ts +17 -0
- package/src/browser/indexeddb-file-system-store.ts +192 -0
- package/src/browser/start-language-server-in-worker.ts +56 -0
- package/src/documents/ast-document-manager.ts +477 -250
- package/src/documents/client-ids.ts +5 -22
- package/src/documents/client-session-errors.ts +26 -0
- package/src/documents/client-session-registry.ts +262 -0
- package/src/documents/dirty-state-tracker.ts +167 -0
- package/src/documents/document-release-handler.ts +404 -0
- package/src/documents/document-release-scheduler.ts +121 -0
- package/src/documents/file-system-task-queue.ts +77 -0
- package/src/documents/hydranium-text-documents.ts +1044 -615
- package/src/documents/index.ts +10 -2
- package/src/documents/language-client-shadow.ts +501 -0
- package/src/documents/model-ledger.ts +66 -0
- package/src/documents/text-ledger.ts +112 -0
- package/src/documents/version-sync-service.ts +304 -0
- package/src/index.ts +3 -0
- package/src/langium/ast-extension/ast-extension-service.ts +77 -41
- package/src/langium/ast-extension/ast-node-builder.ts +35 -13
- package/src/langium/bootstrap.ts +79 -43
- package/src/langium/build-phase-pass/build-phase-pass-service.ts +29 -19
- package/src/langium/build-phase-pass/build-phase-pass.ts +37 -8
- package/src/langium/composite-ast-reflection.ts +112 -0
- package/src/langium/config/configuration-provider.ts +119 -0
- package/src/langium/config/index.ts +1 -0
- package/src/langium/diagnostics/console-tee.ts +150 -0
- package/src/langium/diagnostics/hydranium-langium-profiler.ts +15 -39
- package/src/langium/diagnostics/log-preamble.ts +1 -1
- package/src/langium/diagnostics/logger.ts +51 -17
- package/src/langium/diagnostics/lsp-logger.ts +83 -45
- package/src/langium/document-builder/build-pipeline-integration.ts +57 -32
- package/src/langium/document-builder/build-session.ts +4 -3
- package/src/langium/document-builder/document-builder.ts +773 -106
- package/src/langium/integration-services.ts +20 -23
- package/src/langium/integrity/integrity-rule.ts +22 -8
- package/src/langium/integrity/integrity-service.ts +656 -90
- package/src/langium/keys/containment.ts +3 -2
- package/src/langium/keys/name-based-key-provider.ts +24 -12
- package/src/langium/language-module.ts +52 -9
- package/src/langium/model-service/client-session.ts +769 -0
- package/src/langium/model-service/index.ts +2 -0
- package/src/langium/model-service/model-events.ts +82 -0
- package/src/langium/model-service/model-service.ts +885 -532
- package/src/langium/module.ts +141 -65
- package/src/langium/naming/name-provider.ts +34 -8
- package/src/langium/project/abstract-project-manager.ts +409 -20
- package/src/langium/project/project-change-event.ts +25 -3
- package/src/langium/project/project-manager.ts +31 -2
- package/src/langium/project/single-project-manager.ts +16 -1
- package/src/langium/residency/cst-residency-service.ts +210 -87
- package/src/langium/scope/ast-node-description-provider.ts +111 -16
- package/src/langium/scope/built-local-symbols.ts +13 -0
- package/src/langium/scope/fallback-scope.ts +38 -0
- package/src/langium/scope/hydranium-scope-computation.ts +45 -44
- package/src/langium/scope/hydranium-scope-provider.ts +245 -41
- package/src/langium/scope/index.ts +1 -0
- package/src/langium/scope/reference-candidate-provider.ts +6 -5
- package/src/langium/scope/scope-extension-service.ts +148 -56
- package/src/langium/scope/scoped-ast-node-description.ts +1 -3
- package/src/langium/serialization/abstract-serializer.ts +57 -41
- package/src/langium/serialization/json-serializer.ts +14 -3
- package/src/langium/serialization/serializer.ts +1 -1
- package/src/langium/serialization/yaml-serializer.ts +26 -4
- package/src/langium/service-registry.ts +41 -2
- package/src/langium/shared-services.ts +13 -4
- package/src/langium/single-langium-copy.ts +42 -0
- package/src/langium/transfer/transfer-encoder.ts +76 -50
- package/src/langium/trivia/comment-preserver.ts +1410 -0
- package/src/langium/trivia/document-ending-preserver.ts +71 -0
- package/src/langium/trivia/index.ts +14 -0
- package/src/langium/trivia/trivia-contribution.ts +39 -0
- package/src/langium/trivia/trivia-preserver.ts +56 -0
- package/src/langium/trivia/trivia-service.ts +99 -0
- package/src/langium/update-rewrite/update-rewrite-service.ts +1 -1
- package/src/langium/update-rewrite/update-rewrite.ts +1 -1
- package/src/langium/validation/document-validator.ts +312 -31
- package/src/langium/validation/validation-contribution-collector.ts +10 -1
- package/src/langium/workspace/ast-node-locator.ts +33 -0
- package/src/langium/workspace/document-uri-policy.ts +32 -18
- package/src/langium/workspace/file-not-found.ts +35 -0
- package/src/langium/workspace/file-system-provider.ts +258 -16
- package/src/langium/workspace/hydranium-langium-document-factory.ts +239 -4
- package/src/langium/workspace/hydranium-workspace-lock.ts +101 -2
- package/src/langium/workspace/hydranium-workspace-manager.ts +214 -35
- package/src/langium/workspace/in-memory-file-system-provider.ts +54 -23
- package/src/langium/workspace/index.ts +3 -0
- package/src/langium/workspace/initialize-workspace.ts +96 -4
- package/src/langium/workspace/langium-documents.ts +19 -1
- package/src/langium/workspace/persistent-file-system-provider.ts +27 -15
- package/src/{documents → langium/workspace}/self-save-registry.ts +12 -14
- package/src/langium/workspace/syntax-errors.ts +34 -0
- package/src/langium/workspace/virtual-document.ts +106 -25
- package/src/langium/workspace/write-lock-scope.ts +27 -12
- package/src/launcher/integrated-server.ts +3 -1
- package/src/locale/server-locale.ts +6 -6
- package/src/lsp/completion/hydranium-completion-provider.ts +82 -2
- package/src/lsp/connection-features.ts +67 -0
- package/src/lsp/diagnostics-connection.ts +56 -0
- package/src/lsp/edit-requests-guard.ts +152 -0
- package/src/lsp/hydranium-document-update-handler.ts +284 -110
- package/src/lsp/index.ts +6 -2
- package/src/lsp/lsp-latency.ts +62 -0
- package/src/lsp/save-text-document.ts +63 -0
- package/src/lsp/semantic-token-provider.ts +146 -8
- package/src/lsp/shared-module.ts +4 -8
- package/src/lsp/start-language-server.ts +21 -7
- package/src/messages/carriers.ts +4 -6
- package/src/messages/index.ts +11 -2
- package/src/messages/renderer.ts +11 -3
- package/src/node/event-loop-monitor.ts +3 -4
- package/src/node/heap-ceiling.ts +108 -0
- package/src/node/index.ts +5 -1
- package/src/node/latency-from-env.ts +1 -1
- package/src/node/log-file-sink.ts +6 -2
- package/src/node/log-preamble-node.ts +20 -10
- package/src/node/measure-memory.ts +5 -4
- package/src/node/memory-monitor.ts +10 -10
- package/src/node/node-file-system-provider.ts +214 -57
- package/src/node/profile-capture.ts +16 -15
- package/src/node/profiling-run.ts +30 -8
- package/src/node/rename-over-open-readers.ts +94 -0
- package/src/node/server-diagnostics.ts +1 -1
- package/src/node/server-state-snapshot.ts +28 -20
- package/src/node/socket-launcher.ts +78 -14
- package/src/node/startup-cpu-profile.ts +94 -0
- package/src/node/stdio-launcher.ts +29 -19
- package/src/node/validate-workspace.ts +8 -2
- package/src/testing/document-uri-policy-conformance.ts +1 -1
- package/src/testing/fake-document.ts +2 -1
- package/src/testing/index.ts +2 -1
- package/src/testing/langium-test-helpers.ts +1 -0
- package/src/testing/make-test-services.ts +83 -31
- package/src/testing/make-test-tracer.ts +26 -0
- package/src/testing/node/applied-edit-capture.ts +141 -0
- package/src/testing/node/index.ts +4 -1
- package/src/testing/node/lsp-harness.ts +2 -0
- package/src/testing/node/lsp-server-connection.ts +83 -119
- package/src/testing/node/scratch-workspace.ts +12 -6
- package/src/testing/node/settle-server.ts +89 -0
- package/src/testing/node/spawned-server.ts +57 -3
- package/src/testing/parse-semantic-root.ts +1 -1
- package/src/testing/playwright/flaky-network-proxy.ts +240 -0
- package/src/testing/playwright/index.ts +1 -0
- package/src/testing/playwright/server-log-capture.ts +137 -47
- package/src/testing/playwright/server-log-fixture.ts +46 -6
- package/src/testing/playwright/server-log-region.ts +32 -0
- package/src/testing/playwright/server-log-rename-reporter.ts +4 -3
- package/src/testing/run-update-pipeline.ts +8 -5
- package/src/testing/stub-ast-document-manager.ts +47 -123
- package/src/testing/stub-document-builder.ts +128 -15
- package/src/testing/stub-hydranium-text-documents.ts +184 -27
- package/src/testing/stub-langium-documents.ts +3 -2
- package/src/testing/stub-model-service.ts +9 -8
- package/src/testing/stub-project-manager.ts +10 -0
- package/src/testing/stub-self-save-registry.ts +1 -1
- package/src/testing/stub-service-registry.ts +1 -1
- package/src/testing/stub-writable-file-system.ts +3 -2
- package/src/util/connection-liveness.ts +81 -15
- package/src/util/environment.ts +24 -2
- package/lib/documents/language-client-text-shadow.d.ts +0 -124
- package/lib/documents/language-client-text-shadow.d.ts.map +0 -1
- package/lib/documents/language-client-text-shadow.js +0 -190
- package/lib/documents/language-client-text-shadow.js.map +0 -1
- package/lib/documents/self-save-registry.d.ts.map +0 -1
- package/lib/documents/self-save-registry.js.map +0 -1
- package/lib/lsp/instrument-connection.d.ts +0 -36
- package/lib/lsp/instrument-connection.d.ts.map +0 -1
- package/lib/lsp/instrument-connection.js +0 -62
- package/lib/lsp/instrument-connection.js.map +0 -1
- package/lib/node/process-memory.d.ts +0 -66
- package/lib/node/process-memory.d.ts.map +0 -1
- package/lib/node/process-memory.js +0 -252
- package/lib/node/process-memory.js.map +0 -1
- package/src/documents/language-client-text-shadow.ts +0 -211
- package/src/lsp/instrument-connection.ts +0 -66
- package/src/node/process-memory.ts +0 -299
|
@@ -9,17 +9,94 @@
|
|
|
9
9
|
|
|
10
10
|
import { type Tracer } from '@hydranium/protocol';
|
|
11
11
|
import { EmptyFileSystemProvider } from '@hydranium/langium';
|
|
12
|
-
import type { URI } from '@hydranium/langium';
|
|
13
|
-
import { type
|
|
12
|
+
import type { FileSystemNode, FileSystemProvider, URI } from '@hydranium/langium';
|
|
13
|
+
import { type SelfSaveRegistry } from './self-save-registry.js';
|
|
14
14
|
import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
15
15
|
import { type ServerSharedServicesMinimal } from '../shared-services.js';
|
|
16
|
-
import { serveVirtualDocument } from './virtual-document.js';
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* File-system provider extension that supports writes. Langium's standard
|
|
19
|
+
* {@link FileSystemProvider} is read-only; `AstDocumentManager` needs to persist
|
|
20
|
+
* saves, so consumers wire in a provider that implements this superset.
|
|
21
|
+
*
|
|
22
|
+
* Implementations may optionally hold a reference to a
|
|
23
|
+
* {@link SelfSaveRegistry} so they can record their own write mtimes and
|
|
24
|
+
* help downstream file-watchers suppress echo events for those writes.
|
|
25
|
+
* The framework's `DefaultFileSystemProvider` reads it from
|
|
26
|
+
* `services.workspace.SelfSaveRegistry`; alternative implementations can do
|
|
27
|
+
* the same or leave the field unset.
|
|
28
|
+
*/
|
|
29
|
+
export interface WritableFileSystemProvider extends FileSystemProvider {
|
|
30
|
+
writeFile(uri: URI, content: string): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Remove the file at `uri`: the name the URI gives, never the file a
|
|
33
|
+
* symlink there points at, leaving a parent directory it empties in place.
|
|
34
|
+
* A no-op when nothing is there; a directory is refused.
|
|
35
|
+
*/
|
|
36
|
+
deleteFile(uri: URI): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Last-modified time (ms) of the file at `uri`, or `undefined` if it can't
|
|
39
|
+
* be determined (missing file, or a provider with no disk — in-memory /
|
|
40
|
+
* browser). Optional: the only consumer is self-save echo suppression
|
|
41
|
+
* (`didChangeWatchedFiles`), which simply lets a change through when the
|
|
42
|
+
* mtime is unavailable. Distinct from Langium's `stat` (whose
|
|
43
|
+
* `FileSystemNode` carries no mtime). Keeping disk access on the provider
|
|
44
|
+
* seam is what lets the LSP update handler avoid a direct `node:fs` import.
|
|
45
|
+
*/
|
|
46
|
+
mtimeMs?(uri: URI): Promise<number | undefined>;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve `uri` to its real on-disk identity (symlinks collapsed, `..`/`.`
|
|
49
|
+
* walked, case-folded on case-insensitive filesystems), or `undefined` *iff
|
|
50
|
+
* the filesystem knows the path is absent*. The single source of the
|
|
51
|
+
* "nothing loadable here" signal `RealpathDocumentUriPolicy` turns into
|
|
52
|
+
* the synthetic-placeholder branch of `getOrCreateDocument`.
|
|
53
|
+
*
|
|
54
|
+
* Contract for implementers:
|
|
55
|
+
* - A `file:`-backed provider returns the resolved URI when the file exists,
|
|
56
|
+
* and `undefined` when it cannot resolve the path (missing / unreadable).
|
|
57
|
+
* - A non-`file:` URI (or any URI the provider cannot stat) passes through
|
|
58
|
+
* **unchanged** — it is treated as present, never reported absent.
|
|
59
|
+
* - A provider with no disk to check (in-memory / browser / empty) simply
|
|
60
|
+
* omits this method; the framework's `FileSystemProviderRegistry` then
|
|
61
|
+
* returns the URI unchanged, and `RealpathDocumentUriPolicy` answers as
|
|
62
|
+
* the syntactic `DefaultDocumentUriPolicy` does.
|
|
63
|
+
*
|
|
64
|
+
* Synchronous (a `realpath` is a kernel-cached syscall) and optional — the
|
|
65
|
+
* only consumers are the document-identity policy's `canonicalUri`/`loadUri`.
|
|
66
|
+
* Keeping the syscall on the provider seam is what lets the policy stay
|
|
67
|
+
* browser-neutral (no `node:fs` import).
|
|
68
|
+
*/
|
|
69
|
+
realpath?(uri: URI): URI | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* The path `uri` names with every link followed, a link to nothing
|
|
72
|
+
* included, so that `RealpathDocumentUriPolicy.canonicalUri` keys a file
|
|
73
|
+
* reached through a link the same before it exists and once it does.
|
|
74
|
+
* Where {@link realpath} resolves, the same answer; otherwise what is
|
|
75
|
+
* missing joined as spelled under the real path of what exists. Optional,
|
|
76
|
+
* as `realpath` is: without it an absent path keys by its syntactic form.
|
|
77
|
+
*/
|
|
78
|
+
resolveLinks?(uri: URI): URI;
|
|
79
|
+
/**
|
|
80
|
+
* Whether a file is at `uri`, where a miss counts only once it has lasted:
|
|
81
|
+
* on a disk where replacing a file can hide its name for a moment, a single
|
|
82
|
+
* {@link exists} cannot tell that from a deletion. Ask this before acting on
|
|
83
|
+
* a miss as a deletion; a caller expecting a miss, such as a create, asks
|
|
84
|
+
* {@link exists}, since here a real miss costs the whole wait.
|
|
85
|
+
*
|
|
86
|
+
* Optional: a provider whose misses are always final omits it, and a caller
|
|
87
|
+
* takes the answer of {@link exists} as settled.
|
|
88
|
+
*/
|
|
89
|
+
existsSettled?(uri: URI): Promise<boolean>;
|
|
90
|
+
/** Registry the provider records its own writes against. Optional — providers without watcher integration may omit. */
|
|
91
|
+
readonly selfSaveRegistry?: SelfSaveRegistry;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Empty-filesystem {@link WritableFileSystemProvider}. For browser / test / CLI
|
|
96
|
+
* hosts that don't have a real filesystem. All writes and deletes are no-ops.
|
|
97
|
+
* On the portable `.` entry it is the
|
|
98
|
+
* {@link FileSystemProviderRegistry.host} when `context.fileSystemProvider`
|
|
99
|
+
* gives no writable provider; the Node-backed `DefaultFileSystemProvider`
|
|
23
100
|
* lives in `@hydranium/core/node` (it pulls `node:fs`).
|
|
24
101
|
*/
|
|
25
102
|
export class DefaultEmptyFileSystemProvider extends EmptyFileSystemProvider implements WritableFileSystemProvider {
|
|
@@ -37,16 +114,181 @@ export class DefaultEmptyFileSystemProvider extends EmptyFileSystemProvider impl
|
|
|
37
114
|
// no-op
|
|
38
115
|
}
|
|
39
116
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
117
|
+
async deleteFile(_uri: URI): Promise<void> {
|
|
118
|
+
// no-op
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// `async` so the base's refusal becomes a rejection: it throws
|
|
122
|
+
// SYNCHRONOUSLY from a method declared to return a promise, and a
|
|
123
|
+
// synchronous throw escapes the promise chain — `.catch()` never attaches
|
|
124
|
+
// and `Promise.all` dies while its argument array is still being built, so
|
|
125
|
+
// a caller reading several URIs cannot handle the miss it asked about. The
|
|
126
|
+
// base declares `readFile` and `readBinary` param-less, so the param is
|
|
127
|
+
// optional there.
|
|
128
|
+
override async readFile(_uri?: URI): Promise<string> {
|
|
129
|
+
return super.readFile();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
override async readBinary(_uri?: URI): Promise<Uint8Array> {
|
|
133
|
+
return super.readBinary();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
override async stat(uri: URI): Promise<FileSystemNode> {
|
|
137
|
+
return super.stat(uri);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The provider bound on `workspace.FileSystemProvider`: it dispatches each call
|
|
143
|
+
* by the URI's scheme to the provider registered for it in the shared
|
|
144
|
+
* `fileSystemProviders` group, and to the {@link host} for any scheme without
|
|
145
|
+
* one.
|
|
146
|
+
*
|
|
147
|
+
* So one provider answers for each scheme, and a host's provider needs to know
|
|
148
|
+
* only its own: the framework registers `virtual:` there, and an adopter adds a
|
|
149
|
+
* scheme by contributing to the group. The host takes every unclaimed scheme
|
|
150
|
+
* rather than `file:` alone, which keeps an in-memory workspace under `memory:`
|
|
151
|
+
* or any other scheme on the host's provider.
|
|
152
|
+
*
|
|
153
|
+
* `THost` types the host, so an adopter whose own provider has more members
|
|
154
|
+
* than the base declares the slot as `FileSystemProviderRegistry<MyProvider>`,
|
|
155
|
+
* binds a {@link DefaultFileSystemProviderRegistry} with that host, and reads
|
|
156
|
+
* those members through `services.workspace.FileSystemProvider.host`.
|
|
157
|
+
*/
|
|
158
|
+
export interface FileSystemProviderRegistry<
|
|
159
|
+
THost extends WritableFileSystemProvider = WritableFileSystemProvider
|
|
160
|
+
> extends WritableFileSystemProvider {
|
|
161
|
+
/** The provider for every scheme no entry of `fileSystemProviders` claims. */
|
|
162
|
+
readonly host: THost;
|
|
163
|
+
/** The provider that answers for `uri`. */
|
|
164
|
+
providerFor(uri: URI): WritableFileSystemProvider;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** Whether `provider` dispatches by scheme, as the provider bound on `workspace.FileSystemProvider` does. */
|
|
168
|
+
export function isFileSystemProviderRegistry(provider: WritableFileSystemProvider): provider is FileSystemProviderRegistry {
|
|
169
|
+
return 'providerFor' in provider && typeof provider.providerFor === 'function';
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Options for {@link DefaultFileSystemProviderRegistry}. */
|
|
173
|
+
export interface FileSystemProviderRegistryOptions<
|
|
174
|
+
THost extends WritableFileSystemProvider = WritableFileSystemProvider
|
|
175
|
+
> extends LogNameOptions {
|
|
176
|
+
/**
|
|
177
|
+
* The provider for every scheme no entry of `fileSystemProviders` claims.
|
|
178
|
+
* The framework passes the provider `context.fileSystemProvider` returns,
|
|
179
|
+
* or a {@link DefaultEmptyFileSystemProvider} when that is not writable.
|
|
180
|
+
*/
|
|
181
|
+
host: THost;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The framework's {@link FileSystemProviderRegistry}.
|
|
186
|
+
*
|
|
187
|
+
* A directory is listed by the provider of its own scheme, so a workspace
|
|
188
|
+
* root's tree comes from that provider alone.
|
|
189
|
+
*
|
|
190
|
+
* `realpath`, `resolveLinks`, `mtimeMs` and `existsSettled` are always present
|
|
191
|
+
* and forward to the scheme's provider. Where that provider lacks one,
|
|
192
|
+
* `realpath` and `resolveLinks` return the URI unchanged, `mtimeMs` returns
|
|
193
|
+
* `undefined` and `existsSettled` answers as `exists`: the answers their
|
|
194
|
+
* callers already give a provider without them.
|
|
195
|
+
*/
|
|
196
|
+
export class DefaultFileSystemProviderRegistry<
|
|
197
|
+
THost extends WritableFileSystemProvider = WritableFileSystemProvider
|
|
198
|
+
> implements FileSystemProviderRegistry<THost> {
|
|
199
|
+
readonly host: THost;
|
|
200
|
+
protected readonly tracer: Tracer;
|
|
201
|
+
|
|
202
|
+
constructor(
|
|
203
|
+
protected readonly services: ServerSharedServicesMinimal & { fileSystemProviders: Record<string, WritableFileSystemProvider> },
|
|
204
|
+
options: FileSystemProviderRegistryOptions<THost>
|
|
205
|
+
) {
|
|
206
|
+
this.host = options.host;
|
|
207
|
+
this.tracer = services.Tracer.for(options.logName ?? this.constructor.name).trace('instantiated');
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The group is read per call, not in the constructor, so a registered
|
|
212
|
+
* provider is built on first use and may read slots that reach back to this
|
|
213
|
+
* one. Only an OWN key of the group counts: the DI container resolves any
|
|
214
|
+
* key found on the prototype chain, so a scheme such as `constructor` would
|
|
215
|
+
* otherwise dispatch to a function.
|
|
216
|
+
*/
|
|
217
|
+
providerFor(uri: URI): WritableFileSystemProvider {
|
|
218
|
+
const providers = this.services.fileSystemProviders;
|
|
219
|
+
return Object.hasOwn(providers, uri.scheme) ? providers[uri.scheme] : this.host;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// The async methods are `async` so a provider that throws synchronously from
|
|
223
|
+
// one still rejects, for the reason `DefaultEmptyFileSystemProvider` gives.
|
|
224
|
+
async writeFile(uri: URI, content: string): Promise<void> {
|
|
225
|
+
return this.providerFor(uri).writeFile(uri, content);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
async deleteFile(uri: URI): Promise<void> {
|
|
229
|
+
return this.providerFor(uri).deleteFile(uri);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
async mtimeMs(uri: URI): Promise<number | undefined> {
|
|
233
|
+
return this.providerFor(uri).mtimeMs?.(uri);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
realpath(uri: URI): URI | undefined {
|
|
237
|
+
const provider = this.providerFor(uri);
|
|
238
|
+
return provider.realpath ? provider.realpath(uri) : uri;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
resolveLinks(uri: URI): URI {
|
|
242
|
+
const provider = this.providerFor(uri);
|
|
243
|
+
if (provider.resolveLinks) {
|
|
244
|
+
return provider.resolveLinks(uri);
|
|
245
|
+
}
|
|
246
|
+
// A provider with `realpath` alone still keys a present path by it.
|
|
247
|
+
return provider.realpath?.(uri) ?? uri;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
async existsSettled(uri: URI): Promise<boolean> {
|
|
251
|
+
const provider = this.providerFor(uri);
|
|
252
|
+
return provider.existsSettled ? provider.existsSettled(uri) : provider.exists(uri);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
async stat(uri: URI): Promise<FileSystemNode> {
|
|
256
|
+
return this.providerFor(uri).stat(uri);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
statSync(uri: URI): FileSystemNode {
|
|
260
|
+
return this.providerFor(uri).statSync(uri);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
async exists(uri: URI): Promise<boolean> {
|
|
264
|
+
return this.providerFor(uri).exists(uri);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
existsSync(uri: URI): boolean {
|
|
268
|
+
return this.providerFor(uri).existsSync(uri);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
async readBinary(uri: URI): Promise<Uint8Array> {
|
|
272
|
+
return this.providerFor(uri).readBinary(uri);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
readBinarySync(uri: URI): Uint8Array {
|
|
276
|
+
return this.providerFor(uri).readBinarySync(uri);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
async readFile(uri: URI): Promise<string> {
|
|
280
|
+
return this.providerFor(uri).readFile(uri);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
readFileSync(uri: URI): string {
|
|
284
|
+
return this.providerFor(uri).readFileSync(uri);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
async readDirectory(uri: URI): Promise<FileSystemNode[]> {
|
|
288
|
+
return this.providerFor(uri).readDirectory(uri);
|
|
46
289
|
}
|
|
47
290
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return served !== undefined ? served : super.readFileSync();
|
|
291
|
+
readDirectorySync(uri: URI): FileSystemNode[] {
|
|
292
|
+
return this.providerFor(uri).readDirectorySync(uri);
|
|
51
293
|
}
|
|
52
294
|
}
|
|
@@ -9,13 +9,29 @@
|
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
type AstNode,
|
|
12
|
+
type AstReflection,
|
|
12
13
|
AstUtils,
|
|
13
14
|
DefaultLangiumDocumentFactory,
|
|
15
|
+
DocumentState,
|
|
16
|
+
isAstNode,
|
|
17
|
+
isMultiReference,
|
|
14
18
|
type LangiumDocument,
|
|
19
|
+
type Linker,
|
|
20
|
+
type MultiReference,
|
|
21
|
+
type Mutable,
|
|
15
22
|
type ParseResult,
|
|
23
|
+
type Reference,
|
|
24
|
+
type ReferenceInfo,
|
|
16
25
|
type URI
|
|
17
26
|
} from '@hydranium/langium';
|
|
27
|
+
import { type CancellationToken } from 'vscode-languageserver-protocol';
|
|
28
|
+
import { type TextDocument } from 'vscode-languageserver-textdocument';
|
|
29
|
+
import { STALE_VERSION } from '@hydranium/protocol';
|
|
30
|
+
import { type ModelLedger } from '../../documents/model-ledger.js';
|
|
31
|
+
import { type CstResidencyService } from '../residency/cst-residency-service.js';
|
|
32
|
+
import { type VersionSyncService } from '../../documents/version-sync-service.js';
|
|
18
33
|
import { type ExtendedServiceRegistry } from '../service-registry.js';
|
|
34
|
+
import { type ServerSharedServicesMinimal } from '../shared-services.js';
|
|
19
35
|
import { type Serializer } from '../serialization/serializer.js';
|
|
20
36
|
|
|
21
37
|
/** Structural view of the per-language serializer slot on the resolved services. */
|
|
@@ -36,10 +52,18 @@ interface WithSerializer {
|
|
|
36
52
|
* scope descriptions pointing at them, stay valid. A `fromString` document
|
|
37
53
|
* already carries its source, so only `fromModel` needs help.
|
|
38
54
|
*
|
|
55
|
+
* The first build grafts the CST of that text onto the model, as for a shed
|
|
56
|
+
* document, which gives every reference the `$refNode` the reference index
|
|
57
|
+
* needs. A model that does not pair node for node with its serialized text is
|
|
58
|
+
* re-parsed instead, and its nodes are replaced: from its file, or from the
|
|
59
|
+
* text it holds when no file is at its URI, since reading the URI would throw.
|
|
60
|
+
* While the document is open, the store's text wins.
|
|
61
|
+
*
|
|
39
62
|
* Degrades to Langium's text-less `fromModel` when no serializer is bound for
|
|
40
|
-
* the URI's language (the serializer throws or is absent)
|
|
41
|
-
*
|
|
42
|
-
*
|
|
63
|
+
* the URI's language (the serializer throws or is absent). Its first build
|
|
64
|
+
* re-reads it from the store or its file, replacing its nodes, as Langium
|
|
65
|
+
* does. With neither, it keeps its nodes but gets no CST, so its references
|
|
66
|
+
* stay out of the reference index and it is not relinked.
|
|
43
67
|
*
|
|
44
68
|
* Also links the model's container properties (`$container` /
|
|
45
69
|
* `$containerProperty` / `$containerIndex`), which Langium's parser sets via
|
|
@@ -57,6 +81,24 @@ export class HydraniumLangiumDocumentFactory extends DefaultLangiumDocumentFacto
|
|
|
57
81
|
*/
|
|
58
82
|
declare protected readonly serviceRegistry: ExtendedServiceRegistry;
|
|
59
83
|
|
|
84
|
+
/** A thunk: a version-sync service whose constructor reads this factory would otherwise be a cycle. */
|
|
85
|
+
protected readonly versionSyncService: () => VersionSyncService;
|
|
86
|
+
/** A thunk: a ledger whose constructor reads this factory would otherwise be a cycle. */
|
|
87
|
+
protected readonly modelLedger: () => ModelLedger;
|
|
88
|
+
/** A thunk: the residency service resolves `LangiumDocuments`, which is built with this factory. */
|
|
89
|
+
protected readonly cstResidency: () => CstResidencyService;
|
|
90
|
+
/** The code-built documents, which are re-read from the text they hold when no file is at their URI. */
|
|
91
|
+
protected readonly codeBuiltDocuments = new WeakSet<LangiumDocument>();
|
|
92
|
+
protected readonly astReflection: AstReflection;
|
|
93
|
+
|
|
94
|
+
constructor(services: ServerSharedServicesMinimal) {
|
|
95
|
+
super(services);
|
|
96
|
+
this.astReflection = services.AstReflection;
|
|
97
|
+
this.versionSyncService = () => services.workspace.VersionSyncService;
|
|
98
|
+
this.modelLedger = () => services.workspace.ModelLedger;
|
|
99
|
+
this.cstResidency = () => services.workspace.CstResidencyService;
|
|
100
|
+
}
|
|
101
|
+
|
|
60
102
|
/**
|
|
61
103
|
* Parse `text` for `uri` under the grammar `languageId` names, instead of
|
|
62
104
|
* the one `uri` routes to.
|
|
@@ -87,12 +129,205 @@ export class HydraniumLangiumDocumentFactory extends DefaultLangiumDocumentFacto
|
|
|
87
129
|
// Make the code-built AST as structurally complete as a parsed one — the
|
|
88
130
|
// parser links containers, `fromModel` does not. In place (identity kept).
|
|
89
131
|
AstUtils.linkContentToContainer(model, { deep: true });
|
|
132
|
+
// The parser fills in the defaults a model built in code may leave out.
|
|
133
|
+
// Filled before serializing, since a serializer may read them, and
|
|
134
|
+
// without them the model does not pair with the parse of its text.
|
|
135
|
+
for (const node of AstUtils.streamAst(model)) {
|
|
136
|
+
AstUtils.assignMandatoryProperties(this.astReflection, node);
|
|
137
|
+
}
|
|
90
138
|
const text = this.serializeModel(model, uri);
|
|
91
139
|
if (text === undefined) {
|
|
92
140
|
return super.fromModel(model, uri);
|
|
93
141
|
}
|
|
94
142
|
const parseResult: ParseResult<T> = { value: model, parserErrors: [], lexerErrors: [] };
|
|
95
|
-
|
|
143
|
+
const document = this.createLangiumDocument<T>(parseResult, uri, undefined, text);
|
|
144
|
+
this.codeBuiltDocuments.add(document);
|
|
145
|
+
const linker = this.serviceRegistry.getServices(uri).references.Linker;
|
|
146
|
+
document.references = AstUtils.streamAst(model)
|
|
147
|
+
.flatMap(node => AstUtils.streamReferences(node))
|
|
148
|
+
.toArray()
|
|
149
|
+
.flatMap(info => this.rebuildReference(linker, info) ?? []);
|
|
150
|
+
return document;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Replace a code-set reference with one the linker built, holding the same
|
|
155
|
+
* target. A relink resets and the reference index reads only such
|
|
156
|
+
* references, and only those listed in `document.references`. The first
|
|
157
|
+
* build unlinks them before its link phase, which resolves and indexes them.
|
|
158
|
+
* The target is kept in the field Langium's references hold it in, so a
|
|
159
|
+
* linker whose references have no such field resolves it on first read.
|
|
160
|
+
* `undefined` when the reference has no slot to go back in.
|
|
161
|
+
*/
|
|
162
|
+
protected rebuildReference(
|
|
163
|
+
linker: Linker,
|
|
164
|
+
{ reference, container, property, index }: ReferenceInfo
|
|
165
|
+
): Reference | MultiReference | undefined {
|
|
166
|
+
const owner: unknown = Reflect.get(container, property);
|
|
167
|
+
if (index !== undefined && !Array.isArray(owner)) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
let rebuilt: Reference | MultiReference;
|
|
171
|
+
if (isMultiReference(reference)) {
|
|
172
|
+
// Read through the field, as `items` would resolve a linker-built reference.
|
|
173
|
+
const items = '_items' in reference ? reference._items : reference.items;
|
|
174
|
+
const multi = linker.buildMultiReference(container, property, reference.$refNode, reference.$refText);
|
|
175
|
+
if ('_items' in multi) {
|
|
176
|
+
multi._items = Array.isArray(items) ? [...items] : undefined;
|
|
177
|
+
}
|
|
178
|
+
rebuilt = multi;
|
|
179
|
+
} else {
|
|
180
|
+
const target = '_ref' in reference ? reference._ref : reference.ref;
|
|
181
|
+
const single = linker.buildReference(container, property, reference.$refNode, reference.$refText);
|
|
182
|
+
if ('_ref' in single) {
|
|
183
|
+
single._ref = isAstNode(target) ? target : undefined;
|
|
184
|
+
}
|
|
185
|
+
rebuilt = single;
|
|
186
|
+
}
|
|
187
|
+
if (Array.isArray(owner) && index !== undefined) {
|
|
188
|
+
owner[index] = rebuilt;
|
|
189
|
+
} else {
|
|
190
|
+
Reflect.set(container, property, rebuilt);
|
|
191
|
+
}
|
|
192
|
+
return rebuilt;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
protected override createLangiumDocument<T extends AstNode = AstNode>(
|
|
196
|
+
parseResult: ParseResult<T>,
|
|
197
|
+
uri: URI,
|
|
198
|
+
textDocument?: TextDocument,
|
|
199
|
+
text?: string
|
|
200
|
+
): LangiumDocument<T> {
|
|
201
|
+
const document = super.createLangiumDocument(parseResult, uri, textDocument, text);
|
|
202
|
+
// Without `textDocument` Langium creates one at version 0 on first read,
|
|
203
|
+
// which needs a language for `uri` that a folder URI does not have.
|
|
204
|
+
const parsed = parseResult.value.$cstNode?.root.fullText ?? text ?? textDocument?.getText();
|
|
205
|
+
const version = this.versionOfParsedText(uri, parsed, textDocument?.version ?? 0);
|
|
206
|
+
// A `fromModel` root has no CST to hold its serialized text. Recorded, it
|
|
207
|
+
// is the text a build grafts a CST from, keeping the model's nodes.
|
|
208
|
+
this.versionSyncService().modelProduced(document, { version, text: parseResult.value.$cstNode ? undefined : text });
|
|
209
|
+
return document;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The version is read before the parse, for the same reason as in
|
|
214
|
+
* {@link update}: the text document is the store's, which an edit updates
|
|
215
|
+
* in place while the parse runs.
|
|
216
|
+
*/
|
|
217
|
+
protected override async createAsync<T extends AstNode = AstNode>(
|
|
218
|
+
uri: URI,
|
|
219
|
+
content: string | TextDocument,
|
|
220
|
+
cancelToken: CancellationToken
|
|
221
|
+
): Promise<LangiumDocument<T>> {
|
|
222
|
+
const version = typeof content === 'string' ? undefined : content.version;
|
|
223
|
+
const document = await super.createAsync<T>(uri, content, cancelToken);
|
|
224
|
+
if (version !== undefined) {
|
|
225
|
+
this.versionSyncService().modelProduced(document, { version });
|
|
226
|
+
}
|
|
227
|
+
return document;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The store's version is read before Langium's `update`, which reads the
|
|
232
|
+
* store's text before its first await: read after, it can belong to an
|
|
233
|
+
* edit that arrived while the parse ran.
|
|
234
|
+
*
|
|
235
|
+
* Reconciled with the store here rather than in a `Parsed` listener, which
|
|
236
|
+
* a cancel skips, leaving the root on the version of its earlier text.
|
|
237
|
+
*/
|
|
238
|
+
override async update<T extends AstNode = AstNode>(
|
|
239
|
+
document: Mutable<LangiumDocument<T>>,
|
|
240
|
+
cancellationToken: CancellationToken
|
|
241
|
+
): Promise<LangiumDocument<T>> {
|
|
242
|
+
// Langium keeps the AST when the CST's text equals the new text, but a
|
|
243
|
+
// shed document has no CST and would get new AST nodes, leaving its
|
|
244
|
+
// dependents on the old ones. Grafted only when the new text is the text
|
|
245
|
+
// the AST was parsed from, so an edit on disk or in the store is still
|
|
246
|
+
// re-parsed. Not `isCstShed`: the builder has already reset the document
|
|
247
|
+
// to `Changed`. A refused or diverged graft re-parses, and a build after
|
|
248
|
+
// this one relinks the dependents: this build has prepared its
|
|
249
|
+
// documents, and a reset now would drop their build state.
|
|
250
|
+
const root = document.parseResult.value;
|
|
251
|
+
const parsedFrom = root.$cstNode === undefined ? this.modelLedger().textOf(root) : undefined;
|
|
252
|
+
const codeBuilt = await this.codeBuiltSource(document);
|
|
253
|
+
if (parsedFrom !== undefined) {
|
|
254
|
+
const text =
|
|
255
|
+
codeBuilt?.text ??
|
|
256
|
+
this.textDocuments?.get(document.uri.toString())?.getText() ??
|
|
257
|
+
(await this.fileSystemProvider.readFile(document.uri));
|
|
258
|
+
if (text === parsedFrom) {
|
|
259
|
+
this.cstResidency().rehydrate(document);
|
|
260
|
+
if (root.$cstNode === undefined) {
|
|
261
|
+
this.versionSyncService().rebuildWhileCurrent(document);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const stored = codeBuilt === undefined ? this.textDocuments?.get(document.uri.toString())?.version : codeBuilt.version;
|
|
266
|
+
const updated =
|
|
267
|
+
codeBuilt === undefined
|
|
268
|
+
? await super.update(document, cancellationToken)
|
|
269
|
+
: await this.reparse(document, codeBuilt.text, cancellationToken);
|
|
270
|
+
const version =
|
|
271
|
+
stored ??
|
|
272
|
+
this.versionOfParsedText(
|
|
273
|
+
updated.uri,
|
|
274
|
+
this.modelLedger().textOf(updated.parseResult.value) ?? updated.textDocument.getText(),
|
|
275
|
+
updated.textDocument.version
|
|
276
|
+
);
|
|
277
|
+
this.versionSyncService().modelProduced(updated, { version });
|
|
278
|
+
return updated;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* The text a code-built document is read from when no file is at its URI:
|
|
283
|
+
* the store's while it is open, else the text it holds, serialized at
|
|
284
|
+
* creation or last read, as `VirtualFileSystemProvider` serves it.
|
|
285
|
+
* `undefined` for any other document, which is read as Langium reads it.
|
|
286
|
+
* The store's version is read with its text, since an edit can land
|
|
287
|
+
* before the caller resumes. Held text has no version.
|
|
288
|
+
*/
|
|
289
|
+
protected async codeBuiltSource(document: LangiumDocument): Promise<{ text: string; version: number | undefined } | undefined> {
|
|
290
|
+
if (!this.codeBuiltDocuments.has(document) || (await this.fileSystemProvider.exists(document.uri))) {
|
|
291
|
+
return undefined;
|
|
292
|
+
}
|
|
293
|
+
const open = this.textDocuments?.get(document.uri.toString());
|
|
294
|
+
return open === undefined
|
|
295
|
+
? { text: document.textDocument.getText(), version: undefined }
|
|
296
|
+
: { text: open.getText(), version: open.version };
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Langium's `update` with `text` in place of the text it reads from the
|
|
301
|
+
* store or the URI. Mirrors `DefaultLangiumDocumentFactory.update` of
|
|
302
|
+
* Langium 4.3.1, so a Langium upgrade has to compare the two. From
|
|
303
|
+
* Langium 4.4, an override of `getUpdatedText` replaces it.
|
|
304
|
+
*/
|
|
305
|
+
protected async reparse<T extends AstNode = AstNode>(
|
|
306
|
+
document: Mutable<LangiumDocument<T>>,
|
|
307
|
+
text: string,
|
|
308
|
+
cancellationToken: CancellationToken
|
|
309
|
+
): Promise<LangiumDocument<T>> {
|
|
310
|
+
const textDocument = this.textDocuments?.get(document.uri.toString());
|
|
311
|
+
Object.defineProperty(
|
|
312
|
+
document,
|
|
313
|
+
'textDocument',
|
|
314
|
+
textDocument ? { value: textDocument } : { get: this.createTextDocumentGetter(document.uri, text) }
|
|
315
|
+
);
|
|
316
|
+
if (document.parseResult.value.$cstNode?.root.fullText !== text) {
|
|
317
|
+
document.parseResult = await this.parseAsync<T>(document.uri, text, cancellationToken);
|
|
318
|
+
(document.parseResult.value as Mutable<AstNode>).$document = document;
|
|
319
|
+
}
|
|
320
|
+
document.state = DocumentState.Parsed;
|
|
321
|
+
return document;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* `version`, or {@link STALE_VERSION} when the store holds `uri` open with
|
|
326
|
+
* other text than `parsed`: text read from the file while an open landed.
|
|
327
|
+
*/
|
|
328
|
+
protected versionOfParsedText(uri: URI, parsed: string | undefined, version: number): number {
|
|
329
|
+
const open = this.textDocuments?.get(uri.toString());
|
|
330
|
+
return open !== undefined && parsed !== undefined && open.getText() !== parsed ? STALE_VERSION : version;
|
|
96
331
|
}
|
|
97
332
|
|
|
98
333
|
/**
|