@hydranium/core 1.0.0-next.259 → 1.0.0-next.261
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/langium/bootstrap.d.ts +11 -9
- package/lib/langium/bootstrap.d.ts.map +1 -1
- package/lib/langium/bootstrap.js +11 -9
- package/lib/langium/bootstrap.js.map +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass-service.d.ts +1 -1
- package/lib/langium/build-phase-pass/build-phase-pass.d.ts +1 -1
- 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/document-builder/document-builder.d.ts +22 -10
- package/lib/langium/document-builder/document-builder.d.ts.map +1 -1
- package/lib/langium/document-builder/document-builder.js +25 -17
- package/lib/langium/document-builder/document-builder.js.map +1 -1
- package/lib/langium/integrity/integrity-service.d.ts +1 -3
- package/lib/langium/integrity/integrity-service.d.ts.map +1 -1
- package/lib/langium/integrity/integrity-service.js +1 -3
- package/lib/langium/integrity/integrity-service.js.map +1 -1
- package/lib/langium/module.d.ts +1 -1
- package/lib/langium/module.js +1 -1
- package/lib/langium/module.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-provider.d.ts +10 -9
- package/lib/langium/scope/hydranium-scope-provider.d.ts.map +1 -1
- package/lib/langium/scope/hydranium-scope-provider.js +15 -13
- 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-candidate-provider.d.ts +3 -3
- package/lib/langium/scope/reference-candidate-provider.d.ts.map +1 -1
- 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/shared-services.d.ts +2 -0
- package/lib/langium/shared-services.d.ts.map +1 -1
- package/lib/langium/shared-services.js.map +1 -1
- package/lib/node/rename-over-open-readers.d.ts +2 -0
- package/lib/node/rename-over-open-readers.d.ts.map +1 -1
- package/lib/node/rename-over-open-readers.js +6 -2
- package/lib/node/rename-over-open-readers.js.map +1 -1
- package/lib/testing/playwright/server-log-capture.d.ts +4 -0
- package/lib/testing/playwright/server-log-capture.d.ts.map +1 -1
- package/lib/testing/playwright/server-log-capture.js.map +1 -1
- package/lib/testing/stub-document-builder.d.ts +9 -2
- package/lib/testing/stub-document-builder.d.ts.map +1 -1
- package/lib/testing/stub-document-builder.js +25 -0
- package/lib/testing/stub-document-builder.js.map +1 -1
- package/package.json +5 -5
- package/src/langium/bootstrap.ts +11 -9
- package/src/langium/build-phase-pass/build-phase-pass-service.ts +1 -1
- package/src/langium/build-phase-pass/build-phase-pass.ts +1 -1
- package/src/langium/diagnostics/hydranium-langium-profiler.ts +15 -39
- package/src/langium/document-builder/document-builder.ts +37 -19
- package/src/langium/integrity/integrity-service.ts +2 -4
- package/src/langium/module.ts +2 -2
- package/src/langium/scope/fallback-scope.ts +38 -0
- package/src/langium/scope/hydranium-scope-provider.ts +26 -14
- package/src/langium/scope/index.ts +1 -0
- package/src/langium/scope/reference-candidate-provider.ts +3 -3
- package/src/langium/scope/scope-extension-service.ts +74 -59
- package/src/langium/shared-services.ts +5 -0
- package/src/node/rename-over-open-readers.ts +7 -2
- package/src/testing/playwright/server-log-capture.ts +4 -0
- package/src/testing/stub-document-builder.ts +33 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stub-document-builder.js","sourceRoot":"","sources":["../../src/testing/stub-document-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAMJ,oBAAoB,EAItB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA0B,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,
|
|
1
|
+
{"version":3,"file":"stub-document-builder.js","sourceRoot":"","sources":["../../src/testing/stub-document-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAMJ,oBAAoB,EAItB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA0B,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAwB,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAwGjH;;;;;;;;;;GAUG;AACH,SAAS,OAAO,CAAC,MAAe;IAC7B,KAAK,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACnD,cAAc,CAAC,GAAG,EAAE;YACjB,MAAM,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,aAA6B;IAClE,MAAM,cAAc,GAAG,IAAI,GAAG,EAA0C,CAAC;IACzE,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAA8E,CAAC;IACjH,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAA0C,CAAC;IAC9E,MAAM,iBAAiB,GAA6B,EAAE,CAAC;IACvD,MAAM,mBAAmB,GAA4C,EAAE,CAAC;IACxE,MAAM,KAAK,GAA+C,EAAE,CAAC;IAC7D,MAAM,WAAW,GAA0C,EAAE,CAAC;IAC9D,MAAM,cAAc,GAA4D,EAAE,CAAC;IAEnF,MAAM,YAAY,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,CAAC;wBACpC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;4BACf,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;wBAC3B,CAAC;wBACD,MAAM,IAAI,KAAK,CACZ,6FAA6F;4BAC1F,wGAAwG,CAC7G,CAAC;oBACL,CAAC;oBACD,OAAO,EAAE,CAAC;gBACb,CAAC;aACH,CAAC;QACL,CAAC;QACD,KAAK;YACF,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;QACD,YAAY;YACT,OAAO,YAAY,CAAC,cAAc,CAAC,CAAC;QACvC,CAAC;QACD,KAAK;YACF,cAAc,CAAC,KAAK,EAAE,CAAC;YACvB,kBAAkB,CAAC,KAAK,EAAE,CAAC;YAC3B,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;YAC7B,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC;YAC/B,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YACjB,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;YACvB,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;QAC7B,CAAC;KACH,CAAC;IACF,OAAO,IAAI,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/core",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.261",
|
|
4
4
|
"description": "Foundational runtime of the hydranium framework: AST coordination layer (services, integrity, AST extension, serialization, multi-client documents) plus the LSP textual head at the /lsp subpath. Consumed by protocol-head packages (@hydranium/data-server, @hydranium/glsp-server).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ast",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"diff": "^5.2.0"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@hydranium/langium": "1.0.0-next.
|
|
87
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
86
|
+
"@hydranium/langium": "1.0.0-next.261",
|
|
87
|
+
"@hydranium/protocol": "1.0.0-next.261",
|
|
88
88
|
"@playwright/test": "^1.40.0",
|
|
89
89
|
"@types/diff": "^5.2.0",
|
|
90
90
|
"rimraf": "^5.0.0",
|
|
@@ -96,8 +96,8 @@
|
|
|
96
96
|
"vscode-languageserver-types": "^3.17.5"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
|
-
"@hydranium/langium": "1.0.0-next.
|
|
100
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
99
|
+
"@hydranium/langium": "1.0.0-next.261",
|
|
100
|
+
"@hydranium/protocol": "1.0.0-next.261",
|
|
101
101
|
"@playwright/test": "^1.40.0",
|
|
102
102
|
"vscode-jsonrpc": "^9.0.0",
|
|
103
103
|
"vscode-languageserver": "~10.0.1",
|
package/src/langium/bootstrap.ts
CHANGED
|
@@ -311,16 +311,18 @@ export function warnOnUnexpectedBindings(shared: LangiumSharedServices, language
|
|
|
311
311
|
* dispatch every build-phase pass and drive AST enrichment, and
|
|
312
312
|
* registers the framework integrity passes itself. The per-language
|
|
313
313
|
* feature services it routes to (`ast.AstExtensionService` +
|
|
314
|
-
* `integrity.IntegrityService
|
|
315
|
-
* read by the scope provider) hold the registries and the logic but own
|
|
314
|
+
* `integrity.IntegrityService`) hold the registries and the logic but own
|
|
316
315
|
* no listeners, so they need not be eager: each language's services
|
|
317
|
-
* construct lazily when the orchestrator
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
316
|
+
* construct lazily when the orchestrator first reaches them, and their
|
|
317
|
+
* constructors register that language's rules / extensions just-in-time.
|
|
318
|
+
* `references.ScopeExtensionService`, read by the scope provider, does
|
|
319
|
+
* subscribe to the builder, but only to report its own calls, so
|
|
320
|
+
* constructing it at its first call misses none.
|
|
321
|
+
* - **`profilers.LangiumProfiler`** — subscribes to
|
|
322
|
+
* `documentBuilder.onBuildEnded` to flush the aggregated
|
|
323
|
+
* parse/link/validate profile once per build. No production cost (the
|
|
324
|
+
* profiler is trace-gated), but the listener must be attached before the
|
|
325
|
+
* first build ends.
|
|
324
326
|
* - **`workspace.CstResidencyService`** — self-registers a `Validated`
|
|
325
327
|
* BuildPhasePass that sheds the CST of closed documents. The framework
|
|
326
328
|
* default strategy is `always-keep`, so the pass runs but sheds nothing
|
|
@@ -27,7 +27,7 @@ import { type BuildPhasePass, type BuildPhasePassRegistry } from './build-phase-
|
|
|
27
27
|
* per-language work (integrity) fans out by language *inside* its pass. This
|
|
28
28
|
* also keeps one priority space per phase across framework and adopter passes,
|
|
29
29
|
* which is the point — `runPasses` orders the framework's integrity and
|
|
30
|
-
*
|
|
30
|
+
* CST-residency passes against adopter passes deterministically.
|
|
31
31
|
*/
|
|
32
32
|
export interface BuildPhasePassService extends BuildPhasePassRegistry {
|
|
33
33
|
/**
|
|
@@ -102,7 +102,7 @@ export function groupDocumentsByLanguage<TLanguage extends LangiumCoreServices>(
|
|
|
102
102
|
* Registry handed to a {@link BuildPhasePassContribution}. Implemented by the
|
|
103
103
|
* `BuildPhasePassService`; doubles
|
|
104
104
|
* as the low-level imperative API the framework uses to self-register its own
|
|
105
|
-
* passes (integrity,
|
|
105
|
+
* passes (integrity, CST residency).
|
|
106
106
|
*/
|
|
107
107
|
export interface BuildPhasePassRegistry {
|
|
108
108
|
register(pass: BuildPhasePass): Disposable;
|
|
@@ -8,14 +8,7 @@
|
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
10
|
import { Format, Logger, type Tracer } from '@hydranium/protocol';
|
|
11
|
-
import {
|
|
12
|
-
DefaultLangiumProfiler,
|
|
13
|
-
DocumentState,
|
|
14
|
-
MultiMap,
|
|
15
|
-
type ProfilingCategory,
|
|
16
|
-
type ProfilingRecord,
|
|
17
|
-
ProfilingTask
|
|
18
|
-
} from '@hydranium/langium';
|
|
11
|
+
import { DefaultLangiumProfiler, MultiMap, type ProfilingCategory, type ProfilingRecord, ProfilingTask } from '@hydranium/langium';
|
|
19
12
|
import { type LogNameOptions } from './logger.js';
|
|
20
13
|
import { type ServerSharedServicesMinimal } from '../shared-services.js';
|
|
21
14
|
|
|
@@ -29,18 +22,8 @@ export interface LangiumProfilerOptions extends LogNameOptions {
|
|
|
29
22
|
* {@link DefaultLangiumProfiler}) to Langium's full set when omitted.
|
|
30
23
|
*/
|
|
31
24
|
readonly activeCategories?: Set<ProfilingCategory>;
|
|
32
|
-
/**
|
|
33
|
-
* Priority of the per-build flush pass at the `Validated` phase. The flush is
|
|
34
|
-
* normally the only pass at `Validated`, so order is immaterial; the option
|
|
35
|
-
* exists for symmetry with the other framework passes. Default
|
|
36
|
-
* {@link PROFILER_FLUSH_PASS_PRIORITY}.
|
|
37
|
-
*/
|
|
38
|
-
readonly flushPriority?: number;
|
|
39
25
|
}
|
|
40
26
|
|
|
41
|
-
/** Default priority of the profiler's per-build flush pass (see {@link LangiumProfilerOptions.flushPriority}). */
|
|
42
|
-
export const PROFILER_FLUSH_PASS_PRIORITY = 0;
|
|
43
|
-
|
|
44
27
|
/**
|
|
45
28
|
* Framework adapter over Langium's {@link DefaultLangiumProfiler} that is
|
|
46
29
|
* **trace-gated** and emits a single **aggregated** per-category breakdown
|
|
@@ -54,9 +37,8 @@ export const PROFILER_FLUSH_PASS_PRIORITY = 0;
|
|
|
54
37
|
* task identifier), so the per-document records carry no distinguishing
|
|
55
38
|
* information anyway. We instead accumulate records in {@link records} and
|
|
56
39
|
* {@link flush} one breakdown per category — self-time and invocation counts
|
|
57
|
-
* summed per `$type` across the whole build —
|
|
58
|
-
*
|
|
59
|
-
* one per file.
|
|
40
|
+
* summed per `$type` across the whole build — when the build ends
|
|
41
|
+
* (subscribed in the constructor). One report per build, not one per file.
|
|
60
42
|
* - **Transport safety.** The stock per-record dump uses `console.table`, which
|
|
61
43
|
* is NOT in the set `patchConsole` reroutes; under `vscode-languageserver`'s
|
|
62
44
|
* `--stdio` transport `process.stdout` *is* the JSON-RPC channel, so the
|
|
@@ -74,8 +56,8 @@ export const PROFILER_FLUSH_PASS_PRIORITY = 0;
|
|
|
74
56
|
* restart. Langium's own `start`/`stop` category selection still applies *on
|
|
75
57
|
* top of* the trace gate.
|
|
76
58
|
*
|
|
77
|
-
* Registered eagerly (see `DEFAULT_EAGER_SERVICES`) so its
|
|
78
|
-
*
|
|
59
|
+
* Registered eagerly (see `DEFAULT_EAGER_SERVICES`) so its flush is
|
|
60
|
+
* subscribed before the first build. Gives the per-grammar-rule /
|
|
79
61
|
* per-`$type` parse/link/validate self-time the framework's own
|
|
80
62
|
* `ServerTracer` / `ProfileSession` passes
|
|
81
63
|
* cannot produce (those cover the framework's passes *outside* Langium's
|
|
@@ -88,16 +70,11 @@ export class HydraniumLangiumProfiler extends DefaultLangiumProfiler {
|
|
|
88
70
|
constructor(services: ServerSharedServicesMinimal, options: LangiumProfilerOptions = {}) {
|
|
89
71
|
super(options.activeCategories);
|
|
90
72
|
this.tracer = services.Tracer.for(options.logName ?? 'LangiumProfiler').trace('instantiated');
|
|
91
|
-
// Flush once per build
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
services.workspace.
|
|
96
|
-
id: 'framework:langium-profiler:flush',
|
|
97
|
-
state: DocumentState.Validated,
|
|
98
|
-
priority: options.flushPriority ?? PROFILER_FLUSH_PASS_PRIORITY,
|
|
99
|
-
run: () => this.flush()
|
|
100
|
-
});
|
|
73
|
+
// Flush once per build when it ends rather than once per document. Not at
|
|
74
|
+
// a `Validated` pass: that phase stays silent for a build that validates
|
|
75
|
+
// nothing, the workspace's initial one among them, and the records would
|
|
76
|
+
// then wait for a build that does.
|
|
77
|
+
services.workspace.DocumentBuilder.onBuildEnded(() => this.flush());
|
|
101
78
|
}
|
|
102
79
|
|
|
103
80
|
/**
|
|
@@ -142,14 +119,13 @@ export class HydraniumLangiumProfiler extends DefaultLangiumProfiler {
|
|
|
142
119
|
/**
|
|
143
120
|
* Emit one aggregated breakdown per category — self-time and invocation
|
|
144
121
|
* counts summed per `<languageId>.<$type>` across every record collected
|
|
145
|
-
* this build — then clear the window.
|
|
146
|
-
*
|
|
147
|
-
*
|
|
122
|
+
* this build — then clear the window. Called when a build ends, so it fires
|
|
123
|
+
* once per build, not per document. Pass explicit categories to flush a
|
|
124
|
+
* subset; defaults to all.
|
|
148
125
|
*
|
|
149
126
|
* `flush` is the sole reset point: because it clears each flushed category,
|
|
150
|
-
* memory is bounded per
|
|
151
|
-
*
|
|
152
|
-
* inflated counts, self-correcting) rather than accumulating without bound.
|
|
127
|
+
* memory is bounded per build. Builds that throw share one flush, once the
|
|
128
|
+
* lock has drained after them.
|
|
153
129
|
*/
|
|
154
130
|
flush(...categories: ProfilingCategory[]): void {
|
|
155
131
|
const toFlush = categories.length > 0 ? categories : ALL_CATEGORIES;
|
|
@@ -139,6 +139,16 @@ export interface WaitUntilOptions {
|
|
|
139
139
|
readonly rejectWhenStuck?: boolean;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
/** What {@link HydraniumDocumentBuilder.onBuildEnded} tells a listener. */
|
|
143
|
+
export interface BuildEndedEvent {
|
|
144
|
+
/**
|
|
145
|
+
* `true` once a build ran every phase, validating or not; `false` once the
|
|
146
|
+
* lock has drained after builds that threw, cancelled or failed, which
|
|
147
|
+
* share one event.
|
|
148
|
+
*/
|
|
149
|
+
readonly completed: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
142
152
|
/**
|
|
143
153
|
* One locked build {@link HydraniumDocumentBuilder.scheduleUpdate} queued,
|
|
144
154
|
* which later requests merge into while it waits and join while it runs.
|
|
@@ -261,7 +271,7 @@ export class HydraniumDocumentBuilder extends DefaultDocumentBuilder {
|
|
|
261
271
|
/** Registered through {@link onDocumentPhaseDelivered}, by phase. */
|
|
262
272
|
protected readonly documentPhaseDeliveredListeners = new MultiMap<DocumentState, (document: LangiumDocument, version: number) => void>();
|
|
263
273
|
/** Registered through {@link onBuildEnded}. */
|
|
264
|
-
protected readonly buildEndedListeners = new Set<(
|
|
274
|
+
protected readonly buildEndedListeners = new Set<(event: BuildEndedEvent) => void>();
|
|
265
275
|
/** Set while the lock read {@link checkWaitsOnceDrained} queued has not run. */
|
|
266
276
|
protected drainCheckQueued = false;
|
|
267
277
|
/** Resolved per call: the sync service reaches this builder. */
|
|
@@ -326,19 +336,31 @@ export class HydraniumDocumentBuilder extends DefaultDocumentBuilder {
|
|
|
326
336
|
}
|
|
327
337
|
|
|
328
338
|
/**
|
|
329
|
-
* Call `listener`
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
* before that drain share one call, so this does not count builds.
|
|
333
|
-
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
339
|
+
* Call `listener` when a build ends: once it has run every phase, which
|
|
340
|
+
* Langium's `onBuildPhase` cannot tell for a build that validates nothing,
|
|
341
|
+
* and once the lock has drained after builds that threw. Builds that throw
|
|
342
|
+
* before that drain share one call, so this does not count builds.
|
|
343
|
+
*
|
|
344
|
+
* A listener runs synchronously, inside the build or inside the lock read
|
|
345
|
+
* that waits for the drain, so it must not wait on a build. One that
|
|
346
|
+
* throws is logged and skipped; the build and the other listeners go on.
|
|
336
347
|
*/
|
|
337
|
-
|
|
348
|
+
onBuildEnded(listener: (event: BuildEndedEvent) => void): Disposable {
|
|
338
349
|
this.buildEndedListeners.add(listener);
|
|
339
350
|
return Disposable.create(() => this.buildEndedListeners.delete(listener));
|
|
340
351
|
}
|
|
341
352
|
|
|
353
|
+
/** Tell every {@link buildEndedListeners} entry, each in isolation. */
|
|
354
|
+
protected notifyBuildEnded(event: BuildEndedEvent): void {
|
|
355
|
+
for (const listener of [...this.buildEndedListeners]) {
|
|
356
|
+
try {
|
|
357
|
+
listener(event);
|
|
358
|
+
} catch (error: unknown) {
|
|
359
|
+
this.tracer.error(`A build-ended listener failed: ${error instanceof Error ? (error.stack ?? error.message) : String(error)}`);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
342
364
|
/**
|
|
343
365
|
* Diagnostic snapshot for use in timeout/error messages around document
|
|
344
366
|
* state.
|
|
@@ -524,15 +546,15 @@ export class HydraniumDocumentBuilder extends DefaultDocumentBuilder {
|
|
|
524
546
|
}, 'awaitDocumentState.skipsValidation')
|
|
525
547
|
)
|
|
526
548
|
: Disposable.create(() => undefined);
|
|
527
|
-
const buildEnded = (
|
|
549
|
+
const buildEnded = ({ completed }: BuildEndedEvent): void => {
|
|
528
550
|
if (document.state >= state || (state === DocumentState.Validated && this.skipsValidation(document))) {
|
|
529
551
|
cleanup();
|
|
530
552
|
resolve(uri);
|
|
531
|
-
} else if (
|
|
553
|
+
} else if (completed ? this.isOrphaned(document, state) : this.activeSession === undefined) {
|
|
532
554
|
// No build is left to carry the document to `state`. Either
|
|
533
555
|
// check fails only while an unlocked build still runs; that
|
|
534
556
|
// build carries the document or ends here too.
|
|
535
|
-
requeue(
|
|
557
|
+
requeue(completed ? 'build ended short of the target' : 'build ended early');
|
|
536
558
|
}
|
|
537
559
|
};
|
|
538
560
|
const buildDisposable = this.onBuildEnded(buildEnded);
|
|
@@ -784,14 +806,12 @@ export class HydraniumDocumentBuilder extends DefaultDocumentBuilder {
|
|
|
784
806
|
cancelToken: CancellationToken
|
|
785
807
|
): Promise<void> {
|
|
786
808
|
await super.buildDocuments(documents, options, cancelToken);
|
|
787
|
-
|
|
788
|
-
listener(false);
|
|
789
|
-
}
|
|
809
|
+
this.notifyBuildEnded({ completed: true });
|
|
790
810
|
}
|
|
791
811
|
|
|
792
812
|
/**
|
|
793
813
|
* After a build that threw, tell the {@link buildEndedListeners}, with
|
|
794
|
-
* `
|
|
814
|
+
* `completed` false, from a {@link WorkspaceLock} read: it runs once no write
|
|
795
815
|
* runs or is queued, so no locked build is left that could still carry a
|
|
796
816
|
* waited-on document. A cancelled build is usually followed by its
|
|
797
817
|
* canceller's, but a write that builds nothing, such as a release build
|
|
@@ -806,9 +826,7 @@ export class HydraniumDocumentBuilder extends DefaultDocumentBuilder {
|
|
|
806
826
|
this.drainCheckQueued = true;
|
|
807
827
|
void this.workspaceLock.read(() => {
|
|
808
828
|
this.drainCheckQueued = false;
|
|
809
|
-
|
|
810
|
-
listener(true);
|
|
811
|
-
}
|
|
829
|
+
this.notifyBuildEnded({ completed: false });
|
|
812
830
|
});
|
|
813
831
|
}
|
|
814
832
|
|
|
@@ -157,9 +157,7 @@ export class DefaultIntegrityService<TRoot extends AstNode = AstNode> implements
|
|
|
157
157
|
protected readonly tracer: Tracer;
|
|
158
158
|
/**
|
|
159
159
|
* The framework document builder, used to re-parse + re-link a document in place after a
|
|
160
|
-
* Linked-phase correction (see {@link resyncDocument}).
|
|
161
|
-
* `shared.workspace.DocumentBuilder` to {@link HydraniumDocumentBuilder}; the narrowing
|
|
162
|
-
* cast surfaces its single-document phase runner.
|
|
160
|
+
* Linked-phase correction (see {@link resyncDocument}).
|
|
163
161
|
*/
|
|
164
162
|
protected readonly documentBuilder: HydraniumDocumentBuilder;
|
|
165
163
|
|
|
@@ -170,7 +168,7 @@ export class DefaultIntegrityService<TRoot extends AstNode = AstNode> implements
|
|
|
170
168
|
this.textDocuments = services.shared.workspace.TextDocuments;
|
|
171
169
|
this.fileSystemProvider = services.shared.workspace.FileSystemProvider;
|
|
172
170
|
this.tracer = services.shared.Tracer.for(options.logName ?? 'Integrity').trace('instantiated');
|
|
173
|
-
this.documentBuilder = services.shared.workspace.DocumentBuilder
|
|
171
|
+
this.documentBuilder = services.shared.workspace.DocumentBuilder;
|
|
174
172
|
this.syncMode = options.syncMode ?? 'silent';
|
|
175
173
|
|
|
176
174
|
// Read the language's IntegrityRuleContribution group and let each
|
package/src/langium/module.ts
CHANGED
|
@@ -266,7 +266,7 @@ export interface ServerAddedSharedServices<
|
|
|
266
266
|
* `onBuildPhase` sibling of the per-node `AstExtensionService`
|
|
267
267
|
* (`onDocumentPhase`) and `IntegrityService`. {@link BuildPipelineIntegration}
|
|
268
268
|
* drives it from its phase listeners; the framework self-registers its
|
|
269
|
-
* integrity
|
|
269
|
+
* integrity and CST-residency passes into it, and adopters
|
|
270
270
|
* contribute via the shared {@link ServerAddedSharedServices.buildPhasePasses}
|
|
271
271
|
* group. A single priority space orders framework and adopter passes
|
|
272
272
|
* against one another deterministically.
|
|
@@ -581,7 +581,7 @@ export function createServerSharedModule(
|
|
|
581
581
|
},
|
|
582
582
|
// Empty default so `services.buildPhasePasses` always resolves (Langium
|
|
583
583
|
// throws on access to an unbound slot). The framework's own integrity /
|
|
584
|
-
//
|
|
584
|
+
// CST-residency passes self-register imperatively, not here.
|
|
585
585
|
buildPhasePasses: {},
|
|
586
586
|
// Empty default so `services.additionalDocuments` always resolves.
|
|
587
587
|
additionalDocuments: {},
|
|
@@ -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
|
+
}
|
|
@@ -39,8 +39,9 @@ import { type LogNameOptions } from '../diagnostics/logger.js';
|
|
|
39
39
|
import { type HydraniumLanguageServices } from '../language-module.js';
|
|
40
40
|
import { type NameProvider } from '../naming/name-provider.js';
|
|
41
41
|
import { type HydraniumDocumentRegistry } from '../workspace/langium-documents.js';
|
|
42
|
+
import { FallbackScope } from './fallback-scope.js';
|
|
42
43
|
import { type ScopeExtensionService } from './scope-extension-service.js';
|
|
43
|
-
import { isTieredDescription } from './scoped-ast-node-description.js';
|
|
44
|
+
import { type TieredAstNodeDescription, isTieredDescription } from './scoped-ast-node-description.js';
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* Construction-time options for {@link HydraniumScopeProvider}. Extends
|
|
@@ -214,8 +215,9 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
214
215
|
*/
|
|
215
216
|
protected override getGlobalScope(referenceType: string, context: ReferenceInfo): Scope {
|
|
216
217
|
const projectChain = this.createGlobalScope(referenceType, context);
|
|
217
|
-
const
|
|
218
|
-
|
|
218
|
+
const extensions = this.scopeExtensionService.getDescriptions(referenceType, context.container);
|
|
219
|
+
const withUniversal = this.layerUniversalExtension(extensions.universal, projectChain, referenceType, context);
|
|
220
|
+
return this.layerLocalExtension(extensions.local, withUniversal, referenceType, context);
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
/**
|
|
@@ -250,22 +252,32 @@ export class HydraniumScopeProvider extends DefaultScopeProvider {
|
|
|
250
252
|
}
|
|
251
253
|
|
|
252
254
|
/**
|
|
253
|
-
* Layer scope
|
|
254
|
-
* Returns `inner` unchanged when
|
|
255
|
-
*
|
|
255
|
+
* Layer the scope extensions' `local`-tier `descriptions` on top of
|
|
256
|
+
* `inner`, through {@link createScope}. Returns `inner` unchanged when there
|
|
257
|
+
* are none.
|
|
256
258
|
*/
|
|
257
|
-
protected layerLocalExtension(
|
|
258
|
-
|
|
259
|
+
protected layerLocalExtension(
|
|
260
|
+
descriptions: readonly TieredAstNodeDescription[],
|
|
261
|
+
inner: Scope,
|
|
262
|
+
_referenceType: string,
|
|
263
|
+
_context: ReferenceInfo
|
|
264
|
+
): Scope {
|
|
265
|
+
return descriptions.length === 0 ? inner : this.createScope(descriptions, inner);
|
|
259
266
|
}
|
|
260
267
|
|
|
261
268
|
/**
|
|
262
|
-
* Layer scope
|
|
263
|
-
*
|
|
264
|
-
* `inner`
|
|
265
|
-
*
|
|
269
|
+
* Layer the scope extensions' `universal`-tier `descriptions` below
|
|
270
|
+
* `inner`, which shadows them, through {@link createScope} and a
|
|
271
|
+
* {@link FallbackScope}, so `inner` keeps its own lookup. Returns `inner`
|
|
272
|
+
* unchanged when there are none.
|
|
266
273
|
*/
|
|
267
|
-
protected layerUniversalExtension(
|
|
268
|
-
|
|
274
|
+
protected layerUniversalExtension(
|
|
275
|
+
descriptions: readonly TieredAstNodeDescription[],
|
|
276
|
+
inner: Scope,
|
|
277
|
+
_referenceType: string,
|
|
278
|
+
_context: ReferenceInfo
|
|
279
|
+
): Scope {
|
|
280
|
+
return descriptions.length === 0 ? inner : new FallbackScope(inner, this.createScope(descriptions));
|
|
269
281
|
}
|
|
270
282
|
|
|
271
283
|
/**
|
|
@@ -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';
|
|
@@ -102,9 +102,9 @@ export interface ResolvedCandidate {
|
|
|
102
102
|
export interface ReferenceCandidateProvider {
|
|
103
103
|
/**
|
|
104
104
|
* UI-facing entry point: returns the candidate scope's elements as
|
|
105
|
-
* {@link ReferenceCandidate}s.
|
|
105
|
+
* {@link ReferenceCandidate}s. Accepts what {@link getCandidateScope} does.
|
|
106
106
|
*/
|
|
107
|
-
find(ctx: ReferenceContext): ReferenceCandidate[];
|
|
107
|
+
find(ctx: ReferenceContext | ReferenceInfo): ReferenceCandidate[];
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Build a ranked + deduped scope for candidate selection at the
|
|
@@ -202,7 +202,7 @@ export class DefaultReferenceCandidateProvider implements ReferenceCandidateProv
|
|
|
202
202
|
return this.services.shared.ServiceRegistry?.getServicesFor(target)?.references.NameProvider ?? this.nameProvider;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
find(ctx: ReferenceContext): ReferenceCandidate[] {
|
|
205
|
+
find(ctx: ReferenceContext | ReferenceInfo): ReferenceCandidate[] {
|
|
206
206
|
const scope = this.getCandidateScope(ctx);
|
|
207
207
|
return scope.elementScope
|
|
208
208
|
.getAllElements()
|