@hydranium/core 1.0.0-next.223 → 1.0.0-next.225

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 CHANGED
@@ -94,9 +94,10 @@ boundary and the registration-contribution pattern the services follow are in
94
94
 
95
95
  ## Status
96
96
 
97
- Alpha — pre-v0, not yet published. The API is not stable and may change without a
98
- deprecation cycle. See the [repository README](../../README.md) for the current
99
- status and known limitations.
97
+ Alpha — pre-v0, published nightly as `1.0.0-next` prereleases. The API is not
98
+ stable and may change without a deprecation cycle. See the
99
+ [repository README](../../README.md) for the current status and known
100
+ limitations.
100
101
 
101
102
  For task-shaped adoption paths, start with the [validation check guide](../../docs/guides/add-validation-check.md). It shows the validation contribution boundary that this package supplies.
102
103
 
package/lib/index.d.ts CHANGED
@@ -34,6 +34,7 @@ export * from './langium/workspace/index.js';
34
34
  export * from './langium/service-registry.js';
35
35
  export * from './langium/language-types.js';
36
36
  export * from './langium/composite-ast-reflection.js';
37
+ export * from './langium/single-langium-copy.js';
37
38
  export * from './launcher/index.js';
38
39
  export * from './locale/index.js';
39
40
  export * from './messages/renderer.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAA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BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAIlC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
package/lib/index.js CHANGED
@@ -35,6 +35,7 @@ export * from './langium/workspace/index.js';
35
35
  export * from './langium/service-registry.js';
36
36
  export * from './langium/language-types.js';
37
37
  export * from './langium/composite-ast-reflection.js';
38
+ export * from './langium/single-langium-copy.js';
38
39
  export * from './launcher/index.js';
39
40
  export * from './locale/index.js';
40
41
  // The renderer only. The `./messages` subpath additionally enumerates this
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,0DAA0D;AAC1D,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAA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qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,2EAA2E;AAC3E,+EAA+E;AAC/E,+BAA+B;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
@@ -96,30 +96,33 @@ export declare const DEFAULT_EAGER_SERVICES: ReadonlyArray<(services: ServerShar
96
96
  * discarded.
97
97
  *
98
98
  * Bootstrap responsibilities, in order:
99
- * 1. Hand the shared services to `shared.ServiceRegistry` if it accepts
99
+ * 1. {@link assertSingleLangiumCopy} — fail fast when the shared
100
+ * `AstReflection` is built on a second copy of `langium`, before any
101
+ * later check can fail first and name the wrong cause.
102
+ * 2. Hand the shared services to `shared.ServiceRegistry` if it accepts
100
103
  * them after construction, so Langium's declared-languageId lookup
101
104
  * rung works however the adopter's registry binding was built.
102
- * 2. {@link assertDistinctFileRouting} — before registration, because
105
+ * 3. {@link assertDistinctFileRouting} — before registration, because
103
106
  * `register` resolves a routing collision by last-wins and afterwards
104
107
  * the evidence is gone.
105
- * 3. Register `language` against `shared.ServiceRegistry`, the
108
+ * 4. Register `language` against `shared.ServiceRegistry`, the
106
109
  * required final step of any Langium DI bootstrap. Done before slot
107
110
  * validation so subclassed registries (typed-accessor extensions)
108
111
  * populate any side state before validation walks construct services
109
112
  * that read from the registry.
110
- * 4. {@link assertCoreSlotsBound} — fail fast if the consumer's
113
+ * 5. {@link assertCoreSlotsBound} — fail fast if the consumer's
111
114
  * `inject(...)` composition is missing a `@hydranium/core` module. May
112
115
  * trigger lazy service construction as side effect of walking the
113
116
  * slots; that construction expects a populated `ServiceRegistry`,
114
117
  * hence the order.
115
- * 5. {@link warnOnUnexpectedBindings} — opt-in (gated by
118
+ * 6. {@link warnOnUnexpectedBindings} — opt-in (gated by
116
119
  * {@link STRICT_BINDINGS_ENV}); warns when a framework slot is bound
117
120
  * to a non-subclass of its framework base. No-op unless the env is set.
118
- * 6. {@link assertReflectionCoversLanguages} — catch a clobbered shared
121
+ * 7. {@link assertReflectionCoversLanguages} — catch a clobbered shared
119
122
  * `AstReflection` before it starts silently answering `isSubtype`
120
123
  * false for a registered language's types. Skipped here, since a lone
121
124
  * language has no sibling that could clobber it.
122
- * 7. Invoke eager-construction accessors in array order.
125
+ * 8. Invoke eager-construction accessors in array order.
123
126
  *
124
127
  * Multi-grammar adopters use {@link bootstrapLangiumLanguages}, which
125
128
  * registers every language before validating slots or constructing the
@@ -139,16 +142,20 @@ export declare function bootstrapLangium<TShared extends LangiumSharedServices &
139
142
  * ORDER across languages is what makes this a distinct function rather
140
143
  * than a loop the caller could write:
141
144
  *
142
- * 1. **Every** language is registered against `shared.ServiceRegistry`
143
- * first. Slot validation and eager construction both build services
145
+ * 1. {@link assertSingleLangiumCopy} runs **once**, before anything else,
146
+ * since every language shares the one `AstReflection`.
147
+ * 2. **Every** language is registered against `shared.ServiceRegistry`
148
+ * next. Slot validation and eager construction both build services
144
149
  * that read the registry — a per-language
145
150
  * register-then-validate-then-eager loop would run them while later
146
151
  * languages were still missing, so a shared service that walks
147
152
  * `ServiceRegistry.all` (or resolves by extension) would see a
148
153
  * half-populated registry and cache the wrong answer.
149
- * 2. `assertCoreSlotsBound` / `warnOnUnexpectedBindings` per language —
154
+ * 3. `assertCoreSlotsBound` / `warnOnUnexpectedBindings` per language —
150
155
  * each language composes its own module chain, so each is checked.
151
- * 3. Eager accessors run **once**, after all registrations. They take
156
+ * 4. {@link assertReflectionCoversLanguages} runs **once**, on the one
157
+ * shared `AstReflection`.
158
+ * 5. Eager accessors run **once**, after all registrations. They take
152
159
  * the shared tier, and the framework's eager set is shared-tier only
153
160
  * (`ProjectManager`, `BuildPipelineIntegration`, `LangiumProfiler`,
154
161
  * `CstResidencyService`) — `BuildPipelineIntegration` in particular
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../src/langium/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,EAAE,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AAK,EACf,0BAA0B,GAAE,aAAa,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,CAA0B,GAClG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAA;CAAE,CAGtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,yBAAyB,CACtC,OAAO,SAAS,qBAAqB,GAAG,2BAA2B,EACnE,KAAK,SAAS,eAAe,EAE7B,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,EAC/B,0BAA0B,GAAE,aAAa,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,OAAO,CAA0B,GAClG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;CAAE,CAsCtD;AAYD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,aAAa,CAAC,eAAe,CAAC,GAAG,IAAI,CA+BzF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,qBAAqB,EAAE,SAAS,EAAE,aAAa,CAAC,eAAe,CAAC,GAAG,IAAI,CAkC9H"}
@@ -7,6 +7,7 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  import { collectProducibleTypes } from './language-types.js';
10
+ import { assertSingleLangiumCopy } from './single-langium-copy.js';
10
11
  import { DefaultAstDocumentManager } from '../documents/ast-document-manager.js';
11
12
  import { HydraniumTextDocuments } from '../documents/hydranium-text-documents.js';
12
13
  import { DefaultBuildPipelineIntegration } from './document-builder/build-pipeline-integration.js';
@@ -291,30 +292,33 @@ export const DEFAULT_EAGER_SERVICES = [
291
292
  * discarded.
292
293
  *
293
294
  * Bootstrap responsibilities, in order:
294
- * 1. Hand the shared services to `shared.ServiceRegistry` if it accepts
295
+ * 1. {@link assertSingleLangiumCopy} — fail fast when the shared
296
+ * `AstReflection` is built on a second copy of `langium`, before any
297
+ * later check can fail first and name the wrong cause.
298
+ * 2. Hand the shared services to `shared.ServiceRegistry` if it accepts
295
299
  * them after construction, so Langium's declared-languageId lookup
296
300
  * rung works however the adopter's registry binding was built.
297
- * 2. {@link assertDistinctFileRouting} — before registration, because
301
+ * 3. {@link assertDistinctFileRouting} — before registration, because
298
302
  * `register` resolves a routing collision by last-wins and afterwards
299
303
  * the evidence is gone.
300
- * 3. Register `language` against `shared.ServiceRegistry`, the
304
+ * 4. Register `language` against `shared.ServiceRegistry`, the
301
305
  * required final step of any Langium DI bootstrap. Done before slot
302
306
  * validation so subclassed registries (typed-accessor extensions)
303
307
  * populate any side state before validation walks construct services
304
308
  * that read from the registry.
305
- * 4. {@link assertCoreSlotsBound} — fail fast if the consumer's
309
+ * 5. {@link assertCoreSlotsBound} — fail fast if the consumer's
306
310
  * `inject(...)` composition is missing a `@hydranium/core` module. May
307
311
  * trigger lazy service construction as side effect of walking the
308
312
  * slots; that construction expects a populated `ServiceRegistry`,
309
313
  * hence the order.
310
- * 5. {@link warnOnUnexpectedBindings} — opt-in (gated by
314
+ * 6. {@link warnOnUnexpectedBindings} — opt-in (gated by
311
315
  * {@link STRICT_BINDINGS_ENV}); warns when a framework slot is bound
312
316
  * to a non-subclass of its framework base. No-op unless the env is set.
313
- * 6. {@link assertReflectionCoversLanguages} — catch a clobbered shared
317
+ * 7. {@link assertReflectionCoversLanguages} — catch a clobbered shared
314
318
  * `AstReflection` before it starts silently answering `isSubtype`
315
319
  * false for a registered language's types. Skipped here, since a lone
316
320
  * language has no sibling that could clobber it.
317
- * 7. Invoke eager-construction accessors in array order.
321
+ * 8. Invoke eager-construction accessors in array order.
318
322
  *
319
323
  * Multi-grammar adopters use {@link bootstrapLangiumLanguages}, which
320
324
  * registers every language before validating slots or constructing the
@@ -334,16 +338,20 @@ export function bootstrapLangium(shared, language, eagerlyConstructedServices =
334
338
  * ORDER across languages is what makes this a distinct function rather
335
339
  * than a loop the caller could write:
336
340
  *
337
- * 1. **Every** language is registered against `shared.ServiceRegistry`
338
- * first. Slot validation and eager construction both build services
341
+ * 1. {@link assertSingleLangiumCopy} runs **once**, before anything else,
342
+ * since every language shares the one `AstReflection`.
343
+ * 2. **Every** language is registered against `shared.ServiceRegistry`
344
+ * next. Slot validation and eager construction both build services
339
345
  * that read the registry — a per-language
340
346
  * register-then-validate-then-eager loop would run them while later
341
347
  * languages were still missing, so a shared service that walks
342
348
  * `ServiceRegistry.all` (or resolves by extension) would see a
343
349
  * half-populated registry and cache the wrong answer.
344
- * 2. `assertCoreSlotsBound` / `warnOnUnexpectedBindings` per language —
350
+ * 3. `assertCoreSlotsBound` / `warnOnUnexpectedBindings` per language —
345
351
  * each language composes its own module chain, so each is checked.
346
- * 3. Eager accessors run **once**, after all registrations. They take
352
+ * 4. {@link assertReflectionCoversLanguages} runs **once**, on the one
353
+ * shared `AstReflection`.
354
+ * 5. Eager accessors run **once**, after all registrations. They take
347
355
  * the shared tier, and the framework's eager set is shared-tier only
348
356
  * (`ProjectManager`, `BuildPipelineIntegration`, `LangiumProfiler`,
349
357
  * `CstResidencyService`) — `BuildPipelineIntegration` in particular
@@ -362,6 +370,11 @@ export function bootstrapLangiumLanguages(shared, languages, eagerlyConstructedS
362
370
  'registered language cannot validate its slots. Pass the language(s) produced by your ' +
363
371
  '`inject(...)` composition.');
364
372
  }
373
+ // First, because a second copy of `langium` can make a later check fail
374
+ // first and name the wrong cause.
375
+ if (shared.AstReflection) {
376
+ assertSingleLangiumCopy(shared.AstReflection);
377
+ }
365
378
  // Back-fill the shared services onto a registry that was constructed
366
379
  // without them, so Langium's declared-languageId lookup rung works no
367
380
  // matter how the adopter's `ServiceRegistry` binding built it. An adopter
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../src/langium/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF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AC,CAAC;IACxB,CAAC;SAAM,CAAC;QACL,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;AACJ,CAAC"}
@@ -24,6 +24,9 @@ import { AbstractAstReflection, type AstMetaData, type AstReflection, type Prope
24
24
  * is lost. Each package's generated `isX` guards keep using that package's own
25
25
  * reflection and answer false for subtypes only another package declares.
26
26
  *
27
+ * Each reflection is checked with {@link assertSingleLangiumCopy}, because the
28
+ * composite itself extends the framework copy's base whichever copy they use.
29
+ *
27
30
  * The protected merge methods run from the constructor, so an override cannot
28
31
  * read its own class's fields.
29
32
  */
@@ -33,8 +36,8 @@ export declare class CompositeAstReflection extends AbstractAstReflection {
33
36
  protected mergeTypeMetaData(known: TypeMetaData, added: TypeMetaData, knownFrom: string, addedFrom: string): TypeMetaData;
34
37
  protected sameProperty(left: PropertyMetaData, right: PropertyMetaData): boolean;
35
38
  /**
36
- * Names `reflections[index]` for the clash error: its position and class
37
- * name. The position is needed because minified bundles and scaffolds
39
+ * Names `reflections[index]` for the composite's errors: its position and
40
+ * class name. The position is needed because minified bundles and scaffolds
38
41
  * sharing a project name leave class names that do not tell reflections
39
42
  * apart. An override can name the package each reflection came from.
40
43
  */
@@ -1 +1 @@
1
- {"version":3,"file":"composite-ast-reflection.d.ts","sourceRoot":"","sources":["../../src/langium/composite-ast-reflection.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE3I;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,sBAAuB,SAAQ,qBAAqB;IAC9D,SAAkB,KAAK,EAAE,WAAW,CAAM;IAE1C,YAAY,WAAW,EAAE,SAAS,aAAa,EAAE,EAmBhD;IAED,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAuBxH;IAED,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAE/E;IAED;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvF;CACH"}
1
+ {"version":3,"file":"composite-ast-reflection.d.ts","sourceRoot":"","sources":["../../src/langium/composite-ast-reflection.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG3I;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,sBAAuB,SAAQ,qBAAqB;IAC9D,SAAkB,KAAK,EAAE,WAAW,CAAM;IAE1C,YAAY,WAAW,EAAE,SAAS,aAAa,EAAE,EAoBhD;IAED,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAuBxH;IAED,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAE/E;IAED;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvF;CACH"}
@@ -7,6 +7,7 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  import { AbstractAstReflection } from '@hydranium/langium';
10
+ import { assertSingleLangiumCopy } from './single-langium-copy.js';
10
11
  /**
11
12
  * One `AstReflection` over the reflections of separately generated language
12
13
  * packages. The shared `AstReflection` slot holds a single reflection, so
@@ -24,6 +25,9 @@ import { AbstractAstReflection } from '@hydranium/langium';
24
25
  * is lost. Each package's generated `isX` guards keep using that package's own
25
26
  * reflection and answer false for subtypes only another package declares.
26
27
  *
28
+ * Each reflection is checked with {@link assertSingleLangiumCopy}, because the
29
+ * composite itself extends the framework copy's base whichever copy they use.
30
+ *
27
31
  * The protected merge methods run from the constructor, so an override cannot
28
32
  * read its own class's fields.
29
33
  */
@@ -33,6 +37,7 @@ export class CompositeAstReflection extends AbstractAstReflection {
33
37
  super();
34
38
  const firstDefinedAt = new Map();
35
39
  reflections.forEach((reflection, index) => {
40
+ assertSingleLangiumCopy(reflection, () => this.formatReflection(reflections, index));
36
41
  for (const [type, metaData] of Object.entries(reflection.types)) {
37
42
  const ownerIndex = firstDefinedAt.get(type);
38
43
  if (ownerIndex === undefined) {
@@ -71,13 +76,13 @@ export class CompositeAstReflection extends AbstractAstReflection {
71
76
  return COMPARED_PROPERTY_FIELDS.every(field => JSON.stringify(left[field]) === JSON.stringify(right[field]));
72
77
  }
73
78
  /**
74
- * Names `reflections[index]` for the clash error: its position and class
75
- * name. The position is needed because minified bundles and scaffolds
79
+ * Names `reflections[index]` for the composite's errors: its position and
80
+ * class name. The position is needed because minified bundles and scaffolds
76
81
  * sharing a project name leave class names that do not tell reflections
77
82
  * apart. An override can name the package each reflection came from.
78
83
  */
79
84
  formatReflection(reflections, index) {
80
- return `reflections[${index}] (${reflections[index].constructor.name})`;
85
+ return `reflections[${index}] (${reflections[index].constructor?.name ?? 'no constructor'})`;
81
86
  }
82
87
  }
83
88
  /** How the merge treats each property field; a field Langium adds fails compilation here until decided. */
@@ -1 +1 @@
1
- {"version":3,"file":"composite-ast-reflection.js","sourceRoot":"","sources":["../../src/langium/composite-ast-reflection.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAkF,MAAM,oBAAoB,CAAC;AAE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C,GAAG,aAAa,CAAC,QAAQ,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC;QAC5G,CAAC;QACD,uFAAuF;QACvF,MAAM,MAAM,GAA2B;YACpC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,UAAU;YACV,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;SACtE,CAAC;QACF,OAAO,MAAM,CAAC;IACjB,CAAC;IAES,YAAY,CAAC,IAAsB,EAAE,KAAuB;QACnE,OAAO,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAChH,CAAC;IAED;;;;;OAKG;IACO,gBAAgB,CAAC,WAAqC,EAAE,KAAa;QAC5E,OAAO,eAAe,KAAK,MAAM,WAAW,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,IAAI,IAAI,gBAAgB,GAAG,CAAC;IAChG,CAAC;CACH;AAED,2GAA2G;AAC3G,MAAM,eAAe,GAAG;IACrB,IAAI,EAAE,UAAU;IAChB,aAAa,EAAE,UAAU;IACzB,YAAY,EAAE,UAAU;IACxB,sEAAsE;IACtE,QAAQ,EAAE,QAAQ;CACqD,CAAC;AAE3E,MAAM,wBAAwB,GAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAmC,CAAC,MAAM,CACpG,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,UAAU,CAChD,CAAC"}
@@ -0,0 +1,22 @@
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 AstReflection } from '@hydranium/langium';
10
+ /**
11
+ * Fail fast when `reflection` extends `AbstractAstReflection` from a second
12
+ * copy of `langium`, which the files `langium-cli` generates run on: a second
13
+ * install, or one install a bundler or test runner loads twice.
14
+ *
15
+ * A reflection whose prototype chain misses this copy's base is taken to come
16
+ * from another copy when it carries the `subtypes` and `allSubtypes` fields that
17
+ * base creates, which `AstReflection` does not declare. Fields rather than the
18
+ * class name, because bundlers and minifiers rename classes; a hand-written
19
+ * reflection passes unless it declares both fields itself.
20
+ */
21
+ export declare function assertSingleLangiumCopy(reflection: AstReflection, subject?: () => string): void;
22
+ //# sourceMappingURL=single-langium-copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-langium-copy.d.ts","sourceRoot":"","sources":["../../src/langium/single-langium-copy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAO/E;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACpC,UAAU,EAAE,aAAa,EACzB,OAAO,GAAE,MAAM,MAA+F,GAC9G,IAAI,CAaN"}
@@ -0,0 +1,36 @@
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 { AbstractAstReflection } from '@hydranium/langium';
10
+ /** The troubleshooting entry listing the causes; its heading is the anchor. */
11
+ const CAUSES_URL = 'https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/adopting/troubleshooting.md' +
12
+ '#startup-rejects-the-ast-reflection-or-a-cancelled-validation-reports-symboloperationcancelled';
13
+ /**
14
+ * Fail fast when `reflection` extends `AbstractAstReflection` from a second
15
+ * copy of `langium`, which the files `langium-cli` generates run on: a second
16
+ * install, or one install a bundler or test runner loads twice.
17
+ *
18
+ * A reflection whose prototype chain misses this copy's base is taken to come
19
+ * from another copy when it carries the `subtypes` and `allSubtypes` fields that
20
+ * base creates, which `AstReflection` does not declare. Fields rather than the
21
+ * class name, because bundlers and minifiers rename classes; a hand-written
22
+ * reflection passes unless it declares both fields itself.
23
+ */
24
+ export function assertSingleLangiumCopy(reflection, subject = () => `the shared AstReflection (${reflection.constructor?.name ?? 'no constructor'})`) {
25
+ if (reflection instanceof AbstractAstReflection) {
26
+ return;
27
+ }
28
+ if (Object.hasOwn(reflection, 'subtypes') && Object.hasOwn(reflection, 'allSubtypes')) {
29
+ throw new Error(`[hydranium] ${subject()} extends \`AbstractAstReflection\` from another instance of \`langium\` than ` +
30
+ 'the one `@hydranium/langium` loads, a second physical copy or one install loaded twice, so the generated ' +
31
+ 'code runs on one and the framework on the other. Values Langium compares by identity, such as its ' +
32
+ 'cancellation signal, are not recognised across the two. `npm explain langium` lists each installed copy ' +
33
+ `and what requires it. The causes and their remedies: ${CAUSES_URL}`);
34
+ }
35
+ }
36
+ //# sourceMappingURL=single-langium-copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-langium-copy.js","sourceRoot":"","sources":["../../src/langium/single-langium-copy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAsB,MAAM,oBAAoB,CAAC;AAE/E,+EAA+E;AAC/E,MAAM,UAAU,GACb,0FAA0F;IAC1F,gGAAgG,CAAC;AAEpG;;;;;;;;;;GAUG;AACH,MAAM,UAAU,uBAAuB,CACpC,UAAyB,EACzB,OAAO,GAAiB,GAAG,EAAE,CAAC,6BAA6B,UAAU,CAAC,WAAW,EAAE,IAAI,IAAI,gBAAgB,GAAG;IAE9G,IAAI,UAAU,YAAY,qBAAqB,EAAE,CAAC;QAC/C,OAAO;IACV,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,CAAC;QACrF,MAAM,IAAI,KAAK,CACZ,eAAe,OAAO,EAAE,+EAA+E;YACpG,2GAA2G;YAC3G,oGAAoG;YACpG,0GAA0G;YAC1G,wDAAwD,UAAU,EAAE,CACzE,CAAC;IACL,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hydranium/core",
3
- "version": "1.0.0-next.223",
3
+ "version": "1.0.0-next.225",
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.223",
87
- "@hydranium/protocol": "1.0.0-next.223",
86
+ "@hydranium/langium": "1.0.0-next.225",
87
+ "@hydranium/protocol": "1.0.0-next.225",
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.223",
100
- "@hydranium/protocol": "1.0.0-next.223",
99
+ "@hydranium/langium": "1.0.0-next.225",
100
+ "@hydranium/protocol": "1.0.0-next.225",
101
101
  "@playwright/test": "^1.40.0",
102
102
  "vscode-jsonrpc": "^9.0.0",
103
103
  "vscode-languageserver": "~10.0.1",
package/src/index.ts CHANGED
@@ -36,6 +36,7 @@ export * from './langium/workspace/index.js';
36
36
  export * from './langium/service-registry.js';
37
37
  export * from './langium/language-types.js';
38
38
  export * from './langium/composite-ast-reflection.js';
39
+ export * from './langium/single-langium-copy.js';
39
40
  export * from './launcher/index.js';
40
41
  export * from './locale/index.js';
41
42
  // The renderer only. The `./messages` subpath additionally enumerates this
@@ -12,6 +12,7 @@ import { type LangiumSharedCoreServices } from '@hydranium/langium';
12
12
  import { type LangiumServices, type LangiumSharedServices } from '@hydranium/langium/lsp';
13
13
  import type { ServerSharedServicesMinimal } from './shared-services.js';
14
14
  import { collectProducibleTypes } from './language-types.js';
15
+ import { assertSingleLangiumCopy } from './single-langium-copy.js';
15
16
  import { DefaultAstDocumentManager } from '../documents/ast-document-manager.js';
16
17
  import { HydraniumTextDocuments } from '../documents/hydranium-text-documents.js';
17
18
  import { DefaultBuildPipelineIntegration } from './document-builder/build-pipeline-integration.js';
@@ -352,30 +353,33 @@ export const DEFAULT_EAGER_SERVICES: ReadonlyArray<(services: ServerSharedServic
352
353
  * discarded.
353
354
  *
354
355
  * Bootstrap responsibilities, in order:
355
- * 1. Hand the shared services to `shared.ServiceRegistry` if it accepts
356
+ * 1. {@link assertSingleLangiumCopy} — fail fast when the shared
357
+ * `AstReflection` is built on a second copy of `langium`, before any
358
+ * later check can fail first and name the wrong cause.
359
+ * 2. Hand the shared services to `shared.ServiceRegistry` if it accepts
356
360
  * them after construction, so Langium's declared-languageId lookup
357
361
  * rung works however the adopter's registry binding was built.
358
- * 2. {@link assertDistinctFileRouting} — before registration, because
362
+ * 3. {@link assertDistinctFileRouting} — before registration, because
359
363
  * `register` resolves a routing collision by last-wins and afterwards
360
364
  * the evidence is gone.
361
- * 3. Register `language` against `shared.ServiceRegistry`, the
365
+ * 4. Register `language` against `shared.ServiceRegistry`, the
362
366
  * required final step of any Langium DI bootstrap. Done before slot
363
367
  * validation so subclassed registries (typed-accessor extensions)
364
368
  * populate any side state before validation walks construct services
365
369
  * that read from the registry.
366
- * 4. {@link assertCoreSlotsBound} — fail fast if the consumer's
370
+ * 5. {@link assertCoreSlotsBound} — fail fast if the consumer's
367
371
  * `inject(...)` composition is missing a `@hydranium/core` module. May
368
372
  * trigger lazy service construction as side effect of walking the
369
373
  * slots; that construction expects a populated `ServiceRegistry`,
370
374
  * hence the order.
371
- * 5. {@link warnOnUnexpectedBindings} — opt-in (gated by
375
+ * 6. {@link warnOnUnexpectedBindings} — opt-in (gated by
372
376
  * {@link STRICT_BINDINGS_ENV}); warns when a framework slot is bound
373
377
  * to a non-subclass of its framework base. No-op unless the env is set.
374
- * 6. {@link assertReflectionCoversLanguages} — catch a clobbered shared
378
+ * 7. {@link assertReflectionCoversLanguages} — catch a clobbered shared
375
379
  * `AstReflection` before it starts silently answering `isSubtype`
376
380
  * false for a registered language's types. Skipped here, since a lone
377
381
  * language has no sibling that could clobber it.
378
- * 7. Invoke eager-construction accessors in array order.
382
+ * 8. Invoke eager-construction accessors in array order.
379
383
  *
380
384
  * Multi-grammar adopters use {@link bootstrapLangiumLanguages}, which
381
385
  * registers every language before validating slots or constructing the
@@ -400,16 +404,20 @@ export function bootstrapLangium<TShared extends LangiumSharedServices & ServerS
400
404
  * ORDER across languages is what makes this a distinct function rather
401
405
  * than a loop the caller could write:
402
406
  *
403
- * 1. **Every** language is registered against `shared.ServiceRegistry`
404
- * first. Slot validation and eager construction both build services
407
+ * 1. {@link assertSingleLangiumCopy} runs **once**, before anything else,
408
+ * since every language shares the one `AstReflection`.
409
+ * 2. **Every** language is registered against `shared.ServiceRegistry`
410
+ * next. Slot validation and eager construction both build services
405
411
  * that read the registry — a per-language
406
412
  * register-then-validate-then-eager loop would run them while later
407
413
  * languages were still missing, so a shared service that walks
408
414
  * `ServiceRegistry.all` (or resolves by extension) would see a
409
415
  * half-populated registry and cache the wrong answer.
410
- * 2. `assertCoreSlotsBound` / `warnOnUnexpectedBindings` per language —
416
+ * 3. `assertCoreSlotsBound` / `warnOnUnexpectedBindings` per language —
411
417
  * each language composes its own module chain, so each is checked.
412
- * 3. Eager accessors run **once**, after all registrations. They take
418
+ * 4. {@link assertReflectionCoversLanguages} runs **once**, on the one
419
+ * shared `AstReflection`.
420
+ * 5. Eager accessors run **once**, after all registrations. They take
413
421
  * the shared tier, and the framework's eager set is shared-tier only
414
422
  * (`ProjectManager`, `BuildPipelineIntegration`, `LangiumProfiler`,
415
423
  * `CstResidencyService`) — `BuildPipelineIntegration` in particular
@@ -437,6 +445,11 @@ export function bootstrapLangiumLanguages<
437
445
  '`inject(...)` composition.'
438
446
  );
439
447
  }
448
+ // First, because a second copy of `langium` can make a later check fail
449
+ // first and name the wrong cause.
450
+ if (shared.AstReflection) {
451
+ assertSingleLangiumCopy(shared.AstReflection);
452
+ }
440
453
  // Back-fill the shared services onto a registry that was constructed
441
454
  // without them, so Langium's declared-languageId lookup rung works no
442
455
  // matter how the adopter's `ServiceRegistry` binding built it. An adopter
@@ -8,6 +8,7 @@
8
8
  ********************************************************************************/
9
9
 
10
10
  import { AbstractAstReflection, type AstMetaData, type AstReflection, type PropertyMetaData, type TypeMetaData } from '@hydranium/langium';
11
+ import { assertSingleLangiumCopy } from './single-langium-copy.js';
11
12
 
12
13
  /**
13
14
  * One `AstReflection` over the reflections of separately generated language
@@ -26,6 +27,9 @@ import { AbstractAstReflection, type AstMetaData, type AstReflection, type Prope
26
27
  * is lost. Each package's generated `isX` guards keep using that package's own
27
28
  * reflection and answer false for subtypes only another package declares.
28
29
  *
30
+ * Each reflection is checked with {@link assertSingleLangiumCopy}, because the
31
+ * composite itself extends the framework copy's base whichever copy they use.
32
+ *
29
33
  * The protected merge methods run from the constructor, so an override cannot
30
34
  * read its own class's fields.
31
35
  */
@@ -36,6 +40,7 @@ export class CompositeAstReflection extends AbstractAstReflection {
36
40
  super();
37
41
  const firstDefinedAt = new Map<string, number>();
38
42
  reflections.forEach((reflection, index) => {
43
+ assertSingleLangiumCopy(reflection, () => this.formatReflection(reflections, index));
39
44
  for (const [type, metaData] of Object.entries(reflection.types)) {
40
45
  const ownerIndex = firstDefinedAt.get(type);
41
46
  if (ownerIndex === undefined) {
@@ -83,13 +88,13 @@ export class CompositeAstReflection extends AbstractAstReflection {
83
88
  }
84
89
 
85
90
  /**
86
- * Names `reflections[index]` for the clash error: its position and class
87
- * name. The position is needed because minified bundles and scaffolds
91
+ * Names `reflections[index]` for the composite's errors: its position and
92
+ * class name. The position is needed because minified bundles and scaffolds
88
93
  * sharing a project name leave class names that do not tell reflections
89
94
  * apart. An override can name the package each reflection came from.
90
95
  */
91
96
  protected formatReflection(reflections: readonly AstReflection[], index: number): string {
92
- return `reflections[${index}] (${reflections[index].constructor.name})`;
97
+ return `reflections[${index}] (${reflections[index].constructor?.name ?? 'no constructor'})`;
93
98
  }
94
99
  }
95
100
 
@@ -0,0 +1,44 @@
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 { AbstractAstReflection, type AstReflection } from '@hydranium/langium';
11
+
12
+ /** The troubleshooting entry listing the causes; its heading is the anchor. */
13
+ const CAUSES_URL =
14
+ 'https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/adopting/troubleshooting.md' +
15
+ '#startup-rejects-the-ast-reflection-or-a-cancelled-validation-reports-symboloperationcancelled';
16
+
17
+ /**
18
+ * Fail fast when `reflection` extends `AbstractAstReflection` from a second
19
+ * copy of `langium`, which the files `langium-cli` generates run on: a second
20
+ * install, or one install a bundler or test runner loads twice.
21
+ *
22
+ * A reflection whose prototype chain misses this copy's base is taken to come
23
+ * from another copy when it carries the `subtypes` and `allSubtypes` fields that
24
+ * base creates, which `AstReflection` does not declare. Fields rather than the
25
+ * class name, because bundlers and minifiers rename classes; a hand-written
26
+ * reflection passes unless it declares both fields itself.
27
+ */
28
+ export function assertSingleLangiumCopy(
29
+ reflection: AstReflection,
30
+ subject: () => string = () => `the shared AstReflection (${reflection.constructor?.name ?? 'no constructor'})`
31
+ ): void {
32
+ if (reflection instanceof AbstractAstReflection) {
33
+ return;
34
+ }
35
+ if (Object.hasOwn(reflection, 'subtypes') && Object.hasOwn(reflection, 'allSubtypes')) {
36
+ throw new Error(
37
+ `[hydranium] ${subject()} extends \`AbstractAstReflection\` from another instance of \`langium\` than ` +
38
+ 'the one `@hydranium/langium` loads, a second physical copy or one install loaded twice, so the generated ' +
39
+ 'code runs on one and the framework on the other. Values Langium compares by identity, such as its ' +
40
+ 'cancellation signal, are not recognised across the two. `npm explain langium` lists each installed copy ' +
41
+ `and what requires it. The causes and their remedies: ${CAUSES_URL}`
42
+ );
43
+ }
44
+ }