@hydranium/glsp-server 1.0.0-next.31 → 1.0.0-next.33
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/launcher/hydranium-glsp-server.d.ts +4 -3
- package/lib/launcher/hydranium-glsp-server.d.ts.map +1 -1
- package/lib/launcher/hydranium-glsp-server.js +4 -3
- package/lib/launcher/hydranium-glsp-server.js.map +1 -1
- package/lib/messages/index.d.ts +11 -6
- package/lib/messages/index.d.ts.map +1 -1
- package/lib/messages/index.js +11 -6
- package/lib/messages/index.js.map +1 -1
- package/lib/storage/hydranium-glsp-storage.d.ts +108 -38
- package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -1
- package/lib/storage/hydranium-glsp-storage.js +123 -42
- package/lib/storage/hydranium-glsp-storage.js.map +1 -1
- package/package.json +7 -7
- package/src/launcher/hydranium-glsp-server.ts +4 -3
- package/src/messages/index.ts +11 -6
- package/src/storage/hydranium-glsp-storage.ts +127 -42
|
@@ -16,9 +16,10 @@ import { type ClientSession, DefaultGLSPServer, type RequestAction, type Respons
|
|
|
16
16
|
* `error.cause?.toString()` whenever the error is a {@link GLSPServerError},
|
|
17
17
|
* and that one value feeds both the server log and the client's
|
|
18
18
|
* {@link RejectAction}. A {@link GLSPServerError} carrying no `cause` therefore
|
|
19
|
-
* reaches
|
|
20
|
-
* while a plain `Error` survives,
|
|
21
|
-
* itself. The typed error is the trap,
|
|
19
|
+
* reaches its readers as `undefined` — the log line and the client's
|
|
20
|
+
* action-dispatcher warning both print it — while a plain `Error` survives,
|
|
21
|
+
* because the other branch reads the error itself. The typed error is the trap,
|
|
22
|
+
* and it is the one upstream's own
|
|
22
23
|
* `getOrThrow` helper raises: that helper's signature cannot pass a `cause`, so
|
|
23
24
|
* an adopter using the sanctioned helper has no fix available on their side.
|
|
24
25
|
* Restating the cause at each throw site is the alternative, and it costs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-server.d.ts","sourceRoot":"","sources":["../../src/launcher/hydranium-glsp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,aAAa,EAClB,iBAAiB,EAGjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACrB,MAAM,sBAAsB,CAAC;AAG9B
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-server.d.ts","sourceRoot":"","sources":["../../src/launcher/hydranium-glsp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,aAAa,EAClB,iBAAiB,EAGjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACrB,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBACa,mBAAoB,SAAQ,iBAAiB;IACvD;;;;;;;;OAQG;IACH,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAOlE;;;;;;;;;;;;;OAaG;cACsB,mBAAmB,CACzC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,aAAa,CAAC,cAAc,CAAC,EACrC,QAAQ,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;CAuBlB"}
|
|
@@ -23,9 +23,10 @@ import { injectable } from 'inversify';
|
|
|
23
23
|
* `error.cause?.toString()` whenever the error is a {@link GLSPServerError},
|
|
24
24
|
* and that one value feeds both the server log and the client's
|
|
25
25
|
* {@link RejectAction}. A {@link GLSPServerError} carrying no `cause` therefore
|
|
26
|
-
* reaches
|
|
27
|
-
* while a plain `Error` survives,
|
|
28
|
-
* itself. The typed error is the trap,
|
|
26
|
+
* reaches its readers as `undefined` — the log line and the client's
|
|
27
|
+
* action-dispatcher warning both print it — while a plain `Error` survives,
|
|
28
|
+
* because the other branch reads the error itself. The typed error is the trap,
|
|
29
|
+
* and it is the one upstream's own
|
|
29
30
|
* `getOrThrow` helper raises: that helper's signature cannot pass a `cause`, so
|
|
30
31
|
* an adopter using the sanctioned helper has no fix available on their side.
|
|
31
32
|
* Restating the cause at each throw site is the alternative, and it costs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-server.js","sourceRoot":"","sources":["../../src/launcher/hydranium-glsp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAElF,OAAO,EAEJ,iBAAiB,EACjB,eAAe,EACf,YAAY,EAGd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-server.js","sourceRoot":"","sources":["../../src/launcher/hydranium-glsp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;;;;;;;AAElF,OAAO,EAEJ,iBAAiB,EACjB,eAAe,EACf,YAAY,EAGd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,iBAAiB;IACvD;;;;;;;;OAQG;IACO,oBAAoB,CAAC,KAAc;QAC1C,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;YACpC,OAAO,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClG,CAAC;QACD,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;;;;;OAaG;IACgB,KAAK,CAAC,mBAAmB,CACzC,aAA4B,EAC5B,MAAqC,EACrC,QAAgB;QAEhB,IAAI,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|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* the
|
|
12
|
+
* **Each one is rendered AT ITS RAISE SITE**, through the shared
|
|
13
|
+
* `MessageRenderer`, because GLSP's action protocol carries no slot for an
|
|
14
|
+
* identity on any of its actions — so the identity is gone the moment a raise
|
|
15
|
+
* site formats its text, and there is nothing at the error boundary to render
|
|
16
|
+
* from. That makes this head the one place where a new message can ship
|
|
17
|
+
* unrendered without any single chokepoint noticing, which is why the package's
|
|
18
|
+
* own test suite scans for a declaration reached by `.format()` instead.
|
|
19
|
+
*
|
|
20
|
+
* The barrel is also how an adopter rendering their own diagram chrome
|
|
21
|
+
* discovers the codes exist.
|
|
17
22
|
*/
|
|
18
|
-
export { SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
|
|
23
|
+
export { DIAGRAM_READONLY_PARSE_ERROR, SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
|
|
19
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC"}
|
package/lib/messages/index.js
CHANGED
|
@@ -9,11 +9,16 @@
|
|
|
9
9
|
/**
|
|
10
10
|
* Every user-facing message `@hydranium/glsp-server` raises.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* the
|
|
12
|
+
* **Each one is rendered AT ITS RAISE SITE**, through the shared
|
|
13
|
+
* `MessageRenderer`, because GLSP's action protocol carries no slot for an
|
|
14
|
+
* identity on any of its actions — so the identity is gone the moment a raise
|
|
15
|
+
* site formats its text, and there is nothing at the error boundary to render
|
|
16
|
+
* from. That makes this head the one place where a new message can ship
|
|
17
|
+
* unrendered without any single chokepoint noticing, which is why the package's
|
|
18
|
+
* own test suite scans for a declaration reached by `.format()` instead.
|
|
19
|
+
*
|
|
20
|
+
* The barrel is also how an adopter rendering their own diagram chrome
|
|
21
|
+
* discovers the codes exist.
|
|
17
22
|
*/
|
|
18
|
-
export { SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
|
|
23
|
+
export { DIAGRAM_READONLY_PARSE_ERROR, SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
|
|
19
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -14,25 +14,44 @@ import { type AbstractHydraniumGlspState } from '../state/abstract-hydranium-gls
|
|
|
14
14
|
import { type HydraniumGlspSubmissionHandler } from '../submission/hydranium-glsp-submission-handler.js';
|
|
15
15
|
import { SaveConflictPolicy } from './save-conflict-policy.js';
|
|
16
16
|
/**
|
|
17
|
-
* A save action arrived with nowhere to write to.
|
|
17
|
+
* A save action arrived with nowhere to write to. A save action carries no
|
|
18
|
+
* request id, so it falls through to the error handler and `message` becomes
|
|
19
|
+
* the toast text.
|
|
18
20
|
*
|
|
19
|
-
*
|
|
20
|
-
* action
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* `cause?.toString?.()`, so a code there would sit inside human text.
|
|
21
|
+
* Rendered at the raise site rather than by a carrier method, because GLSP's
|
|
22
|
+
* action protocol has no slot for an identity anywhere — every member of its
|
|
23
|
+
* message, status and reject actions is prose or an enum, and
|
|
24
|
+
* `MessageAction.details` is not a substitute since it is prose populated from
|
|
25
|
+
* `cause?.toString?.()`, and a Theia host shows it to a user on demand. So the
|
|
26
|
+
* throw is the last place that still knows which message this is.
|
|
26
27
|
*/
|
|
27
28
|
export declare const SAVE_TARGET_UNKNOWN: import("@hydranium/protocol").MessageDefinition<"Could not determine where to save this model">;
|
|
28
29
|
/**
|
|
29
30
|
* A model request arrived without the source URI it is required to carry.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* protocol has no slot for an identity, so the English is what a client
|
|
33
|
-
* receives.
|
|
31
|
+
* Rendered at the raise site, like its save-path sibling and for the same
|
|
32
|
+
* reason.
|
|
34
33
|
*/
|
|
35
34
|
export declare const SOURCE_URI_MISSING: import("@hydranium/protocol").MessageDefinition<"Could not open this model: the request did not say which document to load">;
|
|
35
|
+
/**
|
|
36
|
+
* Why the canvas has stopped accepting edits.
|
|
37
|
+
*
|
|
38
|
+
* **A READONLY canvas is otherwise indistinguishable from a broken one.** The
|
|
39
|
+
* client's answer to {@link SetEditModeAction} is to withdraw the tool palette,
|
|
40
|
+
* so the surface a reader was working in silently loses the only control it had,
|
|
41
|
+
* with the cause — a syntax error in a document that may not even be open —
|
|
42
|
+
* nowhere on screen. The mode flip is the mechanism; this is the only part of it
|
|
43
|
+
* a user can see.
|
|
44
|
+
*
|
|
45
|
+
* Rendered at the raise site, like its two siblings above and for the same
|
|
46
|
+
* reason: every member of GLSP's status action is prose or an enum.
|
|
47
|
+
*
|
|
48
|
+
* It names the recovery rather than the fault, because the fault already has a
|
|
49
|
+
* surface — the squiggle and the problems list, both of which say WHICH
|
|
50
|
+
* character — and repeating it here would put a second, less precise account of
|
|
51
|
+
* the same error on screen. What no other surface says is that the diagram is
|
|
52
|
+
* waiting on it.
|
|
53
|
+
*/
|
|
54
|
+
export declare const DIAGRAM_READONLY_PARSE_ERROR: import("@hydranium/protocol").MessageDefinition<"Read-only: this document has a syntax error. Fix it to edit the diagram again.">;
|
|
36
55
|
/**
|
|
37
56
|
* GLSP source-model storage base shared by all hydranium adopters.
|
|
38
57
|
* Provides the DI signature, the {@link ClientSessionListener} +
|
|
@@ -140,12 +159,29 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
140
159
|
loadSourceModel(action: RequestModelAction): MaybePromise<void>;
|
|
141
160
|
protected doLoadSourceModel(action: RequestModelAction): Promise<void>;
|
|
142
161
|
/**
|
|
143
|
-
* Capture the initial settled root and apply the initial edit mode.
|
|
144
|
-
*
|
|
145
|
-
* the first {@link handleModelUpdated} (at `Validated`, with diagnostics) flips
|
|
146
|
-
* it READONLY if the document has structural parse errors. Edit-mode +
|
|
147
|
-
* settle-hook actions are dispatched on a macrotask so the initial
|
|
162
|
+
* Capture the initial settled root and apply the initial edit mode. Edit-mode
|
|
163
|
+
* + settle-hook actions are dispatched on a macrotask so the initial
|
|
148
164
|
* `requestModel → setModel` handshake isn't perturbed.
|
|
165
|
+
*
|
|
166
|
+
* **Whether the settled document carries diagnostics depends on how far it
|
|
167
|
+
* had already got, so the initial edit mode has two correct outcomes rather
|
|
168
|
+
* than one.** `settled()` strips nothing: it resolves AT OR ABOVE the
|
|
169
|
+
* integrity landmark and hands back the live document's own array. Its
|
|
170
|
+
* `AstDocument<TAst, never>` return type asserts emptiness for a document the
|
|
171
|
+
* wait had to DRIVE to that landmark, which is pre-validation — and for that
|
|
172
|
+
* one the mode here is `EDITABLE` and the flip to READONLY arrives with the
|
|
173
|
+
* first {@link handleModelUpdated}. A document already past `Validated` when
|
|
174
|
+
* the session opened resolves immediately with its diagnostics intact, and is
|
|
175
|
+
* decided correctly here with no later update owed. Any host that validates
|
|
176
|
+
* its workspace before a diagram is opened produces the second case, so
|
|
177
|
+
* neither is exceptional.
|
|
178
|
+
*
|
|
179
|
+
* **A correct decision is not a delivered one.** This dispatch happens inside
|
|
180
|
+
* the initial `requestModel`, before the client has the model — so the UI
|
|
181
|
+
* extensions that answer {@link onParseErrorChanged}'s actions are not yet
|
|
182
|
+
* constructed, and a canvas that opens READONLY over a broken document shows
|
|
183
|
+
* none of that feedback. The same timer carries {@link onSourceModelSettled},
|
|
184
|
+
* so an adopter's own initial actions have it too.
|
|
149
185
|
*/
|
|
150
186
|
protected captureSettledRoot(rootUri: string, document: AstDocument<AstNode, never>): Promise<void>;
|
|
151
187
|
/**
|
|
@@ -198,9 +234,10 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
198
234
|
*
|
|
199
235
|
* Synchronous by construction — the phase-agnostic lookup door plus the shared
|
|
200
236
|
* projection — so reacting to a secondary neither waits nor can force a build.
|
|
201
|
-
* `settled()` is not an alternative:
|
|
202
|
-
*
|
|
203
|
-
*
|
|
237
|
+
* `settled()` is not an alternative: besides being asynchronous, it cannot be
|
|
238
|
+
* relied on to carry diagnostics — a document it has to drive to the landmark
|
|
239
|
+
* arrives pre-validation with an empty array — and diagnostics are the reason
|
|
240
|
+
* {@link doUpdateAndSubmit} takes a separate event document at all.
|
|
204
241
|
*/
|
|
205
242
|
protected currentPrimaryDocument(): AstDocument<AstNode, unknown> | undefined;
|
|
206
243
|
/**
|
|
@@ -242,8 +279,10 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
242
279
|
/**
|
|
243
280
|
* Re-settle to a guaranteed fully-linked + reprojected root, capture it, and
|
|
244
281
|
* (unless suppressed) resubmit a deduped external GModel. Diagnostics for the
|
|
245
|
-
* edit-mode decision come from the event document
|
|
246
|
-
*
|
|
282
|
+
* edit-mode decision come from the event document, because the re-settled one
|
|
283
|
+
* cannot be relied on to have any: a document driven to the landmark arrives
|
|
284
|
+
* pre-validation, and this path re-settles precisely to escape a transient
|
|
285
|
+
* mid-rebuild snapshot.
|
|
247
286
|
*/
|
|
248
287
|
protected doUpdateAndSubmit(rootUri: string, eventDocument: AstDocument<AstNode, unknown>): Promise<Action[]>;
|
|
249
288
|
/**
|
|
@@ -261,12 +300,34 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
261
300
|
*/
|
|
262
301
|
protected isStructurallyBroken(document: AstDocument<AstNode, unknown>): boolean;
|
|
263
302
|
/**
|
|
264
|
-
* Seam: actions to emit when the structural-broken state transitions.
|
|
265
|
-
* a
|
|
266
|
-
* disabled while the syntax is broken but re-enabled once it parses, a
|
|
267
|
-
* generic for any Langium-backed diagram
|
|
268
|
-
*
|
|
269
|
-
*
|
|
303
|
+
* Seam: actions to emit when the structural-broken state transitions.
|
|
304
|
+
* Default: a {@link SetEditModeAction} toggling READONLY ↔ EDITABLE — editing
|
|
305
|
+
* is disabled while the syntax is broken but re-enabled once it parses, a
|
|
306
|
+
* sound generic for any Langium-backed diagram — plus the
|
|
307
|
+
* {@link DIAGRAM_READONLY_PARSE_ERROR} band that says why, cleared on the way
|
|
308
|
+
* back. Adopters override to add or replace the transition feedback. The
|
|
309
|
+
* {@link AbstractHydraniumGlspState.editMode} flip itself is owned by
|
|
310
|
+
* {@link refreshEditMode}.
|
|
311
|
+
*
|
|
312
|
+
* **Both actions or neither, which is why they are one seam rather than
|
|
313
|
+
* two.** The mode flip removes the tool palette and the band is the only
|
|
314
|
+
* account of that, so an override that keeps one and drops the other produces
|
|
315
|
+
* either an unexplained loss of the palette or a warning about a restriction
|
|
316
|
+
* that is not in force.
|
|
317
|
+
*
|
|
318
|
+
* **The status is dispatched with no `timeout`, so it persists** — a
|
|
319
|
+
* time-limited band would describe a condition that outlasts it.
|
|
320
|
+
*
|
|
321
|
+
* **The slot is SHARED, and the other writer wins on one path.**
|
|
322
|
+
* `ModelSubmissionHandler`'s live validation writes the same slot, clearing
|
|
323
|
+
* it with `severity: 'NONE'` when it finishes, and an adopter dispatching its
|
|
324
|
+
* own `StatusAction` replaces this one too. Nothing re-asserts it. That is
|
|
325
|
+
* harmless while a document is being edited, because a resubmit is skipped
|
|
326
|
+
* once the AST is broken (see {@link doUpdateAndSubmit}) — but NOT at load:
|
|
327
|
+
* the initial `requestModel` submit is not that skipped path, so a diagram
|
|
328
|
+
* opened on an already-broken document shows this band and then loses it to
|
|
329
|
+
* the validation clear a moment later. Measured on a browser host, polling the
|
|
330
|
+
* overlay: no element, empty, the sentence, empty again.
|
|
270
331
|
*/
|
|
271
332
|
protected onParseErrorChanged(_document: AstDocument<AstNode, unknown>, broken: boolean): Action[];
|
|
272
333
|
/**
|
|
@@ -329,10 +390,13 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
329
390
|
* A model request DOES carry a request id, so a throw here takes the
|
|
330
391
|
* client-request path rather than the toast path — and on that path `detail`
|
|
331
392
|
* comes from `cause?.toString?.()`. A single-argument throw therefore reaches
|
|
332
|
-
* neither the
|
|
333
|
-
* are addressed separately, as on the save path: `message`
|
|
334
|
-
* in the user's terms, `cause` names the
|
|
335
|
-
* missing.
|
|
393
|
+
* neither the server log nor the client console: both print `undefined`. So
|
|
394
|
+
* the two readers are addressed separately, as on the save path: `message`
|
|
395
|
+
* names what failed in the user's terms and is rendered, `cause` names the
|
|
396
|
+
* action and the option key that was missing and stays English. On THIS path
|
|
397
|
+
* the cause reaches only logs — `RejectAction.detail` is read by nothing but
|
|
398
|
+
* the client action-dispatcher's `logger.warn` — which is not what makes it
|
|
399
|
+
* English; its content is.
|
|
336
400
|
*/
|
|
337
401
|
protected getSourceUri(action: RequestModelAction): string;
|
|
338
402
|
/**
|
|
@@ -342,12 +406,18 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
342
406
|
* {@link AbstractHydraniumGlspState.setSourceRoot}.
|
|
343
407
|
*
|
|
344
408
|
* A save action carries no request id, so a throw here reaches the user as a
|
|
345
|
-
* toast built from `message`,
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
409
|
+
* toast built from `message`, while `cause` travels in
|
|
410
|
+
* `MessageAction.details` — **which a Theia host DOES put in front of a
|
|
411
|
+
* user**, as a "Show details" button on the toast opening a dialog. So the
|
|
412
|
+
* two are not split by reachability; they are split by AUDIENCE, which is
|
|
413
|
+
* the older rule and the one that holds here. The message names what failed
|
|
414
|
+
* in the user's terms and is rendered; the cause names which lookups came
|
|
415
|
+
* back empty for whom, and stays English because a wire action kind, an
|
|
416
|
+
* option key and a client id address whoever composes the system — a
|
|
417
|
+
* translated developer string is a worse outcome than an untranslated one.
|
|
418
|
+
* Neither can name the URI — not having one IS the failure, and both sources
|
|
419
|
+
* are written together, so the typed `sourceUri` is equally empty whenever
|
|
420
|
+
* this fires.
|
|
351
421
|
*/
|
|
352
422
|
protected getFileUri(action: SaveModelAction): string;
|
|
353
423
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-storage.d.ts","sourceRoot":"","sources":["../../src/storage/hydranium-glsp-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EACJ,KAAK,MAAM,EACX,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,oBAAoB,EAEpB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAGf,MAAM,IAAI,UAAU,EACpB,KAAK,YAAY,EAGjB,cAAc,EACd,KAAK,kBAAkB,EAEvB,KAAK,eAAe,EAEpB,KAAK,kBAAkB,EAEzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAiB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAErF,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD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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
20
|
import { Debouncer, defineMessage, DisposableCollection } from '@hydranium/protocol';
|
|
21
21
|
import { inject, injectable, optional, postConstruct } from 'inversify';
|
|
@@ -25,25 +25,44 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
|
|
|
25
25
|
import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
|
|
26
26
|
import { DEFAULT_SAVE_CONFLICT_POLICY, SaveConflictPolicy } from './save-conflict-policy.js';
|
|
27
27
|
/**
|
|
28
|
-
* A save action arrived with nowhere to write to.
|
|
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.
|
|
29
31
|
*
|
|
30
|
-
*
|
|
31
|
-
* action
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* `cause?.toString?.()`, so a code there would sit inside human text.
|
|
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.
|
|
37
38
|
*/
|
|
38
39
|
export const SAVE_TARGET_UNKNOWN = defineMessage('hydranium/glsp-server/save-target-unknown', 'Could not determine where to save this model');
|
|
39
40
|
/**
|
|
40
41
|
* A model request arrived without the source URI it is required to carry.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* protocol has no slot for an identity, so the English is what a client
|
|
44
|
-
* receives.
|
|
42
|
+
* Rendered at the raise site, like its save-path sibling and for the same
|
|
43
|
+
* reason.
|
|
45
44
|
*/
|
|
46
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.');
|
|
47
66
|
/** Window (ms) over which back-to-back external rebuilds collapse into one resubmit. */
|
|
48
67
|
const EXTERNAL_SUBMIT_DEBOUNCE_MS = 250;
|
|
49
68
|
/**
|
|
@@ -212,12 +231,29 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
212
231
|
await this.captureSettledRoot(rootUri, document);
|
|
213
232
|
}
|
|
214
233
|
/**
|
|
215
|
-
* Capture the initial settled root and apply the initial edit mode.
|
|
216
|
-
*
|
|
217
|
-
* the first {@link handleModelUpdated} (at `Validated`, with diagnostics) flips
|
|
218
|
-
* it READONLY if the document has structural parse errors. Edit-mode +
|
|
219
|
-
* settle-hook actions are dispatched on a macrotask so the initial
|
|
234
|
+
* Capture the initial settled root and apply the initial edit mode. Edit-mode
|
|
235
|
+
* + settle-hook actions are dispatched on a macrotask so the initial
|
|
220
236
|
* `requestModel → setModel` handshake isn't perturbed.
|
|
237
|
+
*
|
|
238
|
+
* **Whether the settled document carries diagnostics depends on how far it
|
|
239
|
+
* had already got, so the initial edit mode has two correct outcomes rather
|
|
240
|
+
* than one.** `settled()` strips nothing: it resolves AT OR ABOVE the
|
|
241
|
+
* integrity landmark and hands back the live document's own array. Its
|
|
242
|
+
* `AstDocument<TAst, never>` return type asserts emptiness for a document the
|
|
243
|
+
* wait had to DRIVE to that landmark, which is pre-validation — and for that
|
|
244
|
+
* one the mode here is `EDITABLE` and the flip to READONLY arrives with the
|
|
245
|
+
* first {@link handleModelUpdated}. A document already past `Validated` when
|
|
246
|
+
* the session opened resolves immediately with its diagnostics intact, and is
|
|
247
|
+
* decided correctly here with no later update owed. Any host that validates
|
|
248
|
+
* its workspace before a diagram is opened produces the second case, so
|
|
249
|
+
* neither is exceptional.
|
|
250
|
+
*
|
|
251
|
+
* **A correct decision is not a delivered one.** This dispatch happens inside
|
|
252
|
+
* the initial `requestModel`, before the client has the model — so the UI
|
|
253
|
+
* extensions that answer {@link onParseErrorChanged}'s actions are not yet
|
|
254
|
+
* constructed, and a canvas that opens READONLY over a broken document shows
|
|
255
|
+
* none of that feedback. The same timer carries {@link onSourceModelSettled},
|
|
256
|
+
* so an adopter's own initial actions have it too.
|
|
221
257
|
*/
|
|
222
258
|
async captureSettledRoot(rootUri, document) {
|
|
223
259
|
this.state.setSourceRoot(rootUri, document.root);
|
|
@@ -304,9 +340,10 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
304
340
|
*
|
|
305
341
|
* Synchronous by construction — the phase-agnostic lookup door plus the shared
|
|
306
342
|
* projection — so reacting to a secondary neither waits nor can force a build.
|
|
307
|
-
* `settled()` is not an alternative:
|
|
308
|
-
*
|
|
309
|
-
*
|
|
343
|
+
* `settled()` is not an alternative: besides being asynchronous, it cannot be
|
|
344
|
+
* relied on to carry diagnostics — a document it has to drive to the landmark
|
|
345
|
+
* arrives pre-validation with an empty array — and diagnostics are the reason
|
|
346
|
+
* {@link doUpdateAndSubmit} takes a separate event document at all.
|
|
310
347
|
*/
|
|
311
348
|
currentPrimaryDocument() {
|
|
312
349
|
const document = this.sharedServices.model.ModelService.getDocument(this.state.sourceUri);
|
|
@@ -380,8 +417,10 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
380
417
|
/**
|
|
381
418
|
* Re-settle to a guaranteed fully-linked + reprojected root, capture it, and
|
|
382
419
|
* (unless suppressed) resubmit a deduped external GModel. Diagnostics for the
|
|
383
|
-
* edit-mode decision come from the event document
|
|
384
|
-
*
|
|
420
|
+
* edit-mode decision come from the event document, because the re-settled one
|
|
421
|
+
* cannot be relied on to have any: a document driven to the landmark arrives
|
|
422
|
+
* pre-validation, and this path re-settles precisely to escape a transient
|
|
423
|
+
* mid-rebuild snapshot.
|
|
385
424
|
*/
|
|
386
425
|
async doUpdateAndSubmit(rootUri, eventDocument) {
|
|
387
426
|
// Settle-gate the capture: never setSourceRoot off the event's possibly-transient
|
|
@@ -439,15 +478,48 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
439
478
|
return document.diagnostics.some(diagnostic => isStructuralDiagnostic(diagnostic));
|
|
440
479
|
}
|
|
441
480
|
/**
|
|
442
|
-
* Seam: actions to emit when the structural-broken state transitions.
|
|
443
|
-
* a
|
|
444
|
-
* disabled while the syntax is broken but re-enabled once it parses, a
|
|
445
|
-
* generic for any Langium-backed diagram
|
|
446
|
-
*
|
|
447
|
-
*
|
|
481
|
+
* Seam: actions to emit when the structural-broken state transitions.
|
|
482
|
+
* Default: a {@link SetEditModeAction} toggling READONLY ↔ EDITABLE — editing
|
|
483
|
+
* is disabled while the syntax is broken but re-enabled once it parses, a
|
|
484
|
+
* sound generic for any Langium-backed diagram — plus the
|
|
485
|
+
* {@link DIAGRAM_READONLY_PARSE_ERROR} band that says why, cleared on the way
|
|
486
|
+
* back. Adopters override to add or replace the transition feedback. The
|
|
487
|
+
* {@link AbstractHydraniumGlspState.editMode} flip itself is owned by
|
|
488
|
+
* {@link refreshEditMode}.
|
|
489
|
+
*
|
|
490
|
+
* **Both actions or neither, which is why they are one seam rather than
|
|
491
|
+
* two.** The mode flip removes the tool palette and the band is the only
|
|
492
|
+
* account of that, so an override that keeps one and drops the other produces
|
|
493
|
+
* either an unexplained loss of the palette or a warning about a restriction
|
|
494
|
+
* that is not in force.
|
|
495
|
+
*
|
|
496
|
+
* **The status is dispatched with no `timeout`, so it persists** — a
|
|
497
|
+
* time-limited band would describe a condition that outlasts it.
|
|
498
|
+
*
|
|
499
|
+
* **The slot is SHARED, and the other writer wins on one path.**
|
|
500
|
+
* `ModelSubmissionHandler`'s live validation writes the same slot, clearing
|
|
501
|
+
* it with `severity: 'NONE'` when it finishes, and an adopter dispatching its
|
|
502
|
+
* own `StatusAction` replaces this one too. Nothing re-asserts it. That is
|
|
503
|
+
* harmless while a document is being edited, because a resubmit is skipped
|
|
504
|
+
* once the AST is broken (see {@link doUpdateAndSubmit}) — but NOT at load:
|
|
505
|
+
* the initial `requestModel` submit is not that skipped path, so a diagram
|
|
506
|
+
* opened on an already-broken document shows this band and then loses it to
|
|
507
|
+
* the validation clear a moment later. Measured on a browser host, polling the
|
|
508
|
+
* overlay: no element, empty, the sentence, empty again.
|
|
448
509
|
*/
|
|
449
510
|
onParseErrorChanged(_document, broken) {
|
|
450
|
-
return [
|
|
511
|
+
return [
|
|
512
|
+
SetEditModeAction.create(broken ? EditMode.READONLY : EditMode.EDITABLE),
|
|
513
|
+
broken
|
|
514
|
+
? StatusAction.create(this.sharedServices.MessageRenderer.renderMessage(DIAGRAM_READONLY_PARSE_ERROR), {
|
|
515
|
+
severity: 'WARNING'
|
|
516
|
+
})
|
|
517
|
+
: // `NONE` is the client's own spelling for "clear", not a severity it
|
|
518
|
+
// renders: `StatusOverlay.handle` branches on it before touching the
|
|
519
|
+
// DOM. An empty message at any other severity leaves an empty band
|
|
520
|
+
// with a warning icon standing on the canvas.
|
|
521
|
+
StatusAction.create('', { severity: 'NONE' })
|
|
522
|
+
];
|
|
451
523
|
}
|
|
452
524
|
/**
|
|
453
525
|
* Seam: extra actions to dispatch right after the initial settled root is
|
|
@@ -540,15 +612,18 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
540
612
|
* A model request DOES carry a request id, so a throw here takes the
|
|
541
613
|
* client-request path rather than the toast path — and on that path `detail`
|
|
542
614
|
* comes from `cause?.toString?.()`. A single-argument throw therefore reaches
|
|
543
|
-
* neither the
|
|
544
|
-
* are addressed separately, as on the save path: `message`
|
|
545
|
-
* in the user's terms, `cause` names the
|
|
546
|
-
* missing.
|
|
615
|
+
* neither the server log nor the client console: both print `undefined`. So
|
|
616
|
+
* the two readers are addressed separately, as on the save path: `message`
|
|
617
|
+
* names what failed in the user's terms and is rendered, `cause` names the
|
|
618
|
+
* action and the option key that was missing and stays English. On THIS path
|
|
619
|
+
* the cause reaches only logs — `RejectAction.detail` is read by nothing but
|
|
620
|
+
* the client action-dispatcher's `logger.warn` — which is not what makes it
|
|
621
|
+
* English; its content is.
|
|
547
622
|
*/
|
|
548
623
|
getSourceUri(action) {
|
|
549
624
|
const sourceUri = action.options?.[SOURCE_URI_ARG];
|
|
550
625
|
if (typeof sourceUri !== 'string') {
|
|
551
|
-
throw new GLSPServerError(
|
|
626
|
+
throw new GLSPServerError(this.sharedServices.MessageRenderer.renderMessage(SOURCE_URI_MISSING), `no '${SOURCE_URI_ARG}' option on the ${action.kind} action (received ${typeof sourceUri})`);
|
|
552
627
|
}
|
|
553
628
|
return sourceUri;
|
|
554
629
|
}
|
|
@@ -559,17 +634,23 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
559
634
|
* {@link AbstractHydraniumGlspState.setSourceRoot}.
|
|
560
635
|
*
|
|
561
636
|
* A save action carries no request id, so a throw here reaches the user as a
|
|
562
|
-
* toast built from `message`,
|
|
563
|
-
*
|
|
564
|
-
*
|
|
565
|
-
*
|
|
566
|
-
*
|
|
567
|
-
*
|
|
637
|
+
* toast built from `message`, while `cause` travels in
|
|
638
|
+
* `MessageAction.details` — **which a Theia host DOES put in front of a
|
|
639
|
+
* user**, as a "Show details" button on the toast opening a dialog. So the
|
|
640
|
+
* two are not split by reachability; they are split by AUDIENCE, which is
|
|
641
|
+
* the older rule and the one that holds here. The message names what failed
|
|
642
|
+
* in the user's terms and is rendered; the cause names which lookups came
|
|
643
|
+
* back empty for whom, and stays English because a wire action kind, an
|
|
644
|
+
* option key and a client id address whoever composes the system — a
|
|
645
|
+
* translated developer string is a worse outcome than an untranslated one.
|
|
646
|
+
* Neither can name the URI — not having one IS the failure, and both sources
|
|
647
|
+
* are written together, so the typed `sourceUri` is equally empty whenever
|
|
648
|
+
* this fires.
|
|
568
649
|
*/
|
|
569
650
|
getFileUri(action) {
|
|
570
651
|
const uri = action.fileUri ?? this.state.get(SOURCE_URI_ARG);
|
|
571
652
|
if (!uri) {
|
|
572
|
-
throw new GLSPServerError(
|
|
653
|
+
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})`);
|
|
573
654
|
}
|
|
574
655
|
return uri;
|
|
575
656
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|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6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/glsp-server",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.33",
|
|
4
4
|
"description": "GLSP protocol head for the hydranium framework. Peer of @hydranium/core/lsp and @hydranium/data-server; built on @hydranium/core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hydranium",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@eclipse-glsp/protocol": "2.7.0",
|
|
89
89
|
"@eclipse-glsp/server": "2.7.0",
|
|
90
|
-
"@hydranium/core": "1.0.0-next.
|
|
91
|
-
"@hydranium/langium": "1.0.0-next.
|
|
92
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
90
|
+
"@hydranium/core": "1.0.0-next.33",
|
|
91
|
+
"@hydranium/langium": "1.0.0-next.33",
|
|
92
|
+
"@hydranium/protocol": "1.0.0-next.33",
|
|
93
93
|
"inversify": "6.2.2",
|
|
94
94
|
"reflect-metadata": "0.2.2",
|
|
95
95
|
"rimraf": "^5.0.0",
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
"peerDependencies": {
|
|
101
101
|
"@eclipse-glsp/protocol": "^2.6.0",
|
|
102
102
|
"@eclipse-glsp/server": "^2.6.0",
|
|
103
|
-
"@hydranium/core": "1.0.0-next.
|
|
104
|
-
"@hydranium/langium": "1.0.0-next.
|
|
105
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
103
|
+
"@hydranium/core": "1.0.0-next.33",
|
|
104
|
+
"@hydranium/langium": "1.0.0-next.33",
|
|
105
|
+
"@hydranium/protocol": "1.0.0-next.33",
|
|
106
106
|
"inversify": "^6.0.0",
|
|
107
107
|
"reflect-metadata": "^0.2.2",
|
|
108
108
|
"vscode-jsonrpc": "9.0.1",
|
|
@@ -26,9 +26,10 @@ import { injectable } from 'inversify';
|
|
|
26
26
|
* `error.cause?.toString()` whenever the error is a {@link GLSPServerError},
|
|
27
27
|
* and that one value feeds both the server log and the client's
|
|
28
28
|
* {@link RejectAction}. A {@link GLSPServerError} carrying no `cause` therefore
|
|
29
|
-
* reaches
|
|
30
|
-
* while a plain `Error` survives,
|
|
31
|
-
* itself. The typed error is the trap,
|
|
29
|
+
* reaches its readers as `undefined` — the log line and the client's
|
|
30
|
+
* action-dispatcher warning both print it — while a plain `Error` survives,
|
|
31
|
+
* because the other branch reads the error itself. The typed error is the trap,
|
|
32
|
+
* and it is the one upstream's own
|
|
32
33
|
* `getOrThrow` helper raises: that helper's signature cannot pass a `cause`, so
|
|
33
34
|
* an adopter using the sanctioned helper has no fix available on their side.
|
|
34
35
|
* Restating the cause at each throw site is the alternative, and it costs
|
package/src/messages/index.ts
CHANGED
|
@@ -10,11 +10,16 @@
|
|
|
10
10
|
/**
|
|
11
11
|
* Every user-facing message `@hydranium/glsp-server` raises.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* the
|
|
13
|
+
* **Each one is rendered AT ITS RAISE SITE**, through the shared
|
|
14
|
+
* `MessageRenderer`, because GLSP's action protocol carries no slot for an
|
|
15
|
+
* identity on any of its actions — so the identity is gone the moment a raise
|
|
16
|
+
* site formats its text, and there is nothing at the error boundary to render
|
|
17
|
+
* from. That makes this head the one place where a new message can ship
|
|
18
|
+
* unrendered without any single chokepoint noticing, which is why the package's
|
|
19
|
+
* own test suite scans for a declaration reached by `.format()` instead.
|
|
20
|
+
*
|
|
21
|
+
* The barrel is also how an adopter rendering their own diagram chrome
|
|
22
|
+
* discovers the codes exist.
|
|
18
23
|
*/
|
|
19
24
|
|
|
20
|
-
export { SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
|
|
25
|
+
export { DIAGRAM_READONLY_PARSE_ERROR, SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
|
|
10
|
-
import { MarkersReason, SetMarkersAction } from '@eclipse-glsp/protocol';
|
|
10
|
+
import { MarkersReason, SetMarkersAction, StatusAction } from '@eclipse-glsp/protocol';
|
|
11
11
|
import {
|
|
12
12
|
type Action,
|
|
13
13
|
ActionDispatcher,
|
|
@@ -43,15 +43,16 @@ import { HydraniumTypes } from '../state/hydranium-shared-core-services.js';
|
|
|
43
43
|
import { DEFAULT_SAVE_CONFLICT_POLICY, SaveConflictPolicy } from './save-conflict-policy.js';
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* A save action arrived with nowhere to write to.
|
|
46
|
+
* A save action arrived with nowhere to write to. A save action carries no
|
|
47
|
+
* request id, so it falls through to the error handler and `message` becomes
|
|
48
|
+
* the toast text.
|
|
47
49
|
*
|
|
48
|
-
*
|
|
49
|
-
* action
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* `cause?.toString?.()`, so a code there would sit inside human text.
|
|
50
|
+
* Rendered at the raise site rather than by a carrier method, because GLSP's
|
|
51
|
+
* action protocol has no slot for an identity anywhere — every member of its
|
|
52
|
+
* message, status and reject actions is prose or an enum, and
|
|
53
|
+
* `MessageAction.details` is not a substitute since it is prose populated from
|
|
54
|
+
* `cause?.toString?.()`, and a Theia host shows it to a user on demand. So the
|
|
55
|
+
* throw is the last place that still knows which message this is.
|
|
55
56
|
*/
|
|
56
57
|
export const SAVE_TARGET_UNKNOWN = defineMessage(
|
|
57
58
|
'hydranium/glsp-server/save-target-unknown',
|
|
@@ -60,16 +61,38 @@ export const SAVE_TARGET_UNKNOWN = defineMessage(
|
|
|
60
61
|
|
|
61
62
|
/**
|
|
62
63
|
* A model request arrived without the source URI it is required to carry.
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* protocol has no slot for an identity, so the English is what a client
|
|
66
|
-
* receives.
|
|
64
|
+
* Rendered at the raise site, like its save-path sibling and for the same
|
|
65
|
+
* reason.
|
|
67
66
|
*/
|
|
68
67
|
export const SOURCE_URI_MISSING = defineMessage(
|
|
69
68
|
'hydranium/glsp-server/source-uri-missing',
|
|
70
69
|
'Could not open this model: the request did not say which document to load'
|
|
71
70
|
);
|
|
72
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Why the canvas has stopped accepting edits.
|
|
74
|
+
*
|
|
75
|
+
* **A READONLY canvas is otherwise indistinguishable from a broken one.** The
|
|
76
|
+
* client's answer to {@link SetEditModeAction} is to withdraw the tool palette,
|
|
77
|
+
* so the surface a reader was working in silently loses the only control it had,
|
|
78
|
+
* with the cause — a syntax error in a document that may not even be open —
|
|
79
|
+
* nowhere on screen. The mode flip is the mechanism; this is the only part of it
|
|
80
|
+
* a user can see.
|
|
81
|
+
*
|
|
82
|
+
* Rendered at the raise site, like its two siblings above and for the same
|
|
83
|
+
* reason: every member of GLSP's status action is prose or an enum.
|
|
84
|
+
*
|
|
85
|
+
* It names the recovery rather than the fault, because the fault already has a
|
|
86
|
+
* surface — the squiggle and the problems list, both of which say WHICH
|
|
87
|
+
* character — and repeating it here would put a second, less precise account of
|
|
88
|
+
* the same error on screen. What no other surface says is that the diagram is
|
|
89
|
+
* waiting on it.
|
|
90
|
+
*/
|
|
91
|
+
export const DIAGRAM_READONLY_PARSE_ERROR = defineMessage(
|
|
92
|
+
'hydranium/glsp-server/diagram-readonly-parse-error',
|
|
93
|
+
'Read-only: this document has a syntax error. Fix it to edit the diagram again.'
|
|
94
|
+
);
|
|
95
|
+
|
|
73
96
|
/** Window (ms) over which back-to-back external rebuilds collapse into one resubmit. */
|
|
74
97
|
const EXTERNAL_SUBMIT_DEBOUNCE_MS = 250;
|
|
75
98
|
|
|
@@ -263,12 +286,29 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
263
286
|
}
|
|
264
287
|
|
|
265
288
|
/**
|
|
266
|
-
* Capture the initial settled root and apply the initial edit mode.
|
|
267
|
-
*
|
|
268
|
-
* the first {@link handleModelUpdated} (at `Validated`, with diagnostics) flips
|
|
269
|
-
* it READONLY if the document has structural parse errors. Edit-mode +
|
|
270
|
-
* settle-hook actions are dispatched on a macrotask so the initial
|
|
289
|
+
* Capture the initial settled root and apply the initial edit mode. Edit-mode
|
|
290
|
+
* + settle-hook actions are dispatched on a macrotask so the initial
|
|
271
291
|
* `requestModel → setModel` handshake isn't perturbed.
|
|
292
|
+
*
|
|
293
|
+
* **Whether the settled document carries diagnostics depends on how far it
|
|
294
|
+
* had already got, so the initial edit mode has two correct outcomes rather
|
|
295
|
+
* than one.** `settled()` strips nothing: it resolves AT OR ABOVE the
|
|
296
|
+
* integrity landmark and hands back the live document's own array. Its
|
|
297
|
+
* `AstDocument<TAst, never>` return type asserts emptiness for a document the
|
|
298
|
+
* wait had to DRIVE to that landmark, which is pre-validation — and for that
|
|
299
|
+
* one the mode here is `EDITABLE` and the flip to READONLY arrives with the
|
|
300
|
+
* first {@link handleModelUpdated}. A document already past `Validated` when
|
|
301
|
+
* the session opened resolves immediately with its diagnostics intact, and is
|
|
302
|
+
* decided correctly here with no later update owed. Any host that validates
|
|
303
|
+
* its workspace before a diagram is opened produces the second case, so
|
|
304
|
+
* neither is exceptional.
|
|
305
|
+
*
|
|
306
|
+
* **A correct decision is not a delivered one.** This dispatch happens inside
|
|
307
|
+
* the initial `requestModel`, before the client has the model — so the UI
|
|
308
|
+
* extensions that answer {@link onParseErrorChanged}'s actions are not yet
|
|
309
|
+
* constructed, and a canvas that opens READONLY over a broken document shows
|
|
310
|
+
* none of that feedback. The same timer carries {@link onSourceModelSettled},
|
|
311
|
+
* so an adopter's own initial actions have it too.
|
|
272
312
|
*/
|
|
273
313
|
protected async captureSettledRoot(rootUri: string, document: AstDocument<AstNode, never>): Promise<void> {
|
|
274
314
|
this.state.setSourceRoot(rootUri, document.root as TRoot);
|
|
@@ -361,9 +401,10 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
361
401
|
*
|
|
362
402
|
* Synchronous by construction — the phase-agnostic lookup door plus the shared
|
|
363
403
|
* projection — so reacting to a secondary neither waits nor can force a build.
|
|
364
|
-
* `settled()` is not an alternative:
|
|
365
|
-
*
|
|
366
|
-
*
|
|
404
|
+
* `settled()` is not an alternative: besides being asynchronous, it cannot be
|
|
405
|
+
* relied on to carry diagnostics — a document it has to drive to the landmark
|
|
406
|
+
* arrives pre-validation with an empty array — and diagnostics are the reason
|
|
407
|
+
* {@link doUpdateAndSubmit} takes a separate event document at all.
|
|
367
408
|
*/
|
|
368
409
|
protected currentPrimaryDocument(): AstDocument<AstNode, unknown> | undefined {
|
|
369
410
|
const document = this.sharedServices.model.ModelService.getDocument(this.state.sourceUri);
|
|
@@ -446,8 +487,10 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
446
487
|
/**
|
|
447
488
|
* Re-settle to a guaranteed fully-linked + reprojected root, capture it, and
|
|
448
489
|
* (unless suppressed) resubmit a deduped external GModel. Diagnostics for the
|
|
449
|
-
* edit-mode decision come from the event document
|
|
450
|
-
*
|
|
490
|
+
* edit-mode decision come from the event document, because the re-settled one
|
|
491
|
+
* cannot be relied on to have any: a document driven to the landmark arrives
|
|
492
|
+
* pre-validation, and this path re-settles precisely to escape a transient
|
|
493
|
+
* mid-rebuild snapshot.
|
|
451
494
|
*/
|
|
452
495
|
protected async doUpdateAndSubmit(rootUri: string, eventDocument: AstDocument<AstNode, unknown>): Promise<Action[]> {
|
|
453
496
|
// Settle-gate the capture: never setSourceRoot off the event's possibly-transient
|
|
@@ -509,15 +552,48 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
509
552
|
}
|
|
510
553
|
|
|
511
554
|
/**
|
|
512
|
-
* Seam: actions to emit when the structural-broken state transitions.
|
|
513
|
-
* a
|
|
514
|
-
* disabled while the syntax is broken but re-enabled once it parses, a
|
|
515
|
-
* generic for any Langium-backed diagram
|
|
516
|
-
*
|
|
517
|
-
*
|
|
555
|
+
* Seam: actions to emit when the structural-broken state transitions.
|
|
556
|
+
* Default: a {@link SetEditModeAction} toggling READONLY ↔ EDITABLE — editing
|
|
557
|
+
* is disabled while the syntax is broken but re-enabled once it parses, a
|
|
558
|
+
* sound generic for any Langium-backed diagram — plus the
|
|
559
|
+
* {@link DIAGRAM_READONLY_PARSE_ERROR} band that says why, cleared on the way
|
|
560
|
+
* back. Adopters override to add or replace the transition feedback. The
|
|
561
|
+
* {@link AbstractHydraniumGlspState.editMode} flip itself is owned by
|
|
562
|
+
* {@link refreshEditMode}.
|
|
563
|
+
*
|
|
564
|
+
* **Both actions or neither, which is why they are one seam rather than
|
|
565
|
+
* two.** The mode flip removes the tool palette and the band is the only
|
|
566
|
+
* account of that, so an override that keeps one and drops the other produces
|
|
567
|
+
* either an unexplained loss of the palette or a warning about a restriction
|
|
568
|
+
* that is not in force.
|
|
569
|
+
*
|
|
570
|
+
* **The status is dispatched with no `timeout`, so it persists** — a
|
|
571
|
+
* time-limited band would describe a condition that outlasts it.
|
|
572
|
+
*
|
|
573
|
+
* **The slot is SHARED, and the other writer wins on one path.**
|
|
574
|
+
* `ModelSubmissionHandler`'s live validation writes the same slot, clearing
|
|
575
|
+
* it with `severity: 'NONE'` when it finishes, and an adopter dispatching its
|
|
576
|
+
* own `StatusAction` replaces this one too. Nothing re-asserts it. That is
|
|
577
|
+
* harmless while a document is being edited, because a resubmit is skipped
|
|
578
|
+
* once the AST is broken (see {@link doUpdateAndSubmit}) — but NOT at load:
|
|
579
|
+
* the initial `requestModel` submit is not that skipped path, so a diagram
|
|
580
|
+
* opened on an already-broken document shows this band and then loses it to
|
|
581
|
+
* the validation clear a moment later. Measured on a browser host, polling the
|
|
582
|
+
* overlay: no element, empty, the sentence, empty again.
|
|
518
583
|
*/
|
|
519
584
|
protected onParseErrorChanged(_document: AstDocument<AstNode, unknown>, broken: boolean): Action[] {
|
|
520
|
-
return [
|
|
585
|
+
return [
|
|
586
|
+
SetEditModeAction.create(broken ? EditMode.READONLY : EditMode.EDITABLE),
|
|
587
|
+
broken
|
|
588
|
+
? StatusAction.create(this.sharedServices.MessageRenderer.renderMessage(DIAGRAM_READONLY_PARSE_ERROR), {
|
|
589
|
+
severity: 'WARNING'
|
|
590
|
+
})
|
|
591
|
+
: // `NONE` is the client's own spelling for "clear", not a severity it
|
|
592
|
+
// renders: `StatusOverlay.handle` branches on it before touching the
|
|
593
|
+
// DOM. An empty message at any other severity leaves an empty band
|
|
594
|
+
// with a warning icon standing on the canvas.
|
|
595
|
+
StatusAction.create('', { severity: 'NONE' })
|
|
596
|
+
];
|
|
521
597
|
}
|
|
522
598
|
|
|
523
599
|
/**
|
|
@@ -616,16 +692,19 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
616
692
|
* A model request DOES carry a request id, so a throw here takes the
|
|
617
693
|
* client-request path rather than the toast path — and on that path `detail`
|
|
618
694
|
* comes from `cause?.toString?.()`. A single-argument throw therefore reaches
|
|
619
|
-
* neither the
|
|
620
|
-
* are addressed separately, as on the save path: `message`
|
|
621
|
-
* in the user's terms, `cause` names the
|
|
622
|
-
* missing.
|
|
695
|
+
* neither the server log nor the client console: both print `undefined`. So
|
|
696
|
+
* the two readers are addressed separately, as on the save path: `message`
|
|
697
|
+
* names what failed in the user's terms and is rendered, `cause` names the
|
|
698
|
+
* action and the option key that was missing and stays English. On THIS path
|
|
699
|
+
* the cause reaches only logs — `RejectAction.detail` is read by nothing but
|
|
700
|
+
* the client action-dispatcher's `logger.warn` — which is not what makes it
|
|
701
|
+
* English; its content is.
|
|
623
702
|
*/
|
|
624
703
|
protected getSourceUri(action: RequestModelAction): string {
|
|
625
704
|
const sourceUri = action.options?.[SOURCE_URI_ARG];
|
|
626
705
|
if (typeof sourceUri !== 'string') {
|
|
627
706
|
throw new GLSPServerError(
|
|
628
|
-
|
|
707
|
+
this.sharedServices.MessageRenderer.renderMessage(SOURCE_URI_MISSING),
|
|
629
708
|
`no '${SOURCE_URI_ARG}' option on the ${action.kind} action (received ${typeof sourceUri})`
|
|
630
709
|
);
|
|
631
710
|
}
|
|
@@ -639,18 +718,24 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
639
718
|
* {@link AbstractHydraniumGlspState.setSourceRoot}.
|
|
640
719
|
*
|
|
641
720
|
* A save action carries no request id, so a throw here reaches the user as a
|
|
642
|
-
* toast built from `message`,
|
|
643
|
-
*
|
|
644
|
-
*
|
|
645
|
-
*
|
|
646
|
-
*
|
|
647
|
-
*
|
|
721
|
+
* toast built from `message`, while `cause` travels in
|
|
722
|
+
* `MessageAction.details` — **which a Theia host DOES put in front of a
|
|
723
|
+
* user**, as a "Show details" button on the toast opening a dialog. So the
|
|
724
|
+
* two are not split by reachability; they are split by AUDIENCE, which is
|
|
725
|
+
* the older rule and the one that holds here. The message names what failed
|
|
726
|
+
* in the user's terms and is rendered; the cause names which lookups came
|
|
727
|
+
* back empty for whom, and stays English because a wire action kind, an
|
|
728
|
+
* option key and a client id address whoever composes the system — a
|
|
729
|
+
* translated developer string is a worse outcome than an untranslated one.
|
|
730
|
+
* Neither can name the URI — not having one IS the failure, and both sources
|
|
731
|
+
* are written together, so the typed `sourceUri` is equally empty whenever
|
|
732
|
+
* this fires.
|
|
648
733
|
*/
|
|
649
734
|
protected getFileUri(action: SaveModelAction): string {
|
|
650
735
|
const uri = action.fileUri ?? this.state.get<string>(SOURCE_URI_ARG);
|
|
651
736
|
if (!uri) {
|
|
652
737
|
throw new GLSPServerError(
|
|
653
|
-
|
|
738
|
+
this.sharedServices.MessageRenderer.renderMessage(SAVE_TARGET_UNKNOWN),
|
|
654
739
|
`no fileUri on the save action and no ${SOURCE_URI_ARG} in the model state (clientId=${this.state.clientId})`
|
|
655
740
|
);
|
|
656
741
|
}
|