@hydranium/core 1.0.0-next.8 → 1.0.0-next.86
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/lib/documents/ast-document-manager.d.ts +75 -16
- package/lib/documents/ast-document-manager.d.ts.map +1 -1
- package/lib/documents/ast-document-manager.js +57 -19
- 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/hydranium-text-documents.d.ts +55 -21
- package/lib/documents/hydranium-text-documents.d.ts.map +1 -1
- package/lib/documents/hydranium-text-documents.js +142 -46
- package/lib/documents/hydranium-text-documents.js.map +1 -1
- package/lib/documents/language-client-text-shadow.d.ts +41 -9
- package/lib/documents/language-client-text-shadow.d.ts.map +1 -1
- package/lib/documents/language-client-text-shadow.js +56 -11
- package/lib/documents/language-client-text-shadow.js.map +1 -1
- package/lib/documents/self-save-registry.d.ts +37 -6
- package/lib/documents/self-save-registry.d.ts.map +1 -1
- package/lib/documents/self-save-registry.js +28 -15
- package/lib/documents/self-save-registry.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -1
- package/lib/langium/ast-extension/ast-node-builder.d.ts +32 -9
- package/lib/langium/ast-extension/ast-node-builder.d.ts.map +1 -1
- package/lib/langium/ast-extension/ast-node-builder.js +60 -22
- package/lib/langium/ast-extension/ast-node-builder.js.map +1 -1
- package/lib/langium/bootstrap.d.ts.map +1 -1
- package/lib/langium/bootstrap.js +16 -9
- package/lib/langium/bootstrap.js.map +1 -1
- package/lib/langium/config/configuration-provider.d.ts +81 -0
- package/lib/langium/config/configuration-provider.d.ts.map +1 -0
- package/lib/langium/config/configuration-provider.js +112 -0
- package/lib/langium/config/configuration-provider.js.map +1 -0
- package/lib/langium/config/index.d.ts +1 -0
- package/lib/langium/config/index.d.ts.map +1 -1
- package/lib/langium/config/index.js +1 -0
- package/lib/langium/config/index.js.map +1 -1
- package/lib/langium/diagnostics/lsp-logger.d.ts +17 -0
- package/lib/langium/diagnostics/lsp-logger.d.ts.map +1 -1
- package/lib/langium/diagnostics/lsp-logger.js +40 -6
- package/lib/langium/diagnostics/lsp-logger.js.map +1 -1
- package/lib/langium/document-builder/build-pipeline-integration.d.ts +13 -1
- package/lib/langium/document-builder/build-pipeline-integration.d.ts.map +1 -1
- package/lib/langium/document-builder/build-pipeline-integration.js +1 -1
- package/lib/langium/document-builder/build-pipeline-integration.js.map +1 -1
- package/lib/langium/document-builder/build-session.d.ts +93 -0
- package/lib/langium/document-builder/build-session.d.ts.map +1 -0
- package/lib/langium/document-builder/build-session.js +72 -0
- package/lib/langium/document-builder/build-session.js.map +1 -0
- package/lib/langium/document-builder/document-builder.d.ts +150 -7
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
- package/lib/langium/document-builder/document-builder.js +298 -11
- package/lib/langium/document-builder/document-builder.js.map +1 -1
- package/lib/langium/document-builder/index.d.ts +1 -0
- package/lib/langium/document-builder/index.d.ts.map +1 -1
- package/lib/langium/document-builder/index.js +1 -0
- package/lib/langium/document-builder/index.js.map +1 -1
- package/lib/langium/integration-services.d.ts +45 -1
- package/lib/langium/integration-services.d.ts.map +1 -1
- package/lib/langium/integration-services.js +10 -5
- package/lib/langium/integration-services.js.map +1 -1
- package/lib/langium/integrity/integrity-service.d.ts +5 -0
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-service.js +34 -1
- package/lib/langium/integrity/integrity-service.js.map +1 -1
- package/lib/langium/keys/containment.d.ts +64 -0
- package/lib/langium/keys/containment.d.ts.map +1 -0
- package/lib/langium/keys/containment.js +53 -0
- package/lib/langium/keys/containment.js.map +1 -0
- package/lib/langium/keys/index.d.ts +1 -0
- package/lib/langium/keys/index.d.ts.map +1 -1
- package/lib/langium/keys/index.js +1 -0
- package/lib/langium/keys/index.js.map +1 -1
- package/lib/langium/keys/name-based-key-provider.d.ts +4 -0
- package/lib/langium/keys/name-based-key-provider.d.ts.map +1 -1
- package/lib/langium/keys/name-based-key-provider.js +4 -0
- package/lib/langium/keys/name-based-key-provider.js.map +1 -1
- package/lib/langium/model-service/model-service.d.ts +149 -10
- package/lib/langium/model-service/model-service.d.ts.map +1 -1
- package/lib/langium/model-service/model-service.js +120 -93
- package/lib/langium/model-service/model-service.js.map +1 -1
- package/lib/langium/module.d.ts +84 -15
- package/lib/langium/module.d.ts.map +1 -1
- package/lib/langium/module.js +26 -12
- package/lib/langium/module.js.map +1 -1
- package/lib/langium/naming/name-provider.d.ts +25 -4
- package/lib/langium/naming/name-provider.d.ts.map +1 -1
- package/lib/langium/naming/name-provider.js +2 -1
- package/lib/langium/naming/name-provider.js.map +1 -1
- package/lib/langium/naming/name-separator-validation.d.ts +23 -0
- package/lib/langium/naming/name-separator-validation.d.ts.map +1 -1
- package/lib/langium/naming/name-separator-validation.js +30 -1
- package/lib/langium/naming/name-separator-validation.js.map +1 -1
- package/lib/langium/residency/cst-residency-service.d.ts +31 -9
- package/lib/langium/residency/cst-residency-service.d.ts.map +1 -1
- package/lib/langium/residency/cst-residency-service.js +13 -56
- package/lib/langium/residency/cst-residency-service.js.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.d.ts +32 -13
- package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.js +37 -20
- package/lib/langium/scope/hydranium-scope-provider.js.map +1 -1
- package/lib/langium/service-registry.d.ts +5 -1
- package/lib/langium/service-registry.d.ts.map +1 -1
- package/lib/langium/service-registry.js +4 -0
- package/lib/langium/service-registry.js.map +1 -1
- package/lib/langium/shared-services.d.ts +15 -2
- package/lib/langium/shared-services.d.ts.map +1 -1
- package/lib/langium/shared-services.js.map +1 -1
- package/lib/langium/transfer/transfer-encoder.d.ts +60 -17
- package/lib/langium/transfer/transfer-encoder.d.ts.map +1 -1
- package/lib/langium/transfer/transfer-encoder.js +38 -16
- package/lib/langium/transfer/transfer-encoder.js.map +1 -1
- package/lib/langium/validation/document-validator.d.ts +294 -10
- package/lib/langium/validation/document-validator.d.ts.map +1 -1
- package/lib/langium/validation/document-validator.js +448 -5
- package/lib/langium/validation/document-validator.js.map +1 -1
- package/lib/langium/workspace/document-uri-policy.d.ts +3 -4
- package/lib/langium/workspace/document-uri-policy.d.ts.map +1 -1
- package/lib/langium/workspace/document-uri-policy.js +3 -4
- package/lib/langium/workspace/document-uri-policy.js.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts +25 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-langium-document-factory.js +25 -0
- package/lib/langium/workspace/hydranium-langium-document-factory.js.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts +21 -1
- package/lib/langium/workspace/hydranium-workspace-manager.d.ts.map +1 -1
- package/lib/langium/workspace/hydranium-workspace-manager.js +28 -0
- package/lib/langium/workspace/hydranium-workspace-manager.js.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts +8 -0
- package/lib/langium/workspace/in-memory-file-system-provider.d.ts.map +1 -1
- package/lib/langium/workspace/in-memory-file-system-provider.js +11 -2
- package/lib/langium/workspace/in-memory-file-system-provider.js.map +1 -1
- package/lib/langium/workspace/initialize-workspace.d.ts +22 -2
- package/lib/langium/workspace/initialize-workspace.d.ts.map +1 -1
- package/lib/langium/workspace/initialize-workspace.js +13 -5
- package/lib/langium/workspace/initialize-workspace.js.map +1 -1
- package/lib/langium/workspace/langium-documents.d.ts +79 -17
- package/lib/langium/workspace/langium-documents.d.ts.map +1 -1
- package/lib/langium/workspace/langium-documents.js +83 -28
- package/lib/langium/workspace/langium-documents.js.map +1 -1
- package/lib/locale/index.d.ts +10 -0
- package/lib/locale/index.d.ts.map +1 -0
- package/lib/locale/index.js +10 -0
- package/lib/locale/index.js.map +1 -0
- package/lib/locale/server-locale.d.ts +73 -0
- package/lib/locale/server-locale.d.ts.map +1 -0
- package/lib/locale/server-locale.js +61 -0
- package/lib/locale/server-locale.js.map +1 -0
- package/lib/lsp/hydranium-document-update-handler.js +1 -1
- package/lib/lsp/hydranium-document-update-handler.js.map +1 -1
- package/lib/lsp/index.d.ts +1 -1
- package/lib/lsp/index.d.ts.map +1 -1
- package/lib/lsp/index.js +1 -1
- package/lib/lsp/index.js.map +1 -1
- package/lib/lsp/lsp-latency.d.ts +39 -0
- package/lib/lsp/lsp-latency.d.ts.map +1 -0
- package/lib/lsp/lsp-latency.js +58 -0
- package/lib/lsp/lsp-latency.js.map +1 -0
- package/lib/lsp/semantic-token-provider.d.ts +34 -1
- package/lib/lsp/semantic-token-provider.d.ts.map +1 -1
- package/lib/lsp/semantic-token-provider.js +55 -8
- package/lib/lsp/semantic-token-provider.js.map +1 -1
- package/lib/messages/carriers.d.ts +54 -0
- package/lib/messages/carriers.d.ts.map +1 -0
- package/lib/messages/carriers.js +62 -0
- package/lib/messages/carriers.js.map +1 -0
- package/lib/messages/index.d.ts +25 -0
- package/lib/messages/index.d.ts.map +1 -0
- package/lib/messages/index.js +25 -0
- package/lib/messages/index.js.map +1 -0
- package/lib/messages/renderer.d.ts +136 -0
- package/lib/messages/renderer.d.ts.map +1 -0
- package/lib/messages/renderer.js +159 -0
- package/lib/messages/renderer.js.map +1 -0
- package/lib/node/heap-ceiling.d.ts +61 -0
- package/lib/node/heap-ceiling.d.ts.map +1 -0
- package/lib/node/heap-ceiling.js +72 -0
- package/lib/node/heap-ceiling.js.map +1 -0
- package/lib/node/index.d.ts +1 -0
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +1 -0
- package/lib/node/index.js.map +1 -1
- package/lib/node/latency-from-env.d.ts +1 -1
- package/lib/node/latency-from-env.js +1 -1
- package/lib/node/node-file-system-provider.d.ts.map +1 -1
- package/lib/node/node-file-system-provider.js +1 -40
- package/lib/node/node-file-system-provider.js.map +1 -1
- package/lib/node/profiling-run.d.ts +2 -2
- package/lib/node/profiling-run.js +1 -1
- package/lib/node/profiling-run.js.map +1 -1
- package/lib/node/rename-over-open-readers.d.ts +52 -0
- package/lib/node/rename-over-open-readers.d.ts.map +1 -0
- package/lib/node/rename-over-open-readers.js +66 -0
- package/lib/node/rename-over-open-readers.js.map +1 -0
- package/lib/testing/fake-document.d.ts +16 -4
- package/lib/testing/fake-document.d.ts.map +1 -1
- package/lib/testing/fake-document.js +18 -3
- package/lib/testing/fake-document.js.map +1 -1
- package/lib/testing/make-noop-shared-services.d.ts +14 -0
- package/lib/testing/make-noop-shared-services.d.ts.map +1 -1
- package/lib/testing/make-noop-shared-services.js +28 -2
- package/lib/testing/make-noop-shared-services.js.map +1 -1
- package/lib/testing/make-test-services.d.ts +44 -8
- package/lib/testing/make-test-services.d.ts.map +1 -1
- package/lib/testing/make-test-services.js +19 -3
- package/lib/testing/make-test-services.js.map +1 -1
- package/lib/testing/node/spawned-server.d.ts +14 -0
- package/lib/testing/node/spawned-server.d.ts.map +1 -1
- package/lib/testing/node/spawned-server.js +33 -1
- package/lib/testing/node/spawned-server.js.map +1 -1
- package/lib/testing/playwright/flaky-network-proxy.d.ts +76 -0
- package/lib/testing/playwright/flaky-network-proxy.d.ts.map +1 -0
- package/lib/testing/playwright/flaky-network-proxy.js +164 -0
- package/lib/testing/playwright/flaky-network-proxy.js.map +1 -0
- package/lib/testing/playwright/index.d.ts +1 -0
- package/lib/testing/playwright/index.d.ts.map +1 -1
- package/lib/testing/playwright/index.js +1 -0
- package/lib/testing/playwright/index.js.map +1 -1
- package/lib/testing/playwright/server-log-capture.d.ts +14 -4
- package/lib/testing/playwright/server-log-capture.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-capture.js +21 -4
- package/lib/testing/playwright/server-log-capture.js.map +1 -1
- package/lib/testing/playwright/server-log-rename-reporter.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-rename-reporter.js +10 -1
- package/lib/testing/playwright/server-log-rename-reporter.js.map +1 -1
- package/lib/testing/stub-ast-document-manager.d.ts +5 -5
- package/lib/testing/stub-ast-document-manager.d.ts.map +1 -1
- package/lib/testing/stub-ast-document-manager.js +4 -6
- package/lib/testing/stub-ast-document-manager.js.map +1 -1
- package/lib/testing/stub-document-builder.d.ts +8 -0
- package/lib/testing/stub-document-builder.d.ts.map +1 -1
- package/lib/testing/stub-document-builder.js +22 -3
- package/lib/testing/stub-document-builder.js.map +1 -1
- package/lib/testing/stub-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 +5 -4
- package/lib/testing/stub-model-service.d.ts.map +1 -1
- package/lib/testing/stub-model-service.js +2 -2
- package/lib/testing/stub-model-service.js.map +1 -1
- package/package.json +17 -8
- package/src/documents/ast-document-manager.ts +129 -36
- package/src/documents/client-ids.ts +5 -22
- package/src/documents/hydranium-text-documents.ts +167 -61
- package/src/documents/language-client-text-shadow.ts +59 -11
- package/src/documents/self-save-registry.ts +52 -13
- package/src/index.ts +5 -0
- package/src/langium/ast-extension/ast-node-builder.ts +66 -22
- package/src/langium/bootstrap.ts +16 -9
- package/src/langium/config/configuration-provider.ts +119 -0
- package/src/langium/config/index.ts +1 -0
- package/src/langium/diagnostics/lsp-logger.ts +41 -6
- package/src/langium/document-builder/build-pipeline-integration.ts +14 -1
- package/src/langium/document-builder/build-session.ts +87 -0
- package/src/langium/document-builder/document-builder.ts +339 -11
- package/src/langium/document-builder/index.ts +1 -0
- package/src/langium/integration-services.ts +67 -6
- package/src/langium/integrity/integrity-service.ts +35 -1
- package/src/langium/keys/containment.ts +87 -0
- package/src/langium/keys/index.ts +1 -0
- package/src/langium/keys/name-based-key-provider.ts +4 -0
- package/src/langium/model-service/model-service.ts +211 -30
- package/src/langium/module.ts +106 -21
- package/src/langium/naming/name-provider.ts +27 -5
- package/src/langium/naming/name-separator-validation.ts +34 -5
- package/src/langium/residency/cst-residency-service.ts +36 -12
- package/src/langium/scope/hydranium-scope-provider.ts +40 -22
- package/src/langium/service-registry.ts +6 -2
- package/src/langium/shared-services.ts +19 -2
- package/src/langium/transfer/transfer-encoder.ts +85 -24
- package/src/langium/validation/document-validator.ts +537 -11
- package/src/langium/workspace/document-uri-policy.ts +3 -4
- package/src/langium/workspace/hydranium-langium-document-factory.ts +34 -0
- package/src/langium/workspace/hydranium-workspace-manager.ts +30 -1
- package/src/langium/workspace/in-memory-file-system-provider.ts +13 -3
- package/src/langium/workspace/initialize-workspace.ts +34 -5
- package/src/langium/workspace/langium-documents.ts +106 -33
- package/src/locale/index.ts +10 -0
- package/src/locale/server-locale.ts +86 -0
- package/src/lsp/hydranium-document-update-handler.ts +1 -1
- package/src/lsp/index.ts +1 -1
- package/src/lsp/lsp-latency.ts +62 -0
- package/src/lsp/semantic-token-provider.ts +74 -7
- package/src/messages/carriers.ts +78 -0
- package/src/messages/index.ts +36 -0
- package/src/messages/renderer.ts +204 -0
- package/src/node/heap-ceiling.ts +108 -0
- package/src/node/index.ts +1 -0
- package/src/node/latency-from-env.ts +1 -1
- package/src/node/node-file-system-provider.ts +1 -41
- package/src/node/profiling-run.ts +3 -3
- package/src/node/rename-over-open-readers.ts +78 -0
- package/src/testing/fake-document.ts +24 -5
- package/src/testing/make-noop-shared-services.ts +50 -2
- package/src/testing/make-test-services.ts +73 -18
- package/src/testing/node/spawned-server.ts +35 -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 +24 -5
- package/src/testing/playwright/server-log-rename-reporter.ts +12 -1
- package/src/testing/stub-ast-document-manager.ts +10 -14
- package/src/testing/stub-document-builder.ts +32 -3
- package/src/testing/stub-langium-documents.ts +3 -2
- package/src/testing/stub-model-service.ts +7 -6
- package/lib/lsp/instrument-connection.d.ts +0 -36
- package/lib/lsp/instrument-connection.d.ts.map +0 -1
- package/lib/lsp/instrument-connection.js +0 -62
- package/lib/lsp/instrument-connection.js.map +0 -1
- package/src/lsp/instrument-connection.ts +0 -66
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
import { type ConfigurationInitializedParams, DefaultConfigurationProvider } from '@hydranium/langium';
|
|
10
|
+
import type { ConfigurationItem, DidChangeConfigurationRegistrationOptions } from 'vscode-languageserver';
|
|
11
|
+
/**
|
|
12
|
+
* Configuration provider that asks the client about a section the first time
|
|
13
|
+
* something reads it.
|
|
14
|
+
*
|
|
15
|
+
* Langium's base requests one section per registered language, named after the
|
|
16
|
+
* language id, and never asks again. A read of any other section — including
|
|
17
|
+
* whatever `lsp.configurationRoot` is bound to — then resolves `undefined` with
|
|
18
|
+
* no request on the wire, which is indistinguishable from a setting the user has
|
|
19
|
+
* not set.
|
|
20
|
+
*
|
|
21
|
+
* Asking on first read rather than from a list collected up front: a reader
|
|
22
|
+
* names its section during DI, after `initialized` has taken its one-shot pass,
|
|
23
|
+
* so a list would have to be complete before the server initialized.
|
|
24
|
+
*/
|
|
25
|
+
export declare class HydraniumConfigurationProvider extends DefaultConfigurationProvider {
|
|
26
|
+
/**
|
|
27
|
+
* The client-facing hooks, captured because they arrive once as arguments to
|
|
28
|
+
* {@link initialized} and are needed on every later read. Absent in a
|
|
29
|
+
* headless composition, which has no connection to ask.
|
|
30
|
+
*/
|
|
31
|
+
protected registerForSection?: (params: DidChangeConfigurationRegistrationOptions) => void;
|
|
32
|
+
protected fetchSections?: (items: ConfigurationItem[]) => Promise<unknown>;
|
|
33
|
+
/**
|
|
34
|
+
* Sections already dealt with, holding the in-flight work so concurrent
|
|
35
|
+
* readers share one round trip. Entries stay after they settle: they record
|
|
36
|
+
* that the section was HANDLED, and without that an unset section is
|
|
37
|
+
* re-requested on every read, "unset" and "not fetched" being the same
|
|
38
|
+
* absence in the store.
|
|
39
|
+
*
|
|
40
|
+
* A section the client's capabilities ruled out counts as handled, having
|
|
41
|
+
* been settled by asking nothing.
|
|
42
|
+
*/
|
|
43
|
+
protected readonly requestedSections: Map<string, Promise<void>>;
|
|
44
|
+
initialized(params: ConfigurationInitializedParams): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* The `ready` await precedes the emptiness check: the base resolves it at the
|
|
47
|
+
* end of its own initial fetch, so testing the store first calls every
|
|
48
|
+
* language section missing and re-requests what is already on its way.
|
|
49
|
+
*/
|
|
50
|
+
getConfiguration(language: string, configuration: string): Promise<unknown>;
|
|
51
|
+
/** Ask about `section` once, sharing the request with any concurrent reader. */
|
|
52
|
+
protected requestSection(section: string): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* The hooks are gated on the client having declared `workspace.configuration`.
|
|
55
|
+
* A connection binds them whatever the client said, so their presence is not
|
|
56
|
+
* consent: calling them sends a `client/registerCapability` and a
|
|
57
|
+
* `workspace/configuration` to a client that advertised support for neither,
|
|
58
|
+
* which is entitled to answer either with a method-not-found and may drop the
|
|
59
|
+
* connection.
|
|
60
|
+
*
|
|
61
|
+
* That flag is exact for the fetch and KNOWINGLY coarse for the registration,
|
|
62
|
+
* which the spec governs by
|
|
63
|
+
* `workspace.didChangeConfiguration.dynamicRegistration`. The base registers
|
|
64
|
+
* under `workspace.configuration` alone before any of this runs, so gating
|
|
65
|
+
* the registration on the narrower flag here would withhold a request whose
|
|
66
|
+
* twin has already gone out, sparing the client nothing. A client declaring
|
|
67
|
+
* `workspace.configuration` without dynamic registration is still registered
|
|
68
|
+
* for, by the base and by this; closing that means changing the base's pass,
|
|
69
|
+
* not this gate.
|
|
70
|
+
*
|
|
71
|
+
* Registering before fetching, so an edit landing between the two arrives as
|
|
72
|
+
* a notification instead of being lost; the reverse order drops it.
|
|
73
|
+
*
|
|
74
|
+
* A `null` result is left out of the store rather than written, so the
|
|
75
|
+
* section reads as unset, and no `onConfigurationSectionUpdate` fires — the
|
|
76
|
+
* value goes to the caller that asked for it, and an event would announce a
|
|
77
|
+
* change that is only this provider catching up.
|
|
78
|
+
*/
|
|
79
|
+
protected doRequestSection(section: string): Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=configuration-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-provider.d.ts","sourceRoot":"","sources":["../../../src/langium/config/configuration-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AACvG,OAAO,KAAK,EAAE,iBAAiB,EAAE,yCAAyC,EAAE,MAAM,uBAAuB,CAAC;AAE1G;;;;;;;;;;;;;GAaG;AACH,qBAAa,8BAA+B,SAAQ,4BAA4B;IAC7E;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,yCAAyC,KAAK,IAAI,CAAC;IAC3F,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE3E;;;;;;;;;OASG;IACH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,6BAAoC;IAEzD,WAAW,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjF;;;;OAIG;IACY,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAS1F,gFAAgF;IAChF,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUxD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;cACa,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAclE"}
|
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
import { DefaultConfigurationProvider } from '@hydranium/langium';
|
|
10
|
+
/**
|
|
11
|
+
* Configuration provider that asks the client about a section the first time
|
|
12
|
+
* something reads it.
|
|
13
|
+
*
|
|
14
|
+
* Langium's base requests one section per registered language, named after the
|
|
15
|
+
* language id, and never asks again. A read of any other section — including
|
|
16
|
+
* whatever `lsp.configurationRoot` is bound to — then resolves `undefined` with
|
|
17
|
+
* no request on the wire, which is indistinguishable from a setting the user has
|
|
18
|
+
* not set.
|
|
19
|
+
*
|
|
20
|
+
* Asking on first read rather than from a list collected up front: a reader
|
|
21
|
+
* names its section during DI, after `initialized` has taken its one-shot pass,
|
|
22
|
+
* so a list would have to be complete before the server initialized.
|
|
23
|
+
*/
|
|
24
|
+
export class HydraniumConfigurationProvider extends DefaultConfigurationProvider {
|
|
25
|
+
/**
|
|
26
|
+
* The client-facing hooks, captured because they arrive once as arguments to
|
|
27
|
+
* {@link initialized} and are needed on every later read. Absent in a
|
|
28
|
+
* headless composition, which has no connection to ask.
|
|
29
|
+
*/
|
|
30
|
+
registerForSection;
|
|
31
|
+
fetchSections;
|
|
32
|
+
/**
|
|
33
|
+
* Sections already dealt with, holding the in-flight work so concurrent
|
|
34
|
+
* readers share one round trip. Entries stay after they settle: they record
|
|
35
|
+
* that the section was HANDLED, and without that an unset section is
|
|
36
|
+
* re-requested on every read, "unset" and "not fetched" being the same
|
|
37
|
+
* absence in the store.
|
|
38
|
+
*
|
|
39
|
+
* A section the client's capabilities ruled out counts as handled, having
|
|
40
|
+
* been settled by asking nothing.
|
|
41
|
+
*/
|
|
42
|
+
requestedSections = new Map();
|
|
43
|
+
async initialized(params) {
|
|
44
|
+
this.registerForSection = params.register;
|
|
45
|
+
this.fetchSections = params.fetchConfiguration;
|
|
46
|
+
await super.initialized(params);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The `ready` await precedes the emptiness check: the base resolves it at the
|
|
50
|
+
* end of its own initial fetch, so testing the store first calls every
|
|
51
|
+
* language section missing and re-requests what is already on its way.
|
|
52
|
+
*/
|
|
53
|
+
async getConfiguration(language, configuration) {
|
|
54
|
+
await this.ready;
|
|
55
|
+
const section = this.toSectionName(language);
|
|
56
|
+
if (this.settings[section] === undefined) {
|
|
57
|
+
await this.requestSection(section);
|
|
58
|
+
}
|
|
59
|
+
return super.getConfiguration(language, configuration);
|
|
60
|
+
}
|
|
61
|
+
/** Ask about `section` once, sharing the request with any concurrent reader. */
|
|
62
|
+
requestSection(section) {
|
|
63
|
+
const existing = this.requestedSections.get(section);
|
|
64
|
+
if (existing) {
|
|
65
|
+
return existing;
|
|
66
|
+
}
|
|
67
|
+
const request = this.doRequestSection(section);
|
|
68
|
+
this.requestedSections.set(section, request);
|
|
69
|
+
return request;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The hooks are gated on the client having declared `workspace.configuration`.
|
|
73
|
+
* A connection binds them whatever the client said, so their presence is not
|
|
74
|
+
* consent: calling them sends a `client/registerCapability` and a
|
|
75
|
+
* `workspace/configuration` to a client that advertised support for neither,
|
|
76
|
+
* which is entitled to answer either with a method-not-found and may drop the
|
|
77
|
+
* connection.
|
|
78
|
+
*
|
|
79
|
+
* That flag is exact for the fetch and KNOWINGLY coarse for the registration,
|
|
80
|
+
* which the spec governs by
|
|
81
|
+
* `workspace.didChangeConfiguration.dynamicRegistration`. The base registers
|
|
82
|
+
* under `workspace.configuration` alone before any of this runs, so gating
|
|
83
|
+
* the registration on the narrower flag here would withhold a request whose
|
|
84
|
+
* twin has already gone out, sparing the client nothing. A client declaring
|
|
85
|
+
* `workspace.configuration` without dynamic registration is still registered
|
|
86
|
+
* for, by the base and by this; closing that means changing the base's pass,
|
|
87
|
+
* not this gate.
|
|
88
|
+
*
|
|
89
|
+
* Registering before fetching, so an edit landing between the two arrives as
|
|
90
|
+
* a notification instead of being lost; the reverse order drops it.
|
|
91
|
+
*
|
|
92
|
+
* A `null` result is left out of the store rather than written, so the
|
|
93
|
+
* section reads as unset, and no `onConfigurationSectionUpdate` fires — the
|
|
94
|
+
* value goes to the caller that asked for it, and an event would announce a
|
|
95
|
+
* change that is only this provider catching up.
|
|
96
|
+
*/
|
|
97
|
+
async doRequestSection(section) {
|
|
98
|
+
if (!this.workspaceConfig) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
this.registerForSection?.({ section });
|
|
102
|
+
if (!this.fetchSections) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const fetched = await this.fetchSections([{ section }]);
|
|
106
|
+
const value = Array.isArray(fetched) ? fetched[0] : fetched;
|
|
107
|
+
if (value !== null && value !== undefined) {
|
|
108
|
+
this.updateSectionConfiguration(section, value);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=configuration-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-provider.js","sourceRoot":"","sources":["../../../src/langium/config/configuration-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAuC,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAGvG;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,8BAA+B,SAAQ,4BAA4B;IAC7E;;;;OAIG;IACO,kBAAkB,CAA+D;IACjF,aAAa,CAAoD;IAE3E;;;;;;;;;OASG;IACgB,iBAAiB,GAAG,IAAI,GAAG,EAAyB,CAAC;IAE/D,KAAK,C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C;YACvB,OAAO;QACV,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QACxD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC5D,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzC,IAAI,CAAC,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACnD,CAAC;IACJ,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/langium/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/langium/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/langium/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/langium/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC"}
|
|
@@ -51,6 +51,23 @@ export interface LspLoggerOptions {
|
|
|
51
51
|
export declare class LspLogger extends AbstractLogger implements Logger {
|
|
52
52
|
protected readonly services: ServerSharedServices;
|
|
53
53
|
constructor(services: ServerSharedServices, options?: LspLoggerOptions);
|
|
54
|
+
/**
|
|
55
|
+
* Set the process-wide threshold and announce the transition under whichever
|
|
56
|
+
* of the two thresholds can carry the notice, so a reader sees every change
|
|
57
|
+
* and its absence means the threshold never moved.
|
|
58
|
+
*
|
|
59
|
+
* `error` and `off` admit no notice of their own — `off` nothing at all, and
|
|
60
|
+
* an error-severity line is read as a fault, which a client that marks its
|
|
61
|
+
* log as having seen an error keeps for the session. Entering either is
|
|
62
|
+
* therefore announced BEFORE the switch, under the outgoing threshold; every
|
|
63
|
+
* other change is announced after it, at the level being entered. Leaving
|
|
64
|
+
* `error` or `off` for one of those two says nothing, both thresholds being
|
|
65
|
+
* unable to carry it.
|
|
66
|
+
*
|
|
67
|
+
* Only on a real transition: the bound setting re-fires for configuration
|
|
68
|
+
* changes that leave the value alone.
|
|
69
|
+
*/
|
|
70
|
+
protected applyLevel(next: LogThreshold, source: string): void;
|
|
54
71
|
/**
|
|
55
72
|
* Route logger timing and timestamps through the injected framework
|
|
56
73
|
* {@link Clock} (the dedicated `shared.Clock` slot) so server-side log time
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-logger.d.ts","sourceRoot":"","sources":["../../../src/langium/diagnostics/lsp-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,cAAc,EACd,KAAK,KAAK,EAGV,MAAM,EACN,KAAK,QAAQ,EACb,KAAK,YAAY,EAEjB,KAAK,oBAAoB,EAE3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAYzD;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;CACzE;AAED;;;;;;;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AAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI;IAuC/F,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAM3C"}
|
|
@@ -45,14 +45,17 @@ export class LspLogger extends AbstractLogger {
|
|
|
45
45
|
// a Node concern; skip it cleanly there.
|
|
46
46
|
const env = processEnv();
|
|
47
47
|
if (env) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
48
|
+
// The file-tee target FIRST: the other order writes the level
|
|
49
|
+
// announcement before the sink exists, losing the one line that says
|
|
50
|
+
// which threshold the rest of the file was written at.
|
|
52
51
|
const envLogFile = env[DEFAULT_LOG_FILE_ENV];
|
|
53
52
|
if (envLogFile) {
|
|
54
53
|
setLogFilePath(envLogFile);
|
|
55
54
|
}
|
|
55
|
+
const envLevel = parseLogLevel(env[DEFAULT_LOG_LEVEL_ENV]);
|
|
56
|
+
if (envLevel) {
|
|
57
|
+
this.applyLevel(envLevel, DEFAULT_LOG_LEVEL_ENV);
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
// Apply the configured threshold from the root logger only — `derive`
|
|
@@ -62,15 +65,46 @@ export class LspLogger extends AbstractLogger {
|
|
|
62
65
|
if (options.logThreshold !== undefined) {
|
|
63
66
|
const level = ObservableValue.from(options.logThreshold);
|
|
64
67
|
if (level.value) {
|
|
65
|
-
|
|
68
|
+
this.applyLevel(level.value, 'setting');
|
|
66
69
|
}
|
|
67
70
|
level.onChange(next => {
|
|
68
71
|
if (next) {
|
|
69
|
-
|
|
72
|
+
this.applyLevel(next, 'setting');
|
|
70
73
|
}
|
|
71
74
|
});
|
|
72
75
|
}
|
|
73
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Set the process-wide threshold and announce the transition under whichever
|
|
79
|
+
* of the two thresholds can carry the notice, so a reader sees every change
|
|
80
|
+
* and its absence means the threshold never moved.
|
|
81
|
+
*
|
|
82
|
+
* `error` and `off` admit no notice of their own — `off` nothing at all, and
|
|
83
|
+
* an error-severity line is read as a fault, which a client that marks its
|
|
84
|
+
* log as having seen an error keeps for the session. Entering either is
|
|
85
|
+
* therefore announced BEFORE the switch, under the outgoing threshold; every
|
|
86
|
+
* other change is announced after it, at the level being entered. Leaving
|
|
87
|
+
* `error` or `off` for one of those two says nothing, both thresholds being
|
|
88
|
+
* unable to carry it.
|
|
89
|
+
*
|
|
90
|
+
* Only on a real transition: the bound setting re-fires for configuration
|
|
91
|
+
* changes that leave the value alone.
|
|
92
|
+
*/
|
|
93
|
+
applyLevel(next, source) {
|
|
94
|
+
const previous = Logger.getLevel();
|
|
95
|
+
if (previous === next) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const message = `Log level ${previous} → ${next} (${source})`;
|
|
99
|
+
const announceFirst = next === 'error' || next === 'off';
|
|
100
|
+
if (announceFirst && previous !== 'error') {
|
|
101
|
+
this.logAt(previous, message);
|
|
102
|
+
}
|
|
103
|
+
Logger.setLevel(next);
|
|
104
|
+
if (!announceFirst) {
|
|
105
|
+
this.logAt(next, message);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
74
108
|
/**
|
|
75
109
|
* Route logger timing and timestamps through the injected framework
|
|
76
110
|
* {@link Clock} (the dedicated `shared.Clock` slot) so server-side log time
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-logger.js","sourceRoot":"","sources":["../../../src/langium/diagnostics/lsp-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,cAAc,EAEd,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,EAGN,eAAe,EAEf,aAAa,EACf,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,2BAA2B,CA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7B,OAAO,KAAK,CAAC;IAChB,CAAC;IACD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC;IACvC,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC;YACF,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACN,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -33,6 +33,18 @@ export interface BuildPipelineIntegrationOptions {
|
|
|
33
33
|
*/
|
|
34
34
|
readonly integrityPriority?: number;
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* The build-pipeline slot. Empty because nothing calls this service — it wires
|
|
38
|
+
* itself in its constructor and every seam it offers is `protected`.
|
|
39
|
+
*
|
|
40
|
+
* Typing the slot by the class instead would stop an adopter's subclass
|
|
41
|
+
* satisfying it, since a class carries its `protected` members into the check
|
|
42
|
+
* and they compare by declaration rather than by shape. The cost of the empty
|
|
43
|
+
* shape is that any non-null value satisfies it, so a mis-bound slot compiles
|
|
44
|
+
* and the framework's phase listeners are then never attached.
|
|
45
|
+
*/
|
|
46
|
+
export interface BuildPipelineIntegration {
|
|
47
|
+
}
|
|
36
48
|
/**
|
|
37
49
|
* Wires the framework's build-time features (integrity rules, AST
|
|
38
50
|
* enrichment) into Langium's document-build pipeline. The single shared
|
|
@@ -58,7 +70,7 @@ export interface BuildPipelineIntegrationOptions {
|
|
|
58
70
|
* Eagerly constructed (via `DEFAULT_EAGER_SERVICES`) so the listeners are
|
|
59
71
|
* attached before the first build cycle.
|
|
60
72
|
*/
|
|
61
|
-
export declare class BuildPipelineIntegration {
|
|
73
|
+
export declare class DefaultBuildPipelineIntegration implements BuildPipelineIntegration {
|
|
62
74
|
protected readonly services: ServerSharedServices;
|
|
63
75
|
constructor(services: ServerSharedServices, options?: BuildPipelineIntegrationOptions);
|
|
64
76
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-pipeline-integration.d.ts","sourceRoot":"","sources":["../../../src/langium/document-builder/build-pipeline-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AA4BzD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,QAAQ,CAAC;AAE7C,iEAAiE;AACjE,MAAM,WAAW,+BAA+B;IAC7C;;;;;;OAMG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,wBAAwB;
|
|
1
|
+
{"version":3,"file":"build-pipeline-integration.d.ts","sourceRoot":"","sources":["../../../src/langium/document-builder/build-pipeline-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AA4BzD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uBAAuB,QAAQ,CAAC;AAE7C,iEAAiE;AACjE,MAAM,WAAW,+BAA+B;IAC7C;;;;;;OAMG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED;;;;;;;;;GASG;AAEH,MAAM,WAAW,wBAAwB;CAAG;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,+BAAgC,YAAW,wBAAwB;IAE1E,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB;gBAA9B,QAAQ,EAAE,oBAAoB,EACjD,OAAO,GAAE,+BAAoC;IAsDhD;;;;;;;;;;OAUG;cACa,aAAa,CAC1B,SAAS,EAAE,SAAS,eAAe,EAAE,EACrC,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,iBAAiB,GAC9B,OAAO,CAAC,IAAI,CAAC;IAYhB,oFAAoF;IACpF,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,GAAG,IAAI;IAI1G;;;;;;;OAOG;IACH,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrI"}
|
|
@@ -71,7 +71,7 @@ export const INTEGRITY_PASS_PRIORITY = -1000;
|
|
|
71
71
|
* Eagerly constructed (via `DEFAULT_EAGER_SERVICES`) so the listeners are
|
|
72
72
|
* attached before the first build cycle.
|
|
73
73
|
*/
|
|
74
|
-
export class
|
|
74
|
+
export class DefaultBuildPipelineIntegration {
|
|
75
75
|
services;
|
|
76
76
|
constructor(services, options = {}) {
|
|
77
77
|
this.services = services;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-pipeline-integration.js","sourceRoot":"","sources":["../../../src/langium/document-builder/build-pipeline-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAwB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAA6B;IACpD,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,cAAc;IAC5B,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,iBAAiB;IAC/B,aAAa,CAAC,SAAS;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,uBAAuB,GAA6B,oBAAoB,CAAC;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"build-pipeline-integration.js","sourceRoot":"","sources":["../../../src/langium/document-builder/build-pipeline-integration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAwB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAA6B;IACpD,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,cAAc;IAC5B,aAAa,CAAC,MAAM;IACpB,aAAa,CAAC,iBAAiB;IAC/B,aAAa,CAAC,SAAS;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,uBAAuB,GAA6B,oBAAoB,CAAC;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,IAAI,CAAC;AA2B7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,+BAA+B;IAEnB;IADtB,YACsB,QAA8B,EACjD,UAA2C,EAAE;QAD1B,aAAQ,GAAR,QAAQ,CAAsB;QAGjD,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC,eAAe,CAAC;QACnD,MAAM,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AC,KAAK,CAAC,EAAE,CACnD,CACH,CAAC;QACL,CAAC;IACJ,CAAC;IAED,+DAA+D;IAC/D,+DAA+D;IAC/D,+DAA+D;IAE/D;;;;;;;;;;OAUG;IACO,KAAK,CAAC,aAAa,CAC1B,SAAqC,EACrC,KAAoB,EACpB,WAA8B;QAE9B,sEAAsE;QACtE,uEAAuE;QACvE,2DAA2D;QAC3D,KAAK,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,IAAI,wBAAwB,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC;YAC1F,uEAAuE;YACvE,2DAA2D;YAC3D,KAAK,gBAAgB,CAAC,UAAU,CAAC,+BAA+B,CAAC;YACjE,MAAM,gBAAgB,CAAC,SAAS,CAAC,gBAAgB,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;QAC7F,CAAC;IACJ,CAAC;IAED,oFAAoF;IAC1E,SAAS,CAAC,QAAyB,EAAE,KAAoB,EAAE,WAA8B;QAChG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,mBAAmB,CAAC,cAAc,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IAChI,CAAC;IAED;;;;;;;OAOG;IACO,aAAa,CAAC,SAAqC,EAAE,KAAoB,EAAE,WAA8B;QAChH,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IACjG,CAAC;CACH"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { type URI } from '@hydranium/langium';
|
|
10
|
+
/** What a build is about, handed to `HydraniumDocumentBuilder.createBuildSession`. */
|
|
11
|
+
export interface BuildSessionContext {
|
|
12
|
+
/**
|
|
13
|
+
* Which entry point opened the build: `'build'` is the workspace-wide pass
|
|
14
|
+
* (initialization), `'update'` an incremental rebuild. A subclass deriving
|
|
15
|
+
* cascade state skips the work for `'build'`, where every document is in the
|
|
16
|
+
* set already and `shouldRelink` is never consulted.
|
|
17
|
+
*/
|
|
18
|
+
readonly kind: 'build' | 'update';
|
|
19
|
+
/** Formatted description of what caused the build — a URI, a count summary. */
|
|
20
|
+
readonly trigger: string;
|
|
21
|
+
/** True when {@link trigger} already states the document count. */
|
|
22
|
+
readonly triggerCountsDocs: boolean;
|
|
23
|
+
/** URIs the build was asked to rebuild, already flattened and canonicalized. */
|
|
24
|
+
readonly changed: readonly URI[];
|
|
25
|
+
/** URIs the build was asked to delete, already expanded by `collectDeletedURIs`. Empty for a `build` call. */
|
|
26
|
+
readonly deleted: readonly URI[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* One rebuild, treated as a correlated unit.
|
|
30
|
+
*
|
|
31
|
+
* Everything a build phase needs to know about the build it belongs to — what
|
|
32
|
+
* triggered it, when it started, whether it was cancelled, and the log lines it
|
|
33
|
+
* has produced so far. A `HydraniumDocumentBuilder` opens one per `update` /
|
|
34
|
+
* `build` call and holds it for the duration, so a per-phase hook can reach
|
|
35
|
+
* build-wide facts that no per-line formatting hook could.
|
|
36
|
+
*
|
|
37
|
+
* **Identity is the object, not {@link traceId}.** `Tracer.time` short-circuits
|
|
38
|
+
* when its log level is suppressed and never calls `captureId`, so `traceId` is
|
|
39
|
+
* `undefined` on every build in a production configuration that logs above
|
|
40
|
+
* `debug`. A teardown guard keyed on the id would then compare `undefined`
|
|
41
|
+
* against `undefined` and let a preempted build clear its successor's state.
|
|
42
|
+
* Reference equality against `HydraniumDocumentBuilder.activeSession` holds in
|
|
43
|
+
* both configurations, which is why nothing here is keyed on the id.
|
|
44
|
+
*
|
|
45
|
+
* Adopters carrying build-scoped state of their own subclass this and return it
|
|
46
|
+
* from `HydraniumDocumentBuilder.createBuildSession`, narrowing with an
|
|
47
|
+
* `instanceof` where they read it back. That buys them the framework's
|
|
48
|
+
* preemption-correct teardown rather than a second copy of it.
|
|
49
|
+
*/
|
|
50
|
+
export declare class BuildSession {
|
|
51
|
+
/** Millisecond timestamp the build started at, on the same clock as `performance.now()`. */
|
|
52
|
+
readonly startMs: number;
|
|
53
|
+
/** What caused this build — a formatted URI, a count summary, or an adopter label. */
|
|
54
|
+
readonly trigger: string;
|
|
55
|
+
/** True when {@link trigger} already states the document count, so a phase line must not repeat it. */
|
|
56
|
+
readonly triggerCountsDocs: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Build duration at or above which the buffered lines are emitted; `0`
|
|
59
|
+
* disables buffering entirely. Captured per session so the flush decision
|
|
60
|
+
* uses the same value the buffering decision did, even if the underlying
|
|
61
|
+
* observable changed mid-build.
|
|
62
|
+
*/
|
|
63
|
+
readonly detailThresholdMs: number;
|
|
64
|
+
/**
|
|
65
|
+
* `Tracer.time` correlation id, so a phase line and the build line share a
|
|
66
|
+
* `#N`. `undefined` until the timer starts, and permanently `undefined` when
|
|
67
|
+
* the timing line is suppressed.
|
|
68
|
+
*/
|
|
69
|
+
traceId?: number;
|
|
70
|
+
/** Set when the build ended in `OperationCancelled`, so the successor can tag itself "cancels #N". */
|
|
71
|
+
cancelled: boolean;
|
|
72
|
+
/** Phase-reached lines produced so far; the first one measures from {@link startMs} rather than from the previous phase. */
|
|
73
|
+
phasesLogged: number;
|
|
74
|
+
/** Lines held back by {@link detailThresholdMs}; flushed or dropped when the build ends. */
|
|
75
|
+
readonly bufferedLines: string[];
|
|
76
|
+
constructor(
|
|
77
|
+
/** Millisecond timestamp the build started at, on the same clock as `performance.now()`. */
|
|
78
|
+
startMs: number,
|
|
79
|
+
/** What caused this build — a formatted URI, a count summary, or an adopter label. */
|
|
80
|
+
trigger: string,
|
|
81
|
+
/** True when {@link trigger} already states the document count, so a phase line must not repeat it. */
|
|
82
|
+
triggerCountsDocs: boolean,
|
|
83
|
+
/**
|
|
84
|
+
* Build duration at or above which the buffered lines are emitted; `0`
|
|
85
|
+
* disables buffering entirely. Captured per session so the flush decision
|
|
86
|
+
* uses the same value the buffering decision did, even if the underlying
|
|
87
|
+
* observable changed mid-build.
|
|
88
|
+
*/
|
|
89
|
+
detailThresholdMs: number);
|
|
90
|
+
/** True while lines are being held rather than emitted as they are produced. */
|
|
91
|
+
get buffers(): boolean;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=build-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-session.d.ts","sourceRoot":"","sources":["../../../src/langium/document-builder/build-session.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9C,sFAAsF;AACtF,MAAM,WAAW,mBAAmB;IACjC;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IAClC,+EAA+E;IAC/E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,EAAE,CAAC;IACjC,8GAA8G;IAC9G,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,YAAY;IAenB,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,sFAAsF;IACtF,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,uGAAuG;IACvG,QAAQ,CAAC,iBAAiB,EAAE,OAAO;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,EAAE,MAAM;IA1BrC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sGAAsG;IACtG,SAAS,UAAS;IAClB,4HAA4H;IAC5H,YAAY,SAAK;IACjB,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,CAAM;;IAGnC,4FAA4F;IACnF,OAAO,EAAE,MAAM;IACxB,sFAAsF;IAC7E,OAAO,EAAE,MAAM;IACxB,uGAAuG;IAC9F,iBAAiB,EAAE,OAAO;IACnC;;;;;OAKG;IACM,iBAAiB,EAAE,MAAM;IAGrC,gFAAgF;IAChF,IAAI,OAAO,IAAI,OAAO,CAErB;CACH"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
/**
|
|
10
|
+
* One rebuild, treated as a correlated unit.
|
|
11
|
+
*
|
|
12
|
+
* Everything a build phase needs to know about the build it belongs to — what
|
|
13
|
+
* triggered it, when it started, whether it was cancelled, and the log lines it
|
|
14
|
+
* has produced so far. A `HydraniumDocumentBuilder` opens one per `update` /
|
|
15
|
+
* `build` call and holds it for the duration, so a per-phase hook can reach
|
|
16
|
+
* build-wide facts that no per-line formatting hook could.
|
|
17
|
+
*
|
|
18
|
+
* **Identity is the object, not {@link traceId}.** `Tracer.time` short-circuits
|
|
19
|
+
* when its log level is suppressed and never calls `captureId`, so `traceId` is
|
|
20
|
+
* `undefined` on every build in a production configuration that logs above
|
|
21
|
+
* `debug`. A teardown guard keyed on the id would then compare `undefined`
|
|
22
|
+
* against `undefined` and let a preempted build clear its successor's state.
|
|
23
|
+
* Reference equality against `HydraniumDocumentBuilder.activeSession` holds in
|
|
24
|
+
* both configurations, which is why nothing here is keyed on the id.
|
|
25
|
+
*
|
|
26
|
+
* Adopters carrying build-scoped state of their own subclass this and return it
|
|
27
|
+
* from `HydraniumDocumentBuilder.createBuildSession`, narrowing with an
|
|
28
|
+
* `instanceof` where they read it back. That buys them the framework's
|
|
29
|
+
* preemption-correct teardown rather than a second copy of it.
|
|
30
|
+
*/
|
|
31
|
+
export class BuildSession {
|
|
32
|
+
startMs;
|
|
33
|
+
trigger;
|
|
34
|
+
triggerCountsDocs;
|
|
35
|
+
detailThresholdMs;
|
|
36
|
+
/**
|
|
37
|
+
* `Tracer.time` correlation id, so a phase line and the build line share a
|
|
38
|
+
* `#N`. `undefined` until the timer starts, and permanently `undefined` when
|
|
39
|
+
* the timing line is suppressed.
|
|
40
|
+
*/
|
|
41
|
+
traceId;
|
|
42
|
+
/** Set when the build ended in `OperationCancelled`, so the successor can tag itself "cancels #N". */
|
|
43
|
+
cancelled = false;
|
|
44
|
+
/** Phase-reached lines produced so far; the first one measures from {@link startMs} rather than from the previous phase. */
|
|
45
|
+
phasesLogged = 0;
|
|
46
|
+
/** Lines held back by {@link detailThresholdMs}; flushed or dropped when the build ends. */
|
|
47
|
+
bufferedLines = [];
|
|
48
|
+
constructor(
|
|
49
|
+
/** Millisecond timestamp the build started at, on the same clock as `performance.now()`. */
|
|
50
|
+
startMs,
|
|
51
|
+
/** What caused this build — a formatted URI, a count summary, or an adopter label. */
|
|
52
|
+
trigger,
|
|
53
|
+
/** True when {@link trigger} already states the document count, so a phase line must not repeat it. */
|
|
54
|
+
triggerCountsDocs,
|
|
55
|
+
/**
|
|
56
|
+
* Build duration at or above which the buffered lines are emitted; `0`
|
|
57
|
+
* disables buffering entirely. Captured per session so the flush decision
|
|
58
|
+
* uses the same value the buffering decision did, even if the underlying
|
|
59
|
+
* observable changed mid-build.
|
|
60
|
+
*/
|
|
61
|
+
detailThresholdMs) {
|
|
62
|
+
this.startMs = startMs;
|
|
63
|
+
this.trigger = trigger;
|
|
64
|
+
this.triggerCountsDocs = triggerCountsDocs;
|
|
65
|
+
this.detailThresholdMs = detailThresholdMs;
|
|
66
|
+
}
|
|
67
|
+
/** True while lines are being held rather than emitted as they are produced. */
|
|
68
|
+
get buffers() {
|
|
69
|
+
return this.detailThresholdMs > 0;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=build-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-session.js","sourceRoot":"","sources":["../../../src/langium/document-builder/build-session.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAuBlF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,YAAY;IAgBV;IAEA;IAEA;IAOA;IA1BZ;;;;OAIG;IACH,OAAO,CAAU;IACjB,sGAAsG;IACtG,SAAS,GAAG,KAAK,CAAC;IAClB,4HAA4H;IAC5H,YAAY,GAAG,CAAC,CAAC;IACjB,4FAA4F;IACnF,aAAa,GAAa,EAAE,CAAC;IAEtC;IACG,4FAA4F;IACnF,OAAe;IACxB,sFAAsF;IAC7E,OAAe;IACxB,uGAAuG;IAC9F,iBAA0B;IACnC;;;;;OAKG;IACM,iBAAyB;QAXzB,YAAO,GAAP,OAAO,CAAQ;QAEf,YAAO,GAAP,OAAO,CAAQ;QAEf,sBAAiB,GAAjB,iBAAiB,CAAS;QAO1B,sBAAiB,GAAjB,iBAAiB,CAAQ;IAClC,CAAC;IAEJ,gFAAgF;IAChF,IAAI,OAAO;QACR,OAAO,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;IACrC,CAAC;CACH"}
|