@hydranium/core 1.0.0-next.34 → 1.0.0-next.341
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 +256 -124
- package/lib/documents/ast-document-manager.d.ts.map +1 -1
- package/lib/documents/ast-document-manager.js +293 -132
- package/lib/documents/ast-document-manager.js.map +1 -1
- package/lib/documents/client-ids.d.ts +5 -19
- package/lib/documents/client-ids.d.ts.map +1 -1
- package/lib/documents/client-ids.js +5 -19
- package/lib/documents/client-ids.js.map +1 -1
- package/lib/documents/client-session-errors.d.ts +15 -0
- package/lib/documents/client-session-errors.d.ts.map +1 -0
- package/lib/documents/client-session-errors.js +15 -0
- package/lib/documents/client-session-errors.js.map +1 -0
- package/lib/documents/client-session-registry.d.ts +146 -0
- package/lib/documents/client-session-registry.d.ts.map +1 -0
- package/lib/documents/client-session-registry.js +207 -0
- package/lib/documents/client-session-registry.js.map +1 -0
- package/lib/documents/dirty-state-tracker.d.ts +101 -0
- package/lib/documents/dirty-state-tracker.d.ts.map +1 -0
- package/lib/documents/dirty-state-tracker.js +85 -0
- package/lib/documents/dirty-state-tracker.js.map +1 -0
- package/lib/documents/document-release-handler.d.ts +204 -0
- package/lib/documents/document-release-handler.d.ts.map +1 -0
- package/lib/documents/document-release-handler.js +317 -0
- package/lib/documents/document-release-handler.js.map +1 -0
- package/lib/documents/document-release-scheduler.d.ts +67 -0
- package/lib/documents/document-release-scheduler.d.ts.map +1 -0
- package/lib/documents/document-release-scheduler.js +80 -0
- package/lib/documents/document-release-scheduler.js.map +1 -0
- package/lib/documents/file-system-task-queue.d.ts +52 -0
- package/lib/documents/file-system-task-queue.d.ts.map +1 -0
- package/lib/documents/file-system-task-queue.js +37 -0
- package/lib/documents/file-system-task-queue.js.map +1 -0
- package/lib/documents/hydranium-text-documents.d.ts +445 -282
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
- package/lib/documents/hydranium-text-documents.js +903 -483
- package/lib/documents/hydranium-text-documents.js.map +1 -1
- package/lib/documents/index.d.ts +10 -2
- package/lib/documents/index.d.ts.map +1 -1
- package/lib/documents/index.js +10 -2
- package/lib/documents/index.js.map +1 -1
- package/lib/documents/language-client-shadow.d.ts +234 -0
- package/lib/documents/language-client-shadow.d.ts.map +1 -0
- package/lib/documents/language-client-shadow.js +306 -0
- package/lib/documents/language-client-shadow.js.map +1 -0
- package/lib/documents/model-ledger.d.ts +47 -0
- package/lib/documents/model-ledger.d.ts.map +1 -0
- package/lib/documents/model-ledger.js +30 -0
- package/lib/documents/model-ledger.js.map +1 -0
- package/lib/documents/text-ledger.d.ts +64 -0
- package/lib/documents/text-ledger.d.ts.map +1 -0
- package/lib/documents/text-ledger.js +63 -0
- package/lib/documents/text-ledger.js.map +1 -0
- package/lib/documents/version-sync-service.d.ts +138 -0
- package/lib/documents/version-sync-service.d.ts.map +1 -0
- package/lib/documents/version-sync-service.js +173 -0
- package/lib/documents/version-sync-service.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -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 +83 -44
- 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 +142 -0
- package/lib/langium/diagnostics/console-tee.js.map +1 -0
- package/lib/langium/diagnostics/format-log-arg.d.ts +18 -0
- package/lib/langium/diagnostics/format-log-arg.d.ts.map +1 -0
- package/lib/langium/diagnostics/format-log-arg.js +36 -0
- package/lib/langium/diagnostics/format-log-arg.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 -45
- 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 +28 -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 +283 -41
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
- package/lib/langium/document-builder/document-builder.js +449 -79
- package/lib/langium/document-builder/document-builder.js.map +1 -1
- package/lib/langium/documentation/comment-provider.d.ts.map +1 -1
- package/lib/langium/documentation/comment-provider.js.map +1 -1
- package/lib/langium/integration-services.d.ts +40 -24
- package/lib/langium/integration-services.d.ts.map +1 -1
- package/lib/langium/integration-services.js +7 -4
- package/lib/langium/integration-services.js.map +1 -1
- package/lib/langium/integrity/integrity-rule.d.ts +17 -8
- package/lib/langium/integrity/integrity-rule.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-rule.js.map +1 -1
- package/lib/langium/integrity/integrity-service.d.ts +95 -27
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-service.js +303 -63
- package/lib/langium/integrity/integrity-service.js.map +1 -1
- package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -1
- 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 +18 -4
- package/lib/langium/language-module.js.map +1 -1
- package/lib/langium/model-service/client-session.d.ts +383 -0
- package/lib/langium/model-service/client-session.d.ts.map +1 -0
- package/lib/langium/model-service/client-session.js +455 -0
- package/lib/langium/model-service/client-session.js.map +1 -0
- package/lib/langium/model-service/index.d.ts +2 -0
- package/lib/langium/model-service/index.d.ts.map +1 -1
- package/lib/langium/model-service/index.js +2 -0
- package/lib/langium/model-service/index.js.map +1 -1
- package/lib/langium/model-service/model-events.d.ts +66 -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 +456 -300
- package/lib/langium/model-service/model-service.d.ts.map +1 -1
- package/lib/langium/model-service/model-service.js +571 -466
- package/lib/langium/model-service/model-service.js.map +1 -1
- package/lib/langium/module.d.ts +141 -40
- package/lib/langium/module.d.ts.map +1 -1
- package/lib/langium/module.js +52 -40
- package/lib/langium/module.js.map +1 -1
- package/lib/langium/naming/name-provider.d.ts +32 -7
- package/lib/langium/naming/name-provider.d.ts.map +1 -1
- package/lib/langium/naming/name-provider.js +10 -4
- package/lib/langium/naming/name-provider.js.map +1 -1
- package/lib/langium/naming/name-separator-validation.d.ts.map +1 -1
- package/lib/langium/project/abstract-project-manager.d.ts.map +1 -1
- package/lib/langium/project/abstract-project-manager.js +13 -6
- package/lib/langium/project/abstract-project-manager.js.map +1 -1
- package/lib/langium/project/project-change-event.d.ts +2 -2
- package/lib/langium/project/single-project-manager.d.ts.map +1 -1
- package/lib/langium/project/single-project-manager.js.map +1 -1
- package/lib/langium/residency/cst-residency-service.d.ts +38 -14
- package/lib/langium/residency/cst-residency-service.d.ts.map +1 -1
- package/lib/langium/residency/cst-residency-service.js +24 -58
- package/lib/langium/residency/cst-residency-service.js.map +1 -1
- package/lib/langium/scope/ast-node-description-provider.d.ts.map +1 -1
- package/lib/langium/scope/ast-node-description-provider.js.map +1 -1
- 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 +66 -26
- package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.js +114 -33
- 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 +41 -37
- package/lib/langium/scope/scope-extension-service.d.ts.map +1 -1
- package/lib/langium/scope/scope-extension-service.js +57 -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 +4 -0
- package/lib/langium/serialization/yaml-serializer.d.ts.map +1 -1
- package/lib/langium/serialization/yaml-serializer.js +4 -0
- 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 +13 -7
- 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 +86 -37
- package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -1
- package/lib/langium/transfer/transfer-encoder.js +36 -25
- package/lib/langium/transfer/transfer-encoder.js.map +1 -1
- package/lib/langium/trivia/comment-preserver.d.ts +543 -0
- package/lib/langium/trivia/comment-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/comment-preserver.js +1164 -0
- package/lib/langium/trivia/comment-preserver.js.map +1 -0
- package/lib/langium/trivia/document-ending-preserver.d.ts +51 -0
- package/lib/langium/trivia/document-ending-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/document-ending-preserver.js +62 -0
- package/lib/langium/trivia/document-ending-preserver.js.map +1 -0
- package/lib/langium/trivia/index.d.ts +14 -0
- package/lib/langium/trivia/index.d.ts.map +1 -0
- package/lib/langium/trivia/index.js +14 -0
- package/lib/langium/trivia/index.js.map +1 -0
- package/lib/langium/trivia/trivia-contribution.d.ts +37 -0
- package/lib/langium/trivia/trivia-contribution.d.ts.map +1 -0
- package/lib/langium/trivia/trivia-contribution.js +10 -0
- package/lib/langium/trivia/trivia-contribution.js.map +1 -0
- package/lib/langium/trivia/trivia-preserver.d.ts +52 -0
- package/lib/langium/trivia/trivia-preserver.d.ts.map +1 -0
- package/lib/langium/trivia/trivia-preserver.js +10 -0
- package/lib/langium/trivia/trivia-preserver.js.map +1 -0
- package/lib/langium/trivia/trivia-service.d.ts +70 -0
- package/lib/langium/trivia/trivia-service.d.ts.map +1 -0
- package/lib/langium/trivia/trivia-service.js +56 -0
- package/lib/langium/trivia/trivia-service.js.map +1 -0
- package/lib/langium/update-rewrite/normalize-empty-strings.d.ts.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite-service.d.ts +1 -1
- package/lib/langium/update-rewrite/update-rewrite-service.d.ts.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite-service.js.map +1 -1
- package/lib/langium/update-rewrite/update-rewrite.d.ts +1 -1
- package/lib/langium/validation/document-validator.d.ts +168 -23
- package/lib/langium/validation/document-validator.d.ts.map +1 -1
- package/lib/langium/validation/document-validator.js +264 -26
- package/lib/langium/validation/document-validator.js.map +1 -1
- package/lib/langium/validation/validation-contribution-collector.d.ts +9 -1
- package/lib/langium/validation/validation-contribution-collector.d.ts.map +1 -1
- package/lib/langium/validation/validation-contribution-collector.js +1 -1
- package/lib/langium/validation/validation-contribution-collector.js.map +1 -1
- package/lib/langium/workspace/document-uri-policy.d.ts +24 -15
- package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -1
- package/lib/langium/workspace/document-uri-policy.js +22 -13
- package/lib/langium/workspace/document-uri-policy.js.map +1 -1
- package/lib/langium/workspace/file-not-found.d.ts +23 -0
- package/lib/langium/workspace/file-not-found.d.ts.map +1 -0
- package/lib/langium/workspace/file-not-found.js +31 -0
- package/lib/langium/workspace/file-not-found.js.map +1 -0
- package/lib/langium/workspace/file-system-provider.d.ts +167 -8
- package/lib/langium/workspace/file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/file-system-provider.js +115 -13
- package/lib/langium/workspace/file-system-provider.js.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts +31 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.js +54 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts +43 -1
- package/lib/langium/workspace/hydranium-workspace-lock.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-lock.js +58 -1
- package/lib/langium/workspace/hydranium-workspace-lock.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts +103 -21
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.js +184 -31
- package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts +26 -9
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.js +45 -22
- package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
- package/lib/langium/workspace/index-manager.d.ts.map +1 -1
- package/lib/langium/workspace/index-manager.js.map +1 -1
- package/lib/langium/workspace/index.d.ts +1 -0
- package/lib/langium/workspace/index.d.ts.map +1 -1
- package/lib/langium/workspace/index.js +1 -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/langium/workspace/self-save-registry.d.ts +84 -0
- package/lib/langium/workspace/self-save-registry.d.ts.map +1 -0
- package/lib/{documents → langium/workspace}/self-save-registry.js +33 -22
- package/lib/langium/workspace/self-save-registry.js.map +1 -0
- package/lib/langium/workspace/virtual-document.d.ts +55 -21
- package/lib/langium/workspace/virtual-document.d.ts.map +1 -1
- package/lib/langium/workspace/virtual-document.js +87 -24
- package/lib/langium/workspace/virtual-document.js.map +1 -1
- package/lib/langium/workspace/write-lock-scope.d.ts +22 -10
- package/lib/langium/workspace/write-lock-scope.d.ts.map +1 -1
- package/lib/langium/workspace/write-lock-scope.js +15 -5
- package/lib/langium/workspace/write-lock-scope.js.map +1 -1
- package/lib/launcher/integrated-server.d.ts +3 -1
- package/lib/launcher/integrated-server.d.ts.map +1 -1
- package/lib/locale/server-locale.d.ts +19 -5
- package/lib/locale/server-locale.d.ts.map +1 -1
- package/lib/locale/server-locale.js +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 +235 -102
- 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 +32 -7
- package/lib/messages/renderer.d.ts.map +1 -1
- package/lib/messages/renderer.js +7 -1
- package/lib/messages/renderer.js.map +1 -1
- package/lib/node/event-loop-monitor.d.ts.map +1 -1
- package/lib/node/event-loop-monitor.js +2 -1
- package/lib/node/event-loop-monitor.js.map +1 -1
- package/lib/node/heap-ceiling.d.ts +61 -0
- package/lib/node/heap-ceiling.d.ts.map +1 -0
- package/lib/node/heap-ceiling.js +72 -0
- package/lib/node/heap-ceiling.js.map +1 -0
- package/lib/node/index.d.ts +1 -1
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +5 -1
- package/lib/node/index.js.map +1 -1
- package/lib/node/latency-from-env.d.ts +1 -1
- package/lib/node/latency-from-env.js +1 -1
- package/lib/node/lint-grammar.js.map +1 -1
- package/lib/node/log-file-sink.d.ts +3 -2
- package/lib/node/log-file-sink.d.ts.map +1 -1
- package/lib/node/log-file-sink.js +6 -2
- package/lib/node/log-file-sink.js.map +1 -1
- package/lib/node/log-preamble-node.d.ts +5 -3
- package/lib/node/log-preamble-node.d.ts.map +1 -1
- package/lib/node/log-preamble-node.js +13 -10
- package/lib/node/log-preamble-node.js.map +1 -1
- package/lib/node/measure-memory.d.ts.map +1 -1
- package/lib/node/measure-memory.js +5 -4
- package/lib/node/measure-memory.js.map +1 -1
- package/lib/node/memory-monitor.d.ts +2 -2
- package/lib/node/memory-monitor.d.ts.map +1 -1
- package/lib/node/memory-monitor.js +9 -10
- package/lib/node/memory-monitor.js.map +1 -1
- package/lib/node/node-file-system-provider.d.ts +67 -9
- package/lib/node/node-file-system-provider.d.ts.map +1 -1
- package/lib/node/node-file-system-provider.js +198 -53
- package/lib/node/node-file-system-provider.js.map +1 -1
- package/lib/node/profile-capture.d.ts +12 -4
- package/lib/node/profile-capture.d.ts.map +1 -1
- package/lib/node/profile-capture.js +8 -6
- package/lib/node/profile-capture.js.map +1 -1
- package/lib/node/profile-digest.js.map +1 -1
- package/lib/node/profiling-run.d.ts +13 -3
- package/lib/node/profiling-run.d.ts.map +1 -1
- package/lib/node/profiling-run.js +17 -8
- package/lib/node/profiling-run.js.map +1 -1
- package/lib/node/rename-over-open-readers.d.ts +61 -0
- package/lib/node/rename-over-open-readers.d.ts.map +1 -0
- package/lib/node/rename-over-open-readers.js +80 -0
- package/lib/node/rename-over-open-readers.js.map +1 -0
- package/lib/node/server-diagnostics.js +1 -1
- package/lib/node/server-diagnostics.js.map +1 -1
- package/lib/node/server-state-snapshot.js +4 -4
- package/lib/node/server-state-snapshot.js.map +1 -1
- package/lib/node/socket-launcher.d.ts +43 -7
- package/lib/node/socket-launcher.d.ts.map +1 -1
- package/lib/node/socket-launcher.js +42 -7
- package/lib/node/socket-launcher.js.map +1 -1
- package/lib/node/startup-cpu-profile.d.ts +29 -0
- package/lib/node/startup-cpu-profile.d.ts.map +1 -0
- package/lib/node/startup-cpu-profile.js +91 -0
- package/lib/node/startup-cpu-profile.js.map +1 -0
- package/lib/node/stdio-launcher.d.ts +13 -13
- package/lib/node/stdio-launcher.d.ts.map +1 -1
- package/lib/node/stdio-launcher.js +21 -11
- package/lib/node/stdio-launcher.js.map +1 -1
- package/lib/node/validate-workspace.d.ts +1 -1
- package/lib/node/validate-workspace.d.ts.map +1 -1
- package/lib/node/validate-workspace.js +5 -1
- package/lib/node/validate-workspace.js.map +1 -1
- package/lib/testing/document-uri-policy-conformance.js +1 -1
- package/lib/testing/document-uri-policy-conformance.js.map +1 -1
- package/lib/testing/fake-description.js.map +1 -1
- package/lib/testing/fake-document.d.ts +2 -1
- package/lib/testing/fake-document.d.ts.map +1 -1
- package/lib/testing/fake-document.js.map +1 -1
- package/lib/testing/index.d.ts +1 -1
- package/lib/testing/index.d.ts.map +1 -1
- package/lib/testing/index.js +2 -1
- package/lib/testing/index.js.map +1 -1
- package/lib/testing/langium-test-helpers.d.ts.map +1 -1
- package/lib/testing/langium-test-helpers.js +1 -0
- package/lib/testing/langium-test-helpers.js.map +1 -1
- package/lib/testing/make-noop-language-services.js.map +1 -1
- package/lib/testing/make-noop-shared-services.d.ts +4 -4
- package/lib/testing/make-noop-shared-services.d.ts.map +1 -1
- package/lib/testing/make-noop-shared-services.js +4 -4
- package/lib/testing/make-noop-shared-services.js.map +1 -1
- package/lib/testing/make-test-services.d.ts +51 -20
- package/lib/testing/make-test-services.d.ts.map +1 -1
- package/lib/testing/make-test-services.js +29 -13
- package/lib/testing/make-test-services.js.map +1 -1
- package/lib/testing/make-test-tracer.d.ts +12 -0
- package/lib/testing/make-test-tracer.d.ts.map +1 -1
- package/lib/testing/make-test-tracer.js +13 -0
- package/lib/testing/make-test-tracer.js.map +1 -1
- package/lib/testing/node/applied-edit-capture.d.ts +29 -0
- package/lib/testing/node/applied-edit-capture.d.ts.map +1 -0
- package/lib/testing/node/applied-edit-capture.js +117 -0
- package/lib/testing/node/applied-edit-capture.js.map +1 -0
- package/lib/testing/node/golden-corpus.js.map +1 -1
- package/lib/testing/node/index.d.ts +1 -0
- package/lib/testing/node/index.d.ts.map +1 -1
- package/lib/testing/node/index.js +1 -0
- package/lib/testing/node/index.js.map +1 -1
- package/lib/testing/node/lsp-harness.d.ts.map +1 -1
- package/lib/testing/node/lsp-harness.js +2 -0
- package/lib/testing/node/lsp-harness.js.map +1 -1
- package/lib/testing/node/lsp-server-connection.d.ts +21 -6
- package/lib/testing/node/lsp-server-connection.d.ts.map +1 -1
- package/lib/testing/node/lsp-server-connection.js +49 -106
- package/lib/testing/node/lsp-server-connection.js.map +1 -1
- package/lib/testing/node/scratch-workspace.d.ts.map +1 -1
- package/lib/testing/node/scratch-workspace.js +10 -5
- package/lib/testing/node/scratch-workspace.js.map +1 -1
- package/lib/testing/node/spawned-server.d.ts +30 -1
- package/lib/testing/node/spawned-server.d.ts.map +1 -1
- package/lib/testing/node/spawned-server.js +39 -2
- package/lib/testing/node/spawned-server.js.map +1 -1
- package/lib/testing/node/unhandled-rejections.d.ts +20 -0
- package/lib/testing/node/unhandled-rejections.d.ts.map +1 -0
- package/lib/testing/node/unhandled-rejections.js +32 -0
- package/lib/testing/node/unhandled-rejections.js.map +1 -0
- package/lib/testing/playwright/browser-capture-bridge.js.map +1 -1
- package/lib/testing/playwright/e2e-profiling.js.map +1 -1
- package/lib/testing/playwright/flaky-network-proxy.d.ts +76 -0
- package/lib/testing/playwright/flaky-network-proxy.d.ts.map +1 -0
- package/lib/testing/playwright/flaky-network-proxy.js +164 -0
- package/lib/testing/playwright/flaky-network-proxy.js.map +1 -0
- package/lib/testing/playwright/index.d.ts +1 -0
- package/lib/testing/playwright/index.d.ts.map +1 -1
- package/lib/testing/playwright/index.js +1 -0
- package/lib/testing/playwright/index.js.map +1 -1
- package/lib/testing/playwright/server-log-capture.d.ts +46 -16
- package/lib/testing/playwright/server-log-capture.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-capture.js +111 -40
- package/lib/testing/playwright/server-log-capture.js.map +1 -1
- package/lib/testing/playwright/server-log-fixture.d.ts +16 -0
- package/lib/testing/playwright/server-log-fixture.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-fixture.js +25 -6
- package/lib/testing/playwright/server-log-fixture.js.map +1 -1
- package/lib/testing/playwright/server-log-region.d.ts +15 -0
- package/lib/testing/playwright/server-log-region.d.ts.map +1 -0
- package/lib/testing/playwright/server-log-region.js +30 -0
- package/lib/testing/playwright/server-log-region.js.map +1 -0
- package/lib/testing/playwright/server-log-rename-reporter.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-rename-reporter.js +4 -3
- package/lib/testing/playwright/server-log-rename-reporter.js.map +1 -1
- package/lib/testing/run-update-pipeline.d.ts +8 -5
- package/lib/testing/run-update-pipeline.d.ts.map +1 -1
- package/lib/testing/run-update-pipeline.js.map +1 -1
- package/lib/testing/stub-ast-document-manager.d.ts +11 -52
- package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
- package/lib/testing/stub-ast-document-manager.js +31 -62
- package/lib/testing/stub-ast-document-manager.js.map +1 -1
- package/lib/testing/stub-document-builder.d.ts +33 -11
- package/lib/testing/stub-document-builder.d.ts.map +1 -1
- package/lib/testing/stub-document-builder.js +103 -5
- package/lib/testing/stub-document-builder.js.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.d.ts +33 -10
- package/lib/testing/stub-hydranium-text-documents.d.ts.map +1 -1
- package/lib/testing/stub-hydranium-text-documents.js +132 -16
- package/lib/testing/stub-hydranium-text-documents.js.map +1 -1
- package/lib/testing/stub-index-manager.js.map +1 -1
- package/lib/testing/stub-langium-documents.d.ts +3 -2
- package/lib/testing/stub-langium-documents.d.ts.map +1 -1
- package/lib/testing/stub-langium-documents.js.map +1 -1
- package/lib/testing/stub-model-service.d.ts +9 -8
- package/lib/testing/stub-model-service.d.ts.map +1 -1
- package/lib/testing/stub-model-service.js +6 -6
- package/lib/testing/stub-model-service.js.map +1 -1
- package/lib/testing/stub-project-manager.js.map +1 -1
- package/lib/testing/stub-self-save-registry.d.ts +1 -1
- package/lib/testing/stub-self-save-registry.d.ts.map +1 -1
- package/lib/testing/stub-service-registry.d.ts +1 -1
- package/lib/testing/stub-service-registry.js.map +1 -1
- package/lib/testing/stub-writable-file-system.d.ts +1 -1
- package/lib/testing/stub-writable-file-system.d.ts.map +1 -1
- package/lib/testing/stub-writable-file-system.js +2 -1
- package/lib/testing/stub-writable-file-system.js.map +1 -1
- package/lib/util/connection-liveness.d.ts +22 -6
- package/lib/util/connection-liveness.d.ts.map +1 -1
- package/lib/util/connection-liveness.js +74 -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 +467 -233
- package/src/documents/client-ids.ts +5 -22
- package/src/documents/client-session-errors.ts +24 -0
- package/src/documents/client-session-registry.ts +262 -0
- package/src/documents/dirty-state-tracker.ts +167 -0
- package/src/documents/document-release-handler.ts +404 -0
- package/src/documents/document-release-scheduler.ts +121 -0
- package/src/documents/file-system-task-queue.ts +74 -0
- package/src/documents/hydranium-text-documents.ts +1029 -595
- package/src/documents/index.ts +10 -2
- package/src/documents/language-client-shadow.ts +501 -0
- package/src/documents/model-ledger.ts +66 -0
- package/src/documents/text-ledger.ts +112 -0
- package/src/documents/version-sync-service.ts +275 -0
- package/src/index.ts +7 -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 +87 -51
- 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 +151 -0
- package/src/langium/diagnostics/format-log-arg.ts +36 -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 -44
- package/src/langium/document-builder/build-pipeline-integration.ts +46 -32
- package/src/langium/document-builder/build-session.ts +4 -3
- package/src/langium/document-builder/document-builder.ts +554 -79
- package/src/langium/integration-services.ts +59 -28
- package/src/langium/integrity/integrity-rule.ts +17 -8
- package/src/langium/integrity/integrity-service.ts +332 -69
- package/src/langium/language-module.ts +49 -8
- package/src/langium/model-service/client-session.ts +718 -0
- package/src/langium/model-service/index.ts +2 -0
- package/src/langium/model-service/model-events.ts +80 -0
- package/src/langium/model-service/model-service.ts +878 -494
- package/src/langium/module.ts +195 -72
- package/src/langium/naming/name-provider.ts +34 -8
- package/src/langium/project/abstract-project-manager.ts +13 -5
- package/src/langium/project/project-change-event.ts +2 -2
- package/src/langium/residency/cst-residency-service.ts +54 -19
- 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 +132 -33
- 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 +74 -59
- 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 +4 -0
- package/src/langium/service-registry.ts +41 -2
- package/src/langium/shared-services.ts +16 -7
- package/src/langium/single-langium-copy.ts +42 -0
- package/src/langium/transfer/transfer-encoder.ts +104 -47
- package/src/langium/trivia/comment-preserver.ts +1409 -0
- package/src/langium/trivia/document-ending-preserver.ts +71 -0
- package/src/langium/trivia/index.ts +14 -0
- package/src/langium/trivia/trivia-contribution.ts +39 -0
- package/src/langium/trivia/trivia-preserver.ts +56 -0
- package/src/langium/trivia/trivia-service.ts +99 -0
- package/src/langium/update-rewrite/update-rewrite-service.ts +1 -1
- package/src/langium/update-rewrite/update-rewrite.ts +1 -1
- package/src/langium/validation/document-validator.ts +312 -31
- package/src/langium/validation/validation-contribution-collector.ts +10 -1
- package/src/langium/workspace/document-uri-policy.ts +32 -18
- package/src/langium/workspace/file-not-found.ts +35 -0
- package/src/langium/workspace/file-system-provider.ts +258 -16
- package/src/langium/workspace/hydranium-langium-document-factory.ts +83 -0
- package/src/langium/workspace/hydranium-workspace-lock.ts +86 -2
- package/src/langium/workspace/hydranium-workspace-manager.ts +212 -35
- package/src/langium/workspace/in-memory-file-system-provider.ts +54 -23
- package/src/langium/workspace/index.ts +1 -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/langium/workspace/self-save-registry.ts +118 -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 +20 -5
- 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 +285 -111
- 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 +34 -6
- package/src/node/event-loop-monitor.ts +2 -1
- package/src/node/heap-ceiling.ts +108 -0
- package/src/node/index.ts +5 -1
- package/src/node/latency-from-env.ts +1 -1
- package/src/node/log-file-sink.ts +6 -2
- package/src/node/log-preamble-node.ts +20 -10
- package/src/node/measure-memory.ts +5 -4
- package/src/node/memory-monitor.ts +10 -10
- package/src/node/node-file-system-provider.ts +214 -57
- package/src/node/profile-capture.ts +16 -15
- package/src/node/profiling-run.ts +30 -8
- package/src/node/rename-over-open-readers.ts +94 -0
- package/src/node/server-diagnostics.ts +1 -1
- package/src/node/server-state-snapshot.ts +5 -5
- package/src/node/socket-launcher.ts +78 -14
- package/src/node/startup-cpu-profile.ts +94 -0
- package/src/node/stdio-launcher.ts +29 -19
- package/src/node/validate-workspace.ts +8 -2
- package/src/testing/document-uri-policy-conformance.ts +1 -1
- package/src/testing/fake-document.ts +2 -1
- package/src/testing/index.ts +2 -1
- package/src/testing/langium-test-helpers.ts +1 -0
- package/src/testing/make-noop-shared-services.ts +6 -6
- package/src/testing/make-test-services.ts +93 -41
- package/src/testing/make-test-tracer.ts +26 -0
- package/src/testing/node/applied-edit-capture.ts +141 -0
- package/src/testing/node/index.ts +1 -0
- package/src/testing/node/lsp-harness.ts +2 -0
- package/src/testing/node/lsp-server-connection.ts +83 -119
- package/src/testing/node/scratch-workspace.ts +10 -5
- package/src/testing/node/spawned-server.ts +57 -3
- package/src/testing/node/unhandled-rejections.ts +31 -0
- package/src/testing/parse-semantic-root.ts +1 -1
- package/src/testing/playwright/flaky-network-proxy.ts +240 -0
- package/src/testing/playwright/index.ts +1 -0
- package/src/testing/playwright/server-log-capture.ts +137 -47
- package/src/testing/playwright/server-log-fixture.ts +46 -6
- package/src/testing/playwright/server-log-region.ts +32 -0
- package/src/testing/playwright/server-log-rename-reporter.ts +4 -3
- package/src/testing/run-update-pipeline.ts +8 -5
- package/src/testing/stub-ast-document-manager.ts +47 -128
- package/src/testing/stub-document-builder.ts +133 -18
- package/src/testing/stub-hydranium-text-documents.ts +184 -27
- package/src/testing/stub-langium-documents.ts +3 -2
- package/src/testing/stub-model-service.ts +11 -10
- 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 +80 -15
- package/src/util/environment.ts +24 -2
- package/lib/documents/language-client-text-shadow.d.ts +0 -101
- package/lib/documents/language-client-text-shadow.d.ts.map +0 -1
- package/lib/documents/language-client-text-shadow.js +0 -156
- package/lib/documents/language-client-text-shadow.js.map +0 -1
- package/lib/documents/self-save-registry.d.ts +0 -55
- package/lib/documents/self-save-registry.d.ts.map +0 -1
- package/lib/documents/self-save-registry.js.map +0 -1
- package/lib/lsp/instrument-connection.d.ts +0 -36
- package/lib/lsp/instrument-connection.d.ts.map +0 -1
- package/lib/lsp/instrument-connection.js +0 -62
- package/lib/lsp/instrument-connection.js.map +0 -1
- package/lib/node/process-memory.d.ts +0 -66
- package/lib/node/process-memory.d.ts.map +0 -1
- package/lib/node/process-memory.js +0 -252
- package/lib/node/process-memory.js.map +0 -1
- package/src/documents/language-client-text-shadow.ts +0 -175
- package/src/documents/self-save-registry.ts +0 -81
- package/src/lsp/instrument-connection.ts +0 -66
- package/src/node/process-memory.ts +0 -299
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { asMutable, type Clock, Debouncer, Format, type Tracer } from '@hydranium/protocol';
|
|
10
|
+
import { asMutable, type Clock, Debouncer, Format, type Tracer, UNRECORDED_VERSION } from '@hydranium/protocol';
|
|
11
11
|
import {
|
|
12
12
|
type AstNode,
|
|
13
13
|
AstUtils,
|
|
@@ -24,9 +24,13 @@ import { type ServerSharedServicesMinimal } from '../shared-services.js';
|
|
|
24
24
|
/**
|
|
25
25
|
* Default priority of the CST-residency pass. Deliberately very high so it runs
|
|
26
26
|
* *last* among `Validated` build-phase passes (the registry iterates priority
|
|
27
|
-
* ascending)
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* ascending).
|
|
28
|
+
*
|
|
29
|
+
* The ordering is defensive, not load-bearing: the pass only arms or cancels an
|
|
30
|
+
* idle timer, so every pass at `Validated` reads a resident CST whichever order
|
|
31
|
+
* they run in, and lowering it changes nothing observable while that holds. It
|
|
32
|
+
* becomes load-bearing the moment the shed stops being deferred — a pass that
|
|
33
|
+
* frees the CST synchronously has to run after every reader of it.
|
|
30
34
|
*/
|
|
31
35
|
export const CST_RESIDENCY_PASS_PRIORITY = 1_000_000;
|
|
32
36
|
|
|
@@ -41,8 +45,11 @@ export const CST_RESIDENCY_PASS_PRIORITY = 1_000_000;
|
|
|
41
45
|
* "off" toggle.
|
|
42
46
|
* - `{ kind: 'shed-closed-when-idle', idleMs }`: shed a closed document's CST
|
|
43
47
|
* once it has been idle (not in any build) for `idleMs`, keeping the AST
|
|
44
|
-
* resident. Open documents are always kept.
|
|
45
|
-
* document
|
|
48
|
+
* resident. Open documents are always kept. The timer starts when a build
|
|
49
|
+
* includes the document, so `idleMs: 0` sheds a closed document on the tick
|
|
50
|
+
* after each such build. A shed document that re-enters a build is re-parsed
|
|
51
|
+
* in full, so a window shorter than the gap between a document's builds
|
|
52
|
+
* re-parses a closed document on every build it rides in.
|
|
46
53
|
*/
|
|
47
54
|
export type CstResidencyStrategy = { readonly kind: 'always-keep' } | { readonly kind: 'shed-closed-when-idle'; readonly idleMs: number };
|
|
48
55
|
|
|
@@ -181,12 +188,15 @@ function rehydrateCst(document: LangiumDocument, factory: LangiumDocumentFactory
|
|
|
181
188
|
}
|
|
182
189
|
|
|
183
190
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
191
|
+
* Keeps a document's CST available to the readers that need one, shedding it
|
|
192
|
+
* for documents that have gone idle and re-grafting on demand.
|
|
193
|
+
*
|
|
194
|
+
* Each build refreshes
|
|
186
195
|
* the idle window of the documents in its batch; when a closed, sheddable
|
|
187
196
|
* document's window elapses, every AST node's `$cstNode` and every reference's
|
|
188
|
-
* `$refNode` are nulled, and the CST
|
|
189
|
-
*
|
|
197
|
+
* `$refNode` are nulled, and the CST becomes unreachable with the `Range`s
|
|
198
|
+
* and `Position`s only it holds. A description's segments and the reference
|
|
199
|
+
* index's segments share the CST's `Range` objects, so those stay.
|
|
190
200
|
*
|
|
191
201
|
* **Terminology.** *Residency* is the state axis (is the CST in memory? —
|
|
192
202
|
* `resident` vs `shed`); *shed* is both the act and the policy vocabulary (drop
|
|
@@ -227,7 +237,23 @@ function rehydrateCst(document: LangiumDocument, factory: LangiumDocumentFactory
|
|
|
227
237
|
* `NameProvider.getNameNode` chokepoint, the comment provider, and
|
|
228
238
|
* `HydraniumLangiumDocuments.getOrCreateDocument`.
|
|
229
239
|
*/
|
|
230
|
-
export
|
|
240
|
+
export interface CstResidencyService {
|
|
241
|
+
/**
|
|
242
|
+
* Ensure `document` has a CST, re-parsing its retained text if it was shed.
|
|
243
|
+
* A resident document is left exactly as it is, so this is safe to call on
|
|
244
|
+
* a hot path and safe to call twice.
|
|
245
|
+
*/
|
|
246
|
+
rehydrate(document: LangiumDocument): void;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Node-level convenience over {@link rehydrate}, cheap enough for an
|
|
250
|
+
* unconditional call: a node whose `$cstNode` is already set returns
|
|
251
|
+
* without resolving its document.
|
|
252
|
+
*/
|
|
253
|
+
rehydrateNode(node: AstNode): void;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export class DefaultCstResidencyService implements CstResidencyService {
|
|
231
257
|
protected readonly strategy: CstResidencyStrategy;
|
|
232
258
|
/** Bytes-per-node for the optional reclaim estimate in traces; `0` disables it. */
|
|
233
259
|
protected readonly estimatedBytesPerShedNode: number;
|
|
@@ -257,7 +283,7 @@ export class CstResidencyService {
|
|
|
257
283
|
this.langiumDocs = services.workspace.LangiumDocuments;
|
|
258
284
|
services.workspace.BuildPhasePassService.register({
|
|
259
285
|
id: 'framework:cst-residency:shed',
|
|
260
|
-
|
|
286
|
+
phase: DocumentState.Validated,
|
|
261
287
|
priority: options.priority ?? CST_RESIDENCY_PASS_PRIORITY,
|
|
262
288
|
run: documents => this.onBuild(documents)
|
|
263
289
|
});
|
|
@@ -277,8 +303,8 @@ export class CstResidencyService {
|
|
|
277
303
|
* until navigation latency on shed files is actually observed to hurt. This
|
|
278
304
|
* method is where that hook goes.
|
|
279
305
|
*/
|
|
280
|
-
rehydrate(document: LangiumDocument):
|
|
281
|
-
|
|
306
|
+
rehydrate(document: LangiumDocument): void {
|
|
307
|
+
rehydrateCst(document, this.services.workspace.LangiumDocumentFactory);
|
|
282
308
|
}
|
|
283
309
|
|
|
284
310
|
/**
|
|
@@ -287,11 +313,11 @@ export class CstResidencyService {
|
|
|
287
313
|
* `true` without even resolving the document, so hot read paths
|
|
288
314
|
* (`getNameNode`, comment lookup) call this unconditionally.
|
|
289
315
|
*/
|
|
290
|
-
rehydrateNode(node: AstNode):
|
|
316
|
+
rehydrateNode(node: AstNode): void {
|
|
291
317
|
if (node.$cstNode !== undefined) {
|
|
292
|
-
return
|
|
318
|
+
return;
|
|
293
319
|
}
|
|
294
|
-
|
|
320
|
+
this.rehydrate(AstUtils.getDocument(node));
|
|
295
321
|
}
|
|
296
322
|
|
|
297
323
|
/**
|
|
@@ -353,8 +379,8 @@ export class CstResidencyService {
|
|
|
353
379
|
this.shedTotal += this.shed(document);
|
|
354
380
|
}
|
|
355
381
|
|
|
356
|
-
/** Cancel
|
|
357
|
-
|
|
382
|
+
/** Cancel every armed shed, so a document that has gone idle keeps its CST. */
|
|
383
|
+
cancelPendingShed(): void {
|
|
358
384
|
for (const timer of this.idleTimers.values()) {
|
|
359
385
|
timer.dispose();
|
|
360
386
|
}
|
|
@@ -383,6 +409,15 @@ export class CstResidencyService {
|
|
|
383
409
|
if (root === undefined || root.$cstNode === undefined) {
|
|
384
410
|
return 0;
|
|
385
411
|
}
|
|
412
|
+
// Readers of the parsed text, the `'text-diagnostics'` fingerprint among
|
|
413
|
+
// them, otherwise see none once the CST is gone. Recorded in the ledger
|
|
414
|
+
// directly: no root is produced, and reconciling it with the store would
|
|
415
|
+
// step a closed document's sequence for a root behind its text.
|
|
416
|
+
const ledger = this.services.workspace.ModelLedger;
|
|
417
|
+
const version = ledger.versionOf(root);
|
|
418
|
+
if (version !== UNRECORDED_VERSION) {
|
|
419
|
+
ledger.record(root, version, ledger.textOf(root));
|
|
420
|
+
}
|
|
386
421
|
let cleared = 0;
|
|
387
422
|
for (const node of AstUtils.streamAst(root)) {
|
|
388
423
|
if (node.$cstNode) {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
|
|
10
|
+
import { type AstNodeDescription, type Scope, type Stream } from '@hydranium/langium';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A scope that answers from `primary`, and from `fallback` only for a name
|
|
14
|
+
* `primary` does not hold.
|
|
15
|
+
*
|
|
16
|
+
* Langium fixes a scope's outer scope when the scope is built, so a tier cannot
|
|
17
|
+
* be put below a scope that already exists, such as a cached one. Re-wrapping
|
|
18
|
+
* that scope's elements instead would turn its keyed lookup into a scan of
|
|
19
|
+
* every element; chaining keeps each scope's own lookup.
|
|
20
|
+
*/
|
|
21
|
+
export class FallbackScope implements Scope {
|
|
22
|
+
constructor(
|
|
23
|
+
protected readonly primary: Scope,
|
|
24
|
+
protected readonly fallback: Scope
|
|
25
|
+
) {}
|
|
26
|
+
|
|
27
|
+
getElement(name: string): AstNodeDescription | undefined {
|
|
28
|
+
return this.primary.getElement(name) ?? this.fallback.getElement(name);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
getElements(name: string): Stream<AstNodeDescription> {
|
|
32
|
+
return this.primary.getElements(name).concat(this.fallback.getElements(name));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getAllElements(): Stream<AstNodeDescription> {
|
|
36
|
+
return this.primary.getAllElements().concat(this.fallback.getAllElements());
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -10,15 +10,13 @@
|
|
|
10
10
|
import {
|
|
11
11
|
type AstNode,
|
|
12
12
|
type AstNodeDescription,
|
|
13
|
-
AstUtils,
|
|
14
13
|
DefaultScopeComputation,
|
|
15
|
-
interruptAndCheck,
|
|
16
14
|
type LangiumDocument,
|
|
17
15
|
type LocalSymbols,
|
|
18
|
-
MultiMap,
|
|
16
|
+
type MultiMap,
|
|
19
17
|
UriUtils
|
|
20
18
|
} from '@hydranium/langium';
|
|
21
|
-
import { Logger, type Tracer } from '@hydranium/protocol';
|
|
19
|
+
import { Logger, type ProfileSession, type Tracer } from '@hydranium/protocol';
|
|
22
20
|
import type { CancellationToken } from 'vscode-languageserver-protocol';
|
|
23
21
|
import type { LogNameOptions } from '../diagnostics/logger.js';
|
|
24
22
|
import type { HydraniumLanguageServices } from '../language-module.js';
|
|
@@ -35,8 +33,9 @@ import { type HydraniumAstNodeDescriptionProvider } from './ast-node-description
|
|
|
35
33
|
* `NameProvider.getName` defaults to the workspace-unique
|
|
36
34
|
* `getProjectQualifiedName`. Routing the local-symbols pass through
|
|
37
35
|
* `getName` would put qualified names in the per-document symbol map
|
|
38
|
-
* and break within-document bare-name references.
|
|
39
|
-
* bypasses the default and calls
|
|
36
|
+
* and break within-document bare-name references.
|
|
37
|
+
* {@link addLocalSymbolByOwnName} bypasses the default and calls
|
|
38
|
+
* {@link NameProvider.getOwnName}
|
|
40
39
|
* directly so local symbols stay keyed by bare names regardless of
|
|
41
40
|
* what `getName` returns.
|
|
42
41
|
*
|
|
@@ -55,11 +54,15 @@ import { type HydraniumAstNodeDescriptionProvider } from './ast-node-description
|
|
|
55
54
|
*
|
|
56
55
|
* Performance: piggybacks on the existing single AST walk Langium does
|
|
57
56
|
* for local-symbol collection — the AST-extension dispatch and the
|
|
58
|
-
* own-name read both happen in `
|
|
57
|
+
* own-name read both happen in `addLocalSymbolByOwnName`, no extra traversal.
|
|
59
58
|
* The exported-symbol pass reads both name tiers once per node, no
|
|
60
59
|
* duplicated walks.
|
|
61
60
|
*/
|
|
62
61
|
export class HydraniumScopeComputation extends DefaultScopeComputation {
|
|
62
|
+
/** The framework's name provider, which its language module binds to the slot. */
|
|
63
|
+
declare protected readonly nameProvider: NameProvider;
|
|
64
|
+
/** The framework's description provider, which its language module binds to the slot. */
|
|
65
|
+
declare protected readonly descriptions: HydraniumAstNodeDescriptionProvider;
|
|
63
66
|
protected readonly tracer: Tracer;
|
|
64
67
|
|
|
65
68
|
constructor(
|
|
@@ -70,38 +73,30 @@ export class HydraniumScopeComputation extends DefaultScopeComputation {
|
|
|
70
73
|
this.tracer = services.shared.Tracer.for(options.logName ?? 'ScopeComputation').trace('instantiated');
|
|
71
74
|
}
|
|
72
75
|
|
|
76
|
+
/** The session {@link addLocalSymbol} records into while a `debug`-level walk runs. */
|
|
77
|
+
protected localSymbolsProfile: ProfileSession | undefined;
|
|
78
|
+
|
|
73
79
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* cost). At `debug` it reproduces the same walk under a `ProfileSession`
|
|
79
|
-
* so each `$type`'s contribution to the heaviest scope-computation pass is
|
|
80
|
-
* aggregated and reported line-based — the walk is gated rather than the
|
|
81
|
-
* per-node `scope`, since `ProfileSession.scope` is not itself level-gated.
|
|
82
|
-
*
|
|
83
|
-
* The instance carries no profiling state: the session is local to the call,
|
|
84
|
-
* which is safe because Langium's document builder runs `collectLocalSymbols`
|
|
85
|
-
* strictly one document at a time (`runCancelable`'s sequential `for…await`).
|
|
80
|
+
* Langium's local-symbol walk, with per-`$type` self-time profiling at
|
|
81
|
+
* `debug`. The walk is Langium's at every level: a copy run only at `debug`
|
|
82
|
+
* would drift from the one every other level runs. Overlapping builds share
|
|
83
|
+
* the session and blur each other's report.
|
|
86
84
|
*/
|
|
87
85
|
override async collectLocalSymbols(document: LangiumDocument, cancelToken?: CancellationToken): Promise<LocalSymbols> {
|
|
88
86
|
if (!Logger.isLevelEnabled('debug')) {
|
|
89
87
|
return super.collectLocalSymbols(document, cancelToken);
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (cancelToken) {
|
|
100
|
-
await interruptAndCheck(cancelToken);
|
|
89
|
+
const profile = this.tracer.profile(`scope-local ${UriUtils.basename(document.uri)}`);
|
|
90
|
+
this.localSymbolsProfile = profile;
|
|
91
|
+
let symbols: LocalSymbols;
|
|
92
|
+
try {
|
|
93
|
+
symbols = await super.collectLocalSymbols(document, cancelToken);
|
|
94
|
+
} finally {
|
|
95
|
+
if (this.localSymbolsProfile === profile) {
|
|
96
|
+
this.localSymbolsProfile = undefined;
|
|
101
97
|
}
|
|
102
|
-
session.scope(node.$type, () => this.addLocalSymbol(node, document, symbols));
|
|
103
98
|
}
|
|
104
|
-
|
|
99
|
+
profile.report('debug');
|
|
105
100
|
return symbols;
|
|
106
101
|
}
|
|
107
102
|
|
|
@@ -164,17 +159,15 @@ export class HydraniumScopeComputation extends DefaultScopeComputation {
|
|
|
164
159
|
* workspace-visible rather than being filtered out everywhere.
|
|
165
160
|
*/
|
|
166
161
|
protected exportProject(node: AstNode, exports: AstNodeDescription[], document: LangiumDocument): void {
|
|
167
|
-
const
|
|
168
|
-
const documentName = nameProvider.getDocumentQualifiedName(node);
|
|
162
|
+
const documentName = this.nameProvider.getDocumentQualifiedName(node);
|
|
169
163
|
if (!documentName) {
|
|
170
164
|
return;
|
|
171
165
|
}
|
|
172
166
|
const projectId = this.getProjectIdForDocument(document);
|
|
173
|
-
const descriptions = this.descriptions as HydraniumAstNodeDescriptionProvider;
|
|
174
167
|
exports.push(
|
|
175
168
|
projectId !== undefined
|
|
176
|
-
? descriptions.createProject({ node, name: documentName, document, projectId })
|
|
177
|
-
: descriptions.createUniversal({ node, name: documentName, document })
|
|
169
|
+
? this.descriptions.createProject({ node, name: documentName, document, projectId })
|
|
170
|
+
: this.descriptions.createUniversal({ node, name: documentName, document })
|
|
178
171
|
);
|
|
179
172
|
}
|
|
180
173
|
|
|
@@ -191,16 +184,14 @@ export class HydraniumScopeComputation extends DefaultScopeComputation {
|
|
|
191
184
|
* document-qualified name.
|
|
192
185
|
*/
|
|
193
186
|
protected exportPublic(node: AstNode, exports: AstNodeDescription[], document: LangiumDocument): void {
|
|
194
|
-
const nameProvider = this.nameProvider as NameProvider;
|
|
195
187
|
const projectId = this.getProjectIdForDocument(document);
|
|
196
188
|
if (projectId === undefined) {
|
|
197
189
|
return;
|
|
198
190
|
}
|
|
199
|
-
const documentName = nameProvider.getDocumentQualifiedName(node);
|
|
200
|
-
const projectName = nameProvider.getProjectQualifiedName(node);
|
|
191
|
+
const documentName = this.nameProvider.getDocumentQualifiedName(node);
|
|
192
|
+
const projectName = this.nameProvider.getProjectQualifiedName(node);
|
|
201
193
|
if (projectName && projectName !== documentName) {
|
|
202
|
-
|
|
203
|
-
exports.push(descriptions.createPublic({ node, name: projectName, document, projectId }));
|
|
194
|
+
exports.push(this.descriptions.createPublic({ node, name: projectName, document, projectId }));
|
|
204
195
|
}
|
|
205
196
|
}
|
|
206
197
|
|
|
@@ -218,6 +209,16 @@ export class HydraniumScopeComputation extends DefaultScopeComputation {
|
|
|
218
209
|
return this.services.shared.workspace.ProjectManager.getProject(document.uri)?.id;
|
|
219
210
|
}
|
|
220
211
|
|
|
212
|
+
/** {@link addLocalSymbolByOwnName}, timed per `$type` while {@link localSymbolsProfile} is set. */
|
|
213
|
+
protected override addLocalSymbol(node: AstNode, document: LangiumDocument, symbols: MultiMap<AstNode, AstNodeDescription>): void {
|
|
214
|
+
const profile = this.localSymbolsProfile;
|
|
215
|
+
if (profile) {
|
|
216
|
+
profile.scope(node.$type, () => this.addLocalSymbolByOwnName(node, document, symbols));
|
|
217
|
+
} else {
|
|
218
|
+
this.addLocalSymbolByOwnName(node, document, symbols);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
221
222
|
/**
|
|
222
223
|
* Bypasses Langium's `super.addLocalSymbol` (which would key the
|
|
223
224
|
* local-symbols map by `nameProvider.getName(node)`, qualified by
|
|
@@ -233,14 +234,14 @@ export class HydraniumScopeComputation extends DefaultScopeComputation {
|
|
|
233
234
|
* extension `compute` callbacks fire after this `addLocalSymbol` pass
|
|
234
235
|
* completes for the whole document.
|
|
235
236
|
*/
|
|
236
|
-
protected
|
|
237
|
+
protected addLocalSymbolByOwnName(node: AstNode, document: LangiumDocument, symbols: MultiMap<AstNode, AstNodeDescription>): void {
|
|
237
238
|
const container = node.$container;
|
|
238
239
|
if (!container) {
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
|
-
const name =
|
|
242
|
+
const name = this.nameProvider.getOwnName(node);
|
|
242
243
|
if (name) {
|
|
243
|
-
symbols.add(container,
|
|
244
|
+
symbols.add(container, this.descriptions.createLocal({ node, name, document }));
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
247
|
}
|
|
@@ -24,7 +24,9 @@ import {
|
|
|
24
24
|
type AstNodeLocator,
|
|
25
25
|
AstUtils,
|
|
26
26
|
DefaultScopeProvider,
|
|
27
|
+
type LocalSymbols,
|
|
27
28
|
MapScope,
|
|
29
|
+
MultiMapScope,
|
|
28
30
|
type ReferenceInfo,
|
|
29
31
|
type Scope,
|
|
30
32
|
type ScopeOptions,
|
|
@@ -39,8 +41,9 @@ import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
|
39
41
|
import { type HydraniumLanguageServices } from '../language-module.js';
|
|
40
42
|
import { type NameProvider } from '../naming/name-provider.js';
|
|
41
43
|
import { type HydraniumDocumentRegistry } from '../workspace/langium-documents.js';
|
|
44
|
+
import { FallbackScope } from './fallback-scope.js';
|
|
42
45
|
import { type ScopeExtensionService } from './scope-extension-service.js';
|
|
43
|
-
import { isTieredDescription } from './scoped-ast-node-description.js';
|
|
46
|
+
import { type TieredAstNodeDescription, isTieredDescription } from './scoped-ast-node-description.js';
|
|
44
47
|
|
|
45
48
|
/**
|
|
46
49
|
* Construction-time options for {@link HydraniumScopeProvider}. Extends
|
|
@@ -103,16 +106,16 @@ export interface ScopeContext {
|
|
|
103
106
|
* ## Scope chain (high → low, inner shadows outer)
|
|
104
107
|
*
|
|
105
108
|
* ```
|
|
106
|
-
* document-local (Langium precomputed) [
|
|
109
|
+
* document-local (Langium precomputed) [getScope, CACHED per build in localScope]
|
|
107
110
|
* extension:local [layerLocalExtension, per-context]
|
|
108
111
|
* own-project → dependency → universal-index [createGlobalScope default, CACHED per ${project}::${refType}]
|
|
109
112
|
* extension:universal [layerUniversalExtension, per-context, outermost]
|
|
110
113
|
* ```
|
|
111
114
|
*
|
|
112
|
-
* Implementation:
|
|
113
|
-
* whatever `getGlobalScope` returns. The framework owns
|
|
114
|
-
* and uses it to assemble everything *below* document-local,
|
|
115
|
-
* adopter-overridable {@link createGlobalScope} in the middle.
|
|
115
|
+
* Implementation: {@link getScope} layers document-local on top of
|
|
116
|
+
* whatever `getGlobalScope` returns, as Langium's does. The framework owns
|
|
117
|
+
* `getGlobalScope` and uses it to assemble everything *below* document-local,
|
|
118
|
+
* with the adopter-overridable {@link createGlobalScope} in the middle.
|
|
116
119
|
*
|
|
117
120
|
* ## Adopter override surface
|
|
118
121
|
*
|
|
@@ -161,6 +164,12 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
161
164
|
* the workspace-global `DocumentBuilder.onUpdate`.
|
|
162
165
|
*/
|
|
163
166
|
protected readonly scopeCache: WorkspaceCache<string, Scope>;
|
|
167
|
+
/**
|
|
168
|
+
* Each container's local scope per reference type, keyed by the local
|
|
169
|
+
* symbols it was built from. A build replaces a document's local symbols
|
|
170
|
+
* when it recomputes them, so a rebuilt document never reads a stale entry.
|
|
171
|
+
*/
|
|
172
|
+
protected readonly localScopes = new WeakMap<LocalSymbols, Map<AstNode, Map<string, Scope>>>();
|
|
164
173
|
protected readonly tracer: Tracer;
|
|
165
174
|
/**
|
|
166
175
|
* Narrows the inherited Langium {@link NameProvider} field to the framework's
|
|
@@ -183,19 +192,98 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
183
192
|
this.tracer = services.shared.Tracer.for(options.logName ?? 'ScopeProvider').trace('instantiated');
|
|
184
193
|
}
|
|
185
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Drop every cached scope — the framework's project-tier chain and the
|
|
197
|
+
* inherited global scope it is filtered from.
|
|
198
|
+
*
|
|
199
|
+
* **Called from outside the class**, by the build pipeline once the batch is
|
|
200
|
+
* re-indexed. The caches' own eviction does not cover this:
|
|
201
|
+
* `DocumentBuilder.onUpdate` fires after the build has taken every changed
|
|
202
|
+
* document's symbols out of the index and before it puts them back, so a
|
|
203
|
+
* scope built in that gap denies those symbols exist and every document the
|
|
204
|
+
* same build links afterwards resolves against it.
|
|
205
|
+
*
|
|
206
|
+
* Both go together because the second is derived from the first: clearing
|
|
207
|
+
* only {@link scopeCache} refills it from a stale `globalScopeCache`, and
|
|
208
|
+
* clearing only `globalScopeCache` leaves the filtered copy standing.
|
|
209
|
+
*/
|
|
210
|
+
clearScopeCaches(): void {
|
|
211
|
+
this.scopeCache.clear();
|
|
212
|
+
this.globalScopeCache.clear();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Langium's, with each container's local scope built once per build through
|
|
217
|
+
* {@link localScope} rather than once per reference. Linking a document then
|
|
218
|
+
* costs its references plus its declarations, not their product.
|
|
219
|
+
*/
|
|
220
|
+
override getScope(context: ReferenceInfo): Scope {
|
|
221
|
+
const referenceType = this.reflection.getReferenceType(context);
|
|
222
|
+
const localSymbols = AstUtils.getDocument(context.container).localSymbols;
|
|
223
|
+
let result = this.getGlobalScope(referenceType, context);
|
|
224
|
+
if (localSymbols === undefined) {
|
|
225
|
+
return result;
|
|
226
|
+
}
|
|
227
|
+
const containers: AstNode[] = [];
|
|
228
|
+
for (let container: AstNode | undefined = context.container; container; container = container.$container) {
|
|
229
|
+
if (localSymbols.has(container)) {
|
|
230
|
+
containers.push(container);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
// Outermost first, so the innermost container's symbols shadow the rest.
|
|
234
|
+
for (let i = containers.length - 1; i >= 0; i--) {
|
|
235
|
+
result = new FallbackScope(this.localScope(localSymbols, containers[i], referenceType), result);
|
|
236
|
+
}
|
|
237
|
+
return result;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* The symbols `container` declares that a `referenceType` reference can
|
|
242
|
+
* reach, through {@link createScope}, built once per `localSymbols`.
|
|
243
|
+
*/
|
|
244
|
+
protected localScope(localSymbols: LocalSymbols, container: AstNode, referenceType: string): Scope {
|
|
245
|
+
let byContainer = this.localScopes.get(localSymbols);
|
|
246
|
+
if (byContainer === undefined) {
|
|
247
|
+
byContainer = new Map();
|
|
248
|
+
this.localScopes.set(localSymbols, byContainer);
|
|
249
|
+
}
|
|
250
|
+
let byType = byContainer.get(container);
|
|
251
|
+
if (byType === undefined) {
|
|
252
|
+
byType = new Map();
|
|
253
|
+
byContainer.set(container, byType);
|
|
254
|
+
}
|
|
255
|
+
let scope = byType.get(referenceType);
|
|
256
|
+
if (scope === undefined) {
|
|
257
|
+
scope = this.createScope(
|
|
258
|
+
localSymbols.getStream(container).filter(description => this.reflection.isSubtype(description.type, referenceType))
|
|
259
|
+
);
|
|
260
|
+
byType.set(referenceType, scope);
|
|
261
|
+
}
|
|
262
|
+
return scope;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Keyed by name, where Langium's walks every element on each lookup. Every
|
|
267
|
+
* description of a name is kept and the first answers, as in Langium's;
|
|
268
|
+
* `getAllElements` lists them grouped by name.
|
|
269
|
+
*/
|
|
270
|
+
protected override createScope(elements: Iterable<AstNodeDescription>, outerScope?: Scope, options?: ScopeOptions): Scope {
|
|
271
|
+
return new MultiMapScope(elements, outerScope, options);
|
|
272
|
+
}
|
|
273
|
+
|
|
186
274
|
/**
|
|
187
275
|
* Framework-owned assembly seam. **Adopters do NOT override this** —
|
|
188
276
|
* override {@link createGlobalScope} instead. This method layers the
|
|
189
277
|
* scope-extension tiers around the adopter-overridable global scope.
|
|
190
278
|
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* class.
|
|
279
|
+
* {@link getScope} then layers document-local on top of this result,
|
|
280
|
+
* yielding the full chain documented on the class.
|
|
194
281
|
*/
|
|
195
282
|
protected override getGlobalScope(referenceType: string, context: ReferenceInfo): Scope {
|
|
196
283
|
const projectChain = this.createGlobalScope(referenceType, context);
|
|
197
|
-
const
|
|
198
|
-
|
|
284
|
+
const extensions = this.scopeExtensionService.getDescriptions(referenceType, context.container);
|
|
285
|
+
const withUniversal = this.layerUniversalExtension(extensions.universal, projectChain, referenceType, context);
|
|
286
|
+
return this.layerLocalExtension(extensions.local, withUniversal, referenceType, context);
|
|
199
287
|
}
|
|
200
288
|
|
|
201
289
|
/**
|
|
@@ -230,22 +318,32 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
230
318
|
}
|
|
231
319
|
|
|
232
320
|
/**
|
|
233
|
-
* Layer scope
|
|
234
|
-
* Returns `inner` unchanged when
|
|
235
|
-
*
|
|
321
|
+
* Layer the scope extensions' `local`-tier `descriptions` on top of
|
|
322
|
+
* `inner`, through {@link createScope}. Returns `inner` unchanged when there
|
|
323
|
+
* are none.
|
|
236
324
|
*/
|
|
237
|
-
protected layerLocalExtension(
|
|
238
|
-
|
|
325
|
+
protected layerLocalExtension(
|
|
326
|
+
descriptions: readonly TieredAstNodeDescription[],
|
|
327
|
+
inner: Scope,
|
|
328
|
+
_referenceType: string,
|
|
329
|
+
_context: ReferenceInfo
|
|
330
|
+
): Scope {
|
|
331
|
+
return descriptions.length === 0 ? inner : this.createScope(descriptions, inner);
|
|
239
332
|
}
|
|
240
333
|
|
|
241
334
|
/**
|
|
242
|
-
* Layer scope
|
|
243
|
-
*
|
|
244
|
-
* `inner`
|
|
245
|
-
*
|
|
335
|
+
* Layer the scope extensions' `universal`-tier `descriptions` below
|
|
336
|
+
* `inner`, which shadows them, through {@link createScope} and a
|
|
337
|
+
* {@link FallbackScope}, so `inner` keeps its own lookup. Returns `inner`
|
|
338
|
+
* unchanged when there are none.
|
|
246
339
|
*/
|
|
247
|
-
protected layerUniversalExtension(
|
|
248
|
-
|
|
340
|
+
protected layerUniversalExtension(
|
|
341
|
+
descriptions: readonly TieredAstNodeDescription[],
|
|
342
|
+
inner: Scope,
|
|
343
|
+
_referenceType: string,
|
|
344
|
+
_context: ReferenceInfo
|
|
345
|
+
): Scope {
|
|
346
|
+
return descriptions.length === 0 ? inner : new FallbackScope(inner, this.createScope(descriptions));
|
|
249
347
|
}
|
|
250
348
|
|
|
251
349
|
/**
|
|
@@ -286,7 +384,7 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
286
384
|
* closure).
|
|
287
385
|
*
|
|
288
386
|
* Contrast {@link getGlobalScope}, which applies the framework's
|
|
289
|
-
* tier filter to this set, and
|
|
387
|
+
* tier filter to this set, and {@link getScope}, which
|
|
290
388
|
* additionally merges in the local scope.
|
|
291
389
|
*/
|
|
292
390
|
protected getAllElementsGlobalScope(referenceType: string, context: ReferenceInfo): Scope {
|
|
@@ -344,11 +442,11 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
344
442
|
* Includes own-project `'public'`-tier descriptions when
|
|
345
443
|
* {@link HydraniumScopeProviderOptions.includeOwnProjectPublic} is set
|
|
346
444
|
* (routed to the own-project bucket by {@link bucketFor}). Returns a
|
|
347
|
-
* {@link
|
|
445
|
+
* {@link MultiMapScope} (not {@link MapScope}) so same-name siblings are
|
|
348
446
|
* preserved rather than collapsed.
|
|
349
447
|
*/
|
|
350
448
|
protected createOwnProjectScope(context: ScopeContext): Scope {
|
|
351
|
-
return new
|
|
449
|
+
return new MultiMapScope(context.ownProjectEntries);
|
|
352
450
|
}
|
|
353
451
|
|
|
354
452
|
/**
|
|
@@ -357,7 +455,7 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
357
455
|
* (own-project canonical filter applied by {@link bucketFor}).
|
|
358
456
|
*/
|
|
359
457
|
protected createDependencyScope(context: ScopeContext): Scope {
|
|
360
|
-
return new
|
|
458
|
+
return new MultiMapScope(context.dependencyEntries);
|
|
361
459
|
}
|
|
362
460
|
|
|
363
461
|
/**
|
|
@@ -369,13 +467,13 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
369
467
|
}
|
|
370
468
|
|
|
371
469
|
/**
|
|
372
|
-
* Chain three tier sub-scopes inner-first
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
470
|
+
* Chain three tier sub-scopes inner-first through {@link FallbackScope},
|
|
471
|
+
* which consults an outer tier only when the inner one has no match, so a
|
|
472
|
+
* more specific tier shadows a less specific one of the same name, and each
|
|
473
|
+
* tier keeps its own lookup.
|
|
376
474
|
*/
|
|
377
475
|
protected chainScopes(ownScope: Scope, dependencyScope: Scope, universalScope: Scope): Scope {
|
|
378
|
-
return new
|
|
476
|
+
return new FallbackScope(ownScope, new FallbackScope(dependencyScope, universalScope));
|
|
379
477
|
}
|
|
380
478
|
|
|
381
479
|
/**
|
|
@@ -443,8 +541,9 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
443
541
|
|
|
444
542
|
/**
|
|
445
543
|
* Keys the scope by {@link NameProvider.getOwnName} instead of Langium's
|
|
446
|
-
* `getName`. Same correction
|
|
447
|
-
* makes to the
|
|
544
|
+
* `getName`. Same correction
|
|
545
|
+
* `HydraniumScopeComputation.addLocalSymbolByOwnName` makes to the
|
|
546
|
+
* local-symbols pass, for the same reason: `getName` defaults
|
|
448
547
|
* to the project-qualified form here, so the base would key a member scope
|
|
449
548
|
* by the fully qualified `Container.member` while the reference text after
|
|
450
549
|
* the dot is the bare `member` — and nothing reports the mismatch, because
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
10
|
export * from './ast-node-description-provider.js';
|
|
11
|
+
export * from './fallback-scope.js';
|
|
11
12
|
export * from './reference-builder.js';
|
|
12
13
|
export * from './reference-candidate-provider.js';
|
|
13
14
|
export * from './hydranium-scope-computation.js';
|