@hydranium/glsp-server 1.0.0-next.7 → 1.0.0-next.71

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.
Files changed (36) hide show
  1. package/README.md +11 -2
  2. package/lib/launcher/hydranium-glsp-server.d.ts +4 -3
  3. package/lib/launcher/hydranium-glsp-server.d.ts.map +1 -1
  4. package/lib/launcher/hydranium-glsp-server.js +4 -3
  5. package/lib/launcher/hydranium-glsp-server.js.map +1 -1
  6. package/lib/messages/index.d.ts +24 -0
  7. package/lib/messages/index.d.ts.map +1 -0
  8. package/lib/messages/index.js +24 -0
  9. package/lib/messages/index.js.map +1 -0
  10. package/lib/state/reconcile-source-model-write.d.ts.map +1 -1
  11. package/lib/state/reconcile-source-model-write.js +3 -3
  12. package/lib/state/reconcile-source-model-write.js.map +1 -1
  13. package/lib/storage/hydranium-glsp-storage.d.ts +177 -59
  14. package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -1
  15. package/lib/storage/hydranium-glsp-storage.js +209 -80
  16. package/lib/storage/hydranium-glsp-storage.js.map +1 -1
  17. package/lib/storage/index.d.ts +1 -1
  18. package/lib/storage/index.js +1 -1
  19. package/lib/storage/save-delivery-policy.d.ts +46 -0
  20. package/lib/storage/save-delivery-policy.d.ts.map +1 -0
  21. package/lib/storage/{save-conflict-policy.js → save-delivery-policy.js} +7 -8
  22. package/lib/storage/save-delivery-policy.js.map +1 -0
  23. package/lib/validation/diagnostic-markers.js +7 -0
  24. package/lib/validation/diagnostic-markers.js.map +1 -1
  25. package/package.json +17 -8
  26. package/src/launcher/hydranium-glsp-server.ts +4 -3
  27. package/src/messages/index.ts +25 -0
  28. package/src/state/reconcile-source-model-write.ts +5 -3
  29. package/src/storage/hydranium-glsp-storage.ts +224 -79
  30. package/src/storage/index.ts +1 -1
  31. package/src/storage/save-delivery-policy.ts +44 -0
  32. package/src/validation/diagnostic-markers.ts +8 -1
  33. package/lib/storage/save-conflict-policy.d.ts +0 -56
  34. package/lib/storage/save-conflict-policy.d.ts.map +0 -1
  35. package/lib/storage/save-conflict-policy.js.map +0 -1
  36. package/src/storage/save-conflict-policy.ts +0 -52
@@ -15,15 +15,54 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
15
15
  var __metadata = (this && this.__metadata) || function (k, v) {
16
16
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
17
17
  };
18
- import { MarkersReason, SetMarkersAction } from '@eclipse-glsp/protocol';
18
+ import { MarkersReason, SetMarkersAction, StatusAction } from '@eclipse-glsp/protocol';
19
19
  import { ActionDispatcher, ClientSessionManager, CommandStack, EditMode, GLSPServerError, Logger as GlspLogger, ModelState, ModelSubmissionHandler, ModelValidator, SOURCE_URI_ARG, SetEditModeAction, TEMPORARY_CLIENT_ID } from '@eclipse-glsp/server';
20
- import { Debouncer, DisposableCollection } from '@hydranium/protocol';
20
+ import { Debouncer, defineMessage, DisposableCollection } from '@hydranium/protocol';
21
21
  import { inject, injectable, optional, postConstruct } from 'inversify';
22
22
  import { URI } from '@hydranium/langium';
23
23
  import { AstDocument } from '@hydranium/core';
24
24
  import { DiagnosticSeverity } from 'vscode-languageserver-types';
25
25
  import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
26
- import { DEFAULT_SAVE_CONFLICT_POLICY, SaveConflictPolicy } from './save-conflict-policy.js';
26
+ import { DEFAULT_SAVE_DELIVERY_POLICY, SaveDeliveryPolicy } from './save-delivery-policy.js';
27
+ /**
28
+ * A save action arrived with nowhere to write to. A save action carries no
29
+ * request id, so it falls through to the error handler and `message` becomes
30
+ * the toast text.
31
+ *
32
+ * Rendered at the raise site rather than by a carrier method, because GLSP's
33
+ * action protocol has no slot for an identity anywhere — every member of its
34
+ * message, status and reject actions is prose or an enum, and
35
+ * `MessageAction.details` is not a substitute since it is prose populated from
36
+ * `cause?.toString?.()`, and a Theia host shows it to a user on demand. So the
37
+ * throw is the last place that still knows which message this is.
38
+ */
39
+ export const SAVE_TARGET_UNKNOWN = defineMessage('hydranium/glsp-server/save-target-unknown', 'Could not determine where to save this model');
40
+ /**
41
+ * A model request arrived without the source URI it is required to carry.
42
+ * Rendered at the raise site, like its save-path sibling and for the same
43
+ * reason.
44
+ */
45
+ export const SOURCE_URI_MISSING = defineMessage('hydranium/glsp-server/source-uri-missing', 'Could not open this model: the request did not say which document to load');
46
+ /**
47
+ * Why the canvas has stopped accepting edits.
48
+ *
49
+ * **A READONLY canvas is otherwise indistinguishable from a broken one.** The
50
+ * client's answer to {@link SetEditModeAction} is to withdraw the tool palette,
51
+ * so the surface a reader was working in silently loses the only control it had,
52
+ * with the cause — a syntax error in a document that may not even be open —
53
+ * nowhere on screen. The mode flip is the mechanism; this is the only part of it
54
+ * a user can see.
55
+ *
56
+ * Rendered at the raise site, like its two siblings above and for the same
57
+ * reason: every member of GLSP's status action is prose or an enum.
58
+ *
59
+ * It names the recovery rather than the fault, because the fault already has a
60
+ * surface — the squiggle and the problems list, both of which say WHICH
61
+ * character — and repeating it here would put a second, less precise account of
62
+ * the same error on screen. What no other surface says is that the diagram is
63
+ * waiting on it.
64
+ */
65
+ export const DIAGRAM_READONLY_PARSE_ERROR = defineMessage('hydranium/glsp-server/diagram-readonly-parse-error', 'Read-only: this document has a syntax error. Fix it to edit the diagram again.');
27
66
  /** Window (ms) over which back-to-back external rebuilds collapse into one resubmit. */
28
67
  const EXTERNAL_SUBMIT_DEBOUNCE_MS = 250;
29
68
  /**
@@ -69,17 +108,14 @@ function isStructuralDiagnostic(diagnostic) {
69
108
  *
70
109
  * Adopters with richer needs override the seams ({@link isStructurallyBroken},
71
110
  * {@link onParseErrorChanged}, {@link onSourceModelSettled}) rather than the
72
- * whole flow, and select a {@link SaveConflictPolicy} via the bound option to
73
- * tune how {@link saveSourceModel} reacts to a concurrent edit.
111
+ * whole flow, and select a {@link SaveDeliveryPolicy} via the bound option to
112
+ * tune how {@link saveSourceModel} delivers its result.
74
113
  *
75
- * **Default `saveSourceModel` flow.** Delegates to `ModelService.save`, which
76
- * serialises through the language-specific `Serializer` bound at
77
- * `services.serializer.Serializer` (resolved per-URI via `ServiceRegistry`),
78
- * updates the multi-client text-document store, drives a rebuild, and writes the
79
- * result via the `WritableFileSystemProvider`. The bound
80
- * {@link SaveConflictPolicy} (default {@link DEFAULT_SAVE_CONFLICT_POLICY},
81
- * `overwrite`) decides the based-on-version guard, await-vs-fire-and-forget, and
82
- * failure handling.
114
+ * **Default `saveSourceModel` flow.** Flushes the stored text of the primary and
115
+ * every tracked secondary via `AstDocumentManager.save`, with no serializer in
116
+ * the path the update path already put the settled text in the store. The
117
+ * bound {@link SaveDeliveryPolicy} (default {@link DEFAULT_SAVE_DELIVERY_POLICY},
118
+ * `await`) decides await-vs-fire-and-forget and failure handling.
83
119
  *
84
120
  * **tempId filter.** GLSP's `DefaultGlobalActionProvider` spins up a
85
121
  * throwaway per-diagram-type container with upstream's {@link TEMPORARY_CLIENT_ID}
@@ -111,14 +147,13 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
111
147
  */
112
148
  modelValidator;
113
149
  /**
114
- * Selected {@link SaveConflictPolicy} for {@link saveSourceModel}. Bind the
115
- * {@link SaveConflictPolicy} token in a `DiagramModule` to choose a policy;
116
- * left unbound it resolves to {@link DEFAULT_SAVE_CONFLICT_POLICY}
117
- * (`overwrite`, last-write-wins). Read via {@link saveConflictPolicy} so the
118
- * fallback is applied even when inversify injects `undefined` for an unbound
119
- * `@optional()` member.
150
+ * Selected {@link SaveDeliveryPolicy} for {@link saveSourceModel}. Bind the
151
+ * {@link SaveDeliveryPolicy} token in a `DiagramModule` to choose a policy;
152
+ * left unbound it resolves to {@link DEFAULT_SAVE_DELIVERY_POLICY}. Read via
153
+ * {@link saveDeliveryPolicy} so the fallback is applied even when inversify
154
+ * injects `undefined` for an unbound `@optional()` member.
120
155
  */
121
- boundSaveConflictPolicy;
156
+ boundSaveDeliveryPolicy;
122
157
  /** Disposables created during {@link doLoadSourceModel}; drained on session disposal. */
123
158
  toDispose = new DisposableCollection();
124
159
  /**
@@ -192,12 +227,29 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
192
227
  await this.captureSettledRoot(rootUri, document);
193
228
  }
194
229
  /**
195
- * Capture the initial settled root and apply the initial edit mode. `settled()`
196
- * strips diagnostics by phase contract, so the first edit mode is `EDITABLE`;
197
- * the first {@link handleModelUpdated} (at `Validated`, with diagnostics) flips
198
- * it READONLY if the document has structural parse errors. Edit-mode +
199
- * settle-hook actions are dispatched on a macrotask so the initial
230
+ * Capture the initial settled root and apply the initial edit mode. Edit-mode
231
+ * + settle-hook actions are dispatched on a macrotask so the initial
200
232
  * `requestModel → setModel` handshake isn't perturbed.
233
+ *
234
+ * **Whether the settled document carries diagnostics depends on how far it
235
+ * had already got, so the initial edit mode has two correct outcomes rather
236
+ * than one.** `settled()` strips nothing: it resolves AT OR ABOVE the
237
+ * integrity landmark and hands back the live document's own array. Its
238
+ * `AstDocument<TAst, never>` return type asserts emptiness for a document the
239
+ * wait had to DRIVE to that landmark, which is pre-validation — and for that
240
+ * one the mode here is `EDITABLE` and the flip to READONLY arrives with the
241
+ * first {@link handleModelUpdated}. A document already past `Validated` when
242
+ * the session opened resolves immediately with its diagnostics intact, and is
243
+ * decided correctly here with no later update owed. Any host that validates
244
+ * its workspace before a diagram is opened produces the second case, so
245
+ * neither is exceptional.
246
+ *
247
+ * **A correct decision is not a delivered one.** This dispatch happens inside
248
+ * the initial `requestModel`, before the client has the model — so the UI
249
+ * extensions that answer {@link onParseErrorChanged}'s actions are not yet
250
+ * constructed, and a canvas that opens READONLY over a broken document shows
251
+ * none of that feedback. The same timer carries {@link onSourceModelSettled},
252
+ * so an adopter's own initial actions have it too.
201
253
  */
202
254
  async captureSettledRoot(rootUri, document) {
203
255
  this.state.setSourceRoot(rootUri, document.root);
@@ -284,9 +336,10 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
284
336
  *
285
337
  * Synchronous by construction — the phase-agnostic lookup door plus the shared
286
338
  * projection — so reacting to a secondary neither waits nor can force a build.
287
- * `settled()` is not an alternative: it strips diagnostics by phase contract,
288
- * and diagnostics are the reason {@link doUpdateAndSubmit} takes a separate
289
- * event document at all.
339
+ * `settled()` is not an alternative: besides being asynchronous, it cannot be
340
+ * relied on to carry diagnostics a document it has to drive to the landmark
341
+ * arrives pre-validation with an empty array — and diagnostics are the reason
342
+ * {@link doUpdateAndSubmit} takes a separate event document at all.
290
343
  */
291
344
  currentPrimaryDocument() {
292
345
  const document = this.sharedServices.model.ModelService.getDocument(this.state.sourceUri);
@@ -360,8 +413,10 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
360
413
  /**
361
414
  * Re-settle to a guaranteed fully-linked + reprojected root, capture it, and
362
415
  * (unless suppressed) resubmit a deduped external GModel. Diagnostics for the
363
- * edit-mode decision come from the event document (`settled()` strips them by
364
- * phase contract).
416
+ * edit-mode decision come from the event document, because the re-settled one
417
+ * cannot be relied on to have any: a document driven to the landmark arrives
418
+ * pre-validation, and this path re-settles precisely to escape a transient
419
+ * mid-rebuild snapshot.
365
420
  */
366
421
  async doUpdateAndSubmit(rootUri, eventDocument) {
367
422
  // Settle-gate the capture: never setSourceRoot off the event's possibly-transient
@@ -419,15 +474,48 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
419
474
  return document.diagnostics.some(diagnostic => isStructuralDiagnostic(diagnostic));
420
475
  }
421
476
  /**
422
- * Seam: actions to emit when the structural-broken state transitions. Default:
423
- * a single {@link SetEditModeAction} toggling READONLY ↔ EDITABLE — editing is
424
- * disabled while the syntax is broken but re-enabled once it parses, a sound
425
- * generic for any Langium-backed diagram. Adopters override to add or replace
426
- * the transition feedback. The {@link AbstractHydraniumGlspState.editMode}
427
- * flip itself is owned by {@link refreshEditMode}.
477
+ * Seam: actions to emit when the structural-broken state transitions.
478
+ * Default: a {@link SetEditModeAction} toggling READONLY ↔ EDITABLE — editing
479
+ * is disabled while the syntax is broken but re-enabled once it parses, a
480
+ * sound generic for any Langium-backed diagram plus the
481
+ * {@link DIAGRAM_READONLY_PARSE_ERROR} band that says why, cleared on the way
482
+ * back. Adopters override to add or replace the transition feedback. The
483
+ * {@link AbstractHydraniumGlspState.editMode} flip itself is owned by
484
+ * {@link refreshEditMode}.
485
+ *
486
+ * **Both actions or neither, which is why they are one seam rather than
487
+ * two.** The mode flip removes the tool palette and the band is the only
488
+ * account of that, so an override that keeps one and drops the other produces
489
+ * either an unexplained loss of the palette or a warning about a restriction
490
+ * that is not in force.
491
+ *
492
+ * **The status is dispatched with no `timeout`, so it persists** — a
493
+ * time-limited band would describe a condition that outlasts it.
494
+ *
495
+ * **The slot is SHARED, and the other writer wins on one path.**
496
+ * `ModelSubmissionHandler`'s live validation writes the same slot, clearing
497
+ * it with `severity: 'NONE'` when it finishes, and an adopter dispatching its
498
+ * own `StatusAction` replaces this one too. Nothing re-asserts it. That is
499
+ * harmless while a document is being edited, because a resubmit is skipped
500
+ * once the AST is broken (see {@link doUpdateAndSubmit}) — but NOT at load:
501
+ * the initial `requestModel` submit is not that skipped path, so a diagram
502
+ * opened on an already-broken document shows this band and then loses it to
503
+ * the validation clear a moment later. Measured on a browser host, polling the
504
+ * overlay: no element, empty, the sentence, empty again.
428
505
  */
429
506
  onParseErrorChanged(_document, broken) {
430
- return [SetEditModeAction.create(broken ? EditMode.READONLY : EditMode.EDITABLE)];
507
+ return [
508
+ SetEditModeAction.create(broken ? EditMode.READONLY : EditMode.EDITABLE),
509
+ broken
510
+ ? StatusAction.create(this.sharedServices.MessageRenderer.renderMessage(DIAGRAM_READONLY_PARSE_ERROR), {
511
+ severity: 'WARNING'
512
+ })
513
+ : // `NONE` is the client's own spelling for "clear", not a severity it
514
+ // renders: `StatusOverlay.handle` branches on it before touching the
515
+ // DOM. An empty message at any other severity leaves an empty band
516
+ // with a warning icon standing on the canvas.
517
+ StatusAction.create('', { severity: 'NONE' })
518
+ ];
431
519
  }
432
520
  /**
433
521
  * Seam: extra actions to dispatch right after the initial settled root is
@@ -436,31 +524,46 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
436
524
  onSourceModelSettled(_document) {
437
525
  return [];
438
526
  }
439
- /** The effective {@link SaveConflictPolicy}: the bound option, or {@link DEFAULT_SAVE_CONFLICT_POLICY} when unbound. */
440
- get saveConflictPolicy() {
441
- return this.boundSaveConflictPolicy ?? DEFAULT_SAVE_CONFLICT_POLICY;
527
+ /** The effective {@link SaveDeliveryPolicy}: the bound option, or {@link DEFAULT_SAVE_DELIVERY_POLICY} when unbound. */
528
+ get saveDeliveryPolicy() {
529
+ return this.boundSaveDeliveryPolicy ?? DEFAULT_SAVE_DELIVERY_POLICY;
442
530
  }
443
531
  /**
444
- * Default save flow: route through `ModelService.save`. The framework
445
- * serialise-and-persist machinery handles serialisation (via the
446
- * language-specific `Serializer` bound at `services.serializer.Serializer`),
447
- * the multi-client text-document update, the rebuild, and the eventual
448
- * `WritableFileSystemProvider.writeFile`.
532
+ * Default save flow: persist the store's current text for every document this
533
+ * diagram owns.
534
+ *
535
+ * **A save persists, it does not author.** Every diagram gesture already
536
+ * reached the store through `ModelService.update`, so the store holds the
537
+ * settled text and disk is the only thing behind. Re-serializing from the AST
538
+ * here cannot improve on that text and can only damage it: a serializer
539
+ * normalises formatting and carries no comments, so a save would reflow and
540
+ * strip a document nothing changed — which is what a pure bounds drag does to
541
+ * the semantic file when only its layout moved.
449
542
  *
450
- * The configured {@link SaveConflictPolicy} (see {@link saveConflictPolicy})
451
- * decides how a concurrent edit that advanced the document is handled:
452
- * - `overwrite` (default): no based-on guard, await, propagate failures
453
- * last-write-wins, correct for a single-editor head.
454
- * - `reject`: guard on the captured `state.version`, await, surface a
455
- * `ConflictError` (and any other failure) to the GLSP save action.
456
- * - `drop-and-log`: guard, fire-and-forget, log + swallow failures — a stale
457
- * diagram save is dropped because a concurrent form/code edit already wrote
458
- * the truth, and GLSP exposes no save-failure back-channel.
543
+ * **The write set is the primary plus every tracked secondary**
544
+ * (`AbstractHydraniumGlspState.trackSecondaryDocument`), so a document the
545
+ * diagram wrote is persisted whether or not it is the one the client named.
546
+ * The primary is flushed first, then secondaries in tracking order. A
547
+ * document no client holds open is skipped there is no stored text to
548
+ * persist.
549
+ *
550
+ * **A save therefore names documents the gesture did not aim at**, which is
551
+ * why an unchanged one is not rewritten even though the user asked for a
552
+ * save: the mtime would move on a file they never touched.
553
+ * `AstDocumentManager.save` decides that per document and announces the save
554
+ * either way.
555
+ *
556
+ * The configured {@link SaveDeliveryPolicy} (see {@link saveDeliveryPolicy})
557
+ * decides await-vs-fire-and-forget and failure handling. It carries no
558
+ * based-on guard: the guard exists to stop a stale writer overwriting a newer
559
+ * document, and a flush persists the store — which already holds every other
560
+ * client's change, including the one that advanced the version.
459
561
  *
460
562
  * Returns `MaybePromise<void>` to match upstream `SourceModelStorage`:
461
- * resolves with the persist under `overwrite`/`reject`, returns synchronously
462
- * under `drop-and-log`. Adopters that bypass `ModelService` (writing through
463
- * `WritableFileSystemProvider` directly) still override the whole method.
563
+ * resolves with the flush under `await`, returns synchronously under
564
+ * `fire-and-forget`. Adopters that bypass `AstDocumentManager` (writing
565
+ * through `WritableFileSystemProvider` directly) still override the whole
566
+ * method.
464
567
  */
465
568
  saveSourceModel(action) {
466
569
  // Normalised for the same reason the load path is: `SaveModelAction.fileUri`
@@ -470,24 +573,33 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
470
573
  // the call site rather than inside `getFileUri` so that method's contract —
471
574
  // return what the action said — is unchanged for adopters overriding it.
472
575
  const uri = this.toSourceModelUri(this.getFileUri(action));
473
- const policy = this.saveConflictPolicy;
474
- const persisted = this.sharedServices.model.ModelService.save({
475
- uri,
476
- model: this.state.sourceRoot,
477
- clientId: this.state.clientId,
478
- baseVersion: policy.kind === 'overwrite' ? undefined : this.state.version
479
- }).then(() => undefined);
480
- if (policy.kind === 'drop-and-log') {
481
- // Fire-and-forget: the diagram save lost the race to a concurrent edit
482
- // that already persisted the truth, so it must neither block the action
483
- // nor surface. Log rather than leave an unhandled rejection.
576
+ const policy = this.saveDeliveryPolicy;
577
+ const persisted = this.flushWriteSet(uri);
578
+ if (policy.kind === 'fire-and-forget') {
579
+ // Log rather than leave an unhandled rejection: the promise is not
580
+ // returned, so nothing else will observe a failure.
484
581
  persisted.catch(error => this.logger.error(`Save failed for ${uri}: ${error instanceof Error ? error.message : String(error)}`));
485
582
  return undefined;
486
583
  }
487
- // overwrite / reject: await; a ConflictError (reject) or any other failure
488
- // propagates to GLSP's save-action handler.
584
+ // Awaited: any failure propagates to GLSP's save-action handler.
489
585
  return persisted;
490
586
  }
587
+ /**
588
+ * Save the stored text of `primaryUri` and every tracked secondary.
589
+ *
590
+ * Deduplicated, because a state that tracks its own primary as a secondary
591
+ * would otherwise save it twice and fire two save notifications for one
592
+ * save. A document no client holds open is skipped: there is no stored text
593
+ * to persist, and `AstDocumentManager.save` throws on one.
594
+ */
595
+ async flushWriteSet(primaryUri) {
596
+ const documents = this.sharedServices.workspace.AstDocumentManager;
597
+ for (const target of new Set([primaryUri, ...this.state.secondaryUris])) {
598
+ if (documents.isOpen(target)) {
599
+ await documents.save(target, this.state.clientId);
600
+ }
601
+ }
602
+ }
491
603
  /**
492
604
  * Normalise GLSP's `sourceUri` — which may be a filesystem PATH or a URI
493
605
  * string — to the URI string the workspace keys documents by.
@@ -516,11 +628,22 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
516
628
  *
517
629
  * Returns it VERBATIM, in whatever form the client sent;
518
630
  * {@link toSourceModelUri} is what normalises it.
631
+ *
632
+ * A model request DOES carry a request id, so a throw here takes the
633
+ * client-request path rather than the toast path — and on that path `detail`
634
+ * comes from `cause?.toString?.()`. A single-argument throw therefore reaches
635
+ * neither the server log nor the client console: both print `undefined`. So
636
+ * the two readers are addressed separately, as on the save path: `message`
637
+ * names what failed in the user's terms and is rendered, `cause` names the
638
+ * action and the option key that was missing and stays English. On THIS path
639
+ * the cause reaches only logs — `RejectAction.detail` is read by nothing but
640
+ * the client action-dispatcher's `logger.warn` — which is not what makes it
641
+ * English; its content is.
519
642
  */
520
643
  getSourceUri(action) {
521
644
  const sourceUri = action.options?.[SOURCE_URI_ARG];
522
645
  if (typeof sourceUri !== 'string') {
523
- throw new GLSPServerError(`Invalid RequestModelAction! Missing argument with key '${SOURCE_URI_ARG}'`);
646
+ throw new GLSPServerError(this.sharedServices.MessageRenderer.renderMessage(SOURCE_URI_MISSING), `no '${SOURCE_URI_ARG}' option on the ${action.kind} action (received ${typeof sourceUri})`);
524
647
  }
525
648
  return sourceUri;
526
649
  }
@@ -531,17 +654,23 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
531
654
  * {@link AbstractHydraniumGlspState.setSourceRoot}.
532
655
  *
533
656
  * A save action carries no request id, so a throw here reaches the user as a
534
- * toast built from `message`, with `cause` behind its details control. The
535
- * two therefore address different readers and must not be collapsed: the
536
- * message names what failed in the user's terms, and the cause names which
537
- * lookups came back empty for whom. Neither can name the URI not having
538
- * one IS the failure, and both sources are written together, so the typed
539
- * `sourceUri` is equally empty whenever this fires.
657
+ * toast built from `message`, while `cause` travels in
658
+ * `MessageAction.details` **which a Theia host DOES put in front of a
659
+ * user**, as a "Show details" button on the toast opening a dialog. So the
660
+ * two are not split by reachability; they are split by AUDIENCE, which is
661
+ * the older rule and the one that holds here. The message names what failed
662
+ * in the user's terms and is rendered; the cause names which lookups came
663
+ * back empty for whom, and stays English because a wire action kind, an
664
+ * option key and a client id address whoever composes the system — a
665
+ * translated developer string is a worse outcome than an untranslated one.
666
+ * Neither can name the URI — not having one IS the failure, and both sources
667
+ * are written together, so the typed `sourceUri` is equally empty whenever
668
+ * this fires.
540
669
  */
541
670
  getFileUri(action) {
542
671
  const uri = action.fileUri ?? this.state.get(SOURCE_URI_ARG);
543
672
  if (!uri) {
544
- throw new GLSPServerError('Could not determine where to save this model', `no fileUri on the save action and no ${SOURCE_URI_ARG} in the model state (clientId=${this.state.clientId})`);
673
+ throw new GLSPServerError(this.sharedServices.MessageRenderer.renderMessage(SAVE_TARGET_UNKNOWN), `no fileUri on the save action and no ${SOURCE_URI_ARG} in the model state (clientId=${this.state.clientId})`);
545
674
  }
546
675
  return uri;
547
676
  }
@@ -617,10 +746,10 @@ __decorate([
617
746
  __metadata("design:type", Object)
618
747
  ], HydraniumGlspStorage.prototype, "modelValidator", void 0);
619
748
  __decorate([
620
- inject(SaveConflictPolicy),
749
+ inject(SaveDeliveryPolicy),
621
750
  optional(),
622
751
  __metadata("design:type", Object)
623
- ], HydraniumGlspStorage.prototype, "boundSaveConflictPolicy", void 0);
752
+ ], HydraniumGlspStorage.prototype, "boundSaveDeliveryPolicy", void 0);
624
753
  __decorate([
625
754
  postConstruct(),
626
755
  __metadata("design:type", Function),
@@ -1 +1 @@
1
- {"version":3,"file":"hydranium-glsp-storage.js","sourceRoot":"","sources":["../../src/storage/hydranium-glsp-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;;;;AAElF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAEJ,gBAAgB,EAGhB,oBAAoB,EACpB,YAAY,EAGZ,QAAQ,EACR,eAAe,EACf,MAAM,IAAI,UAAU,EAEpB,UAAU,EACV,sBAAsB,EACtB,cAAc,EAEd,cAAc,EAEd,iBAAiB,EAEjB,mBAAmB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAExE,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAuF,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,kBAAkB,EA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E;;4DAAoD;AAS5B;IAA1D,MAAM,CAAC,kBAAkB,CAAC;IAAE,QAAQ,EAAE;;qEAAiE;AAqC9F;IADT,aAAa,EAAE;;;;gDAcf;AA7ES,oBAAoB;IADhC,UAAU,EAAE;GACA,oBAAoB,CA8nBhC"}
@@ -7,5 +7,5 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  export * from './hydranium-glsp-storage.js';
10
- export * from './save-conflict-policy.js';
10
+ export * from './save-delivery-policy.js';
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -7,5 +7,5 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  export * from './hydranium-glsp-storage.js';
10
- export * from './save-conflict-policy.js';
10
+ export * from './save-delivery-policy.js';
11
11
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,46 @@
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
+ * How `HydraniumGlspStorage.saveSourceModel` delivers its result: whether the
11
+ * GLSP save action awaits the write, and what happens on failure.
12
+ *
13
+ * The two are not independent — fire-and-forget plus rethrow would leave an
14
+ * unhandled rejection — so each arm bundles them into one coherent, nameable
15
+ * policy an adopter selects whole. It is a *selection of configuration*,
16
+ * delivered as a bound option (see the {@link SaveDeliveryPolicy} symbol) rather
17
+ * than a behaviour hook.
18
+ *
19
+ * **Neither arm guards on a based-on version.** A save flushes the store's
20
+ * settled text rather than authoring from the diagram's captured model, and the
21
+ * store already holds every other client's change — so a guard here refuses a
22
+ * write whose content is already correct. The gate that does exist sits on the
23
+ * update path, per operation, where the diagram authors.
24
+ */
25
+ export type SaveDeliveryPolicy =
26
+ /** Await the write and propagate any failure to the GLSP save action. The default. */
27
+ {
28
+ kind: 'await';
29
+ }
30
+ /**
31
+ * Fire-and-forget, logging and swallowing every failure. Correct when a
32
+ * failed diagram save must neither block the action nor surface as an error.
33
+ */
34
+ | {
35
+ kind: 'fire-and-forget';
36
+ };
37
+ /** The policy applied when no {@link SaveDeliveryPolicy} option is bound. */
38
+ export declare const DEFAULT_SAVE_DELIVERY_POLICY: SaveDeliveryPolicy;
39
+ /**
40
+ * DI token for the {@link SaveDeliveryPolicy} option. Bind a constant value in a
41
+ * `DiagramModule` to select a non-default policy; left unbound,
42
+ * `HydraniumGlspStorage` falls back to {@link DEFAULT_SAVE_DELIVERY_POLICY}.
43
+ * Shares its name with the type, the way a `class` is both a value and a type.
44
+ */
45
+ export declare const SaveDeliveryPolicy: unique symbol;
46
+ //# sourceMappingURL=save-delivery-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-delivery-policy.d.ts","sourceRoot":"","sources":["../../src/storage/save-delivery-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,kBAAkB;AAC3B,sFAAsF;AACpF;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE;AACnB;;;GAGG;GACD;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAEjC,6EAA6E;AAC7E,eAAO,MAAM,4BAA4B,EAAE,kBAAsC,CAAC;AAElF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,eAA+B,CAAC"}
@@ -6,14 +6,13 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- /** The policy applied when no {@link SaveConflictPolicy} option is bound. */
10
- export const DEFAULT_SAVE_CONFLICT_POLICY = { kind: 'overwrite' };
9
+ /** The policy applied when no {@link SaveDeliveryPolicy} option is bound. */
10
+ export const DEFAULT_SAVE_DELIVERY_POLICY = { kind: 'await' };
11
11
  /**
12
- * DI token for the {@link SaveConflictPolicy} option. Bind a constant value in a
12
+ * DI token for the {@link SaveDeliveryPolicy} option. Bind a constant value in a
13
13
  * `DiagramModule` to select a non-default policy; left unbound,
14
- * `HydraniumGlspStorage` falls back to
15
- * {@link DEFAULT_SAVE_CONFLICT_POLICY}. Shares its name with the type, the way a
16
- * `class` is both a value and a type.
14
+ * `HydraniumGlspStorage` falls back to {@link DEFAULT_SAVE_DELIVERY_POLICY}.
15
+ * Shares its name with the type, the way a `class` is both a value and a type.
17
16
  */
18
- export const SaveConflictPolicy = Symbol('SaveConflictPolicy');
19
- //# sourceMappingURL=save-conflict-policy.js.map
17
+ export const SaveDeliveryPolicy = Symbol('SaveDeliveryPolicy');
18
+ //# sourceMappingURL=save-delivery-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-delivery-policy.js","sourceRoot":"","sources":["../../src/storage/save-delivery-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AA2BlF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,4BAA4B,GAAuB,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAElF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC"}
@@ -40,8 +40,15 @@ export function diagnosticsToMarkers(diagnostics, lookups) {
40
40
  * The ids of the elements drawn on this diagram for the diagnostic's target,
41
41
  * starting at the node it points at and walking up its containers; empty when
42
42
  * the path does not resolve or nothing on the chain is rendered.
43
+ *
44
+ * @param elementPath absent for a lexer or parser error, which Langium pushes
45
+ * onto the document without one — such a diagnostic points at text no node
46
+ * was built from, so it marks nothing.
43
47
  */
44
48
  function renderedElementIds(elementPath, lookups) {
49
+ if (elementPath === undefined) {
50
+ return [];
51
+ }
45
52
  let node = lookups.resolveElement(elementPath);
46
53
  while (node !== undefined) {
47
54
  const ids = lookups.renderedIdsFor(node);
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostic-markers.js","sourceRoot":"","sources":["../../src/validation/diagnostic-markers.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AA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