@hydranium/glsp-server 1.0.0-next.6 → 1.0.0-next.60
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 +9 -0
- 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 +24 -0
- package/lib/messages/index.d.ts.map +1 -0
- package/lib/messages/index.js +24 -0
- package/lib/messages/index.js.map +1 -0
- package/lib/state/reconcile-source-model-write.d.ts.map +1 -1
- package/lib/state/reconcile-source-model-write.js +3 -3
- package/lib/state/reconcile-source-model-write.js.map +1 -1
- package/lib/storage/hydranium-glsp-storage.d.ts +120 -22
- package/lib/storage/hydranium-glsp-storage.d.ts.map +1 -1
- package/lib/storage/hydranium-glsp-storage.js +136 -27
- package/lib/storage/hydranium-glsp-storage.js.map +1 -1
- package/lib/validation/diagnostic-markers.js +7 -0
- package/lib/validation/diagnostic-markers.js.map +1 -1
- package/package.json +17 -8
- package/src/launcher/hydranium-glsp-server.ts +4 -3
- package/src/messages/index.ts +25 -0
- package/src/state/reconcile-source-model-write.ts +5 -3
- package/src/storage/hydranium-glsp-storage.ts +151 -27
- package/src/validation/diagnostic-markers.ts +8 -1
package/README.md
CHANGED
|
@@ -49,6 +49,15 @@ dependency is `uuid`. You must already have a composed hydranium shared services
|
|
|
49
49
|
tree, a grammar, and a GModel factory of your own — there is no framework GModel
|
|
50
50
|
factory.
|
|
51
51
|
|
|
52
|
+
**This head needs one line in your own root manifest, and the install works
|
|
53
|
+
without it right up until the server starts.** `@eclipse-glsp/*` depends on
|
|
54
|
+
`vscode-jsonrpc@8.2.0` exactly, while the Langium chain under hydranium pins the
|
|
55
|
+
transport at `9.0.1` — the version this package declares as its peer. Two
|
|
56
|
+
physical copies in one process throw `Unknown parameter structure auto` during
|
|
57
|
+
GLSP server init, and no peer declaration can prevent a nested copy. Add an
|
|
58
|
+
`overrides` block collapsing the chain and reinstall from scratch;
|
|
59
|
+
[Requirements](../../docs/adopting/requirements.md) gives the exact block.
|
|
60
|
+
|
|
52
61
|
## Exports
|
|
53
62
|
|
|
54
63
|
| subpath | holds | platform |
|
|
@@ -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/laun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M,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAChD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,SAAS,IAAI,EAAE,MAAM,CAAC,CAAC;YAC9F,IAAI,CAAC;gBACF,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,6BAA6B,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,SAAS,GAAG,EAAE;oBACnG,UAAU,EAAE,MAAM,CAAC,SAAS;oBAC5B,MAAM;iBACR,CAAC,CAAC;gBACH,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC/C,CAAC;YAAC,OAAO,SAAkB,EAAE,CAAC;gBAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yCAAyC,MAAM,CAAC,SAAS,IAAI,EAAE,SAAS,CAAC,CAAC;YAC/F,CAAC;QACJ,CAAC;IACJ,CAAC;CACH,CAAA;AA1DY,mBAAmB;IAD/B,UAAU,EAAE;GACA,mBAAmB,CA0D/B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
* Every user-facing message `@hydranium/glsp-server` raises.
|
|
11
|
+
*
|
|
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.
|
|
22
|
+
*/
|
|
23
|
+
export { DIAGRAM_READONLY_PARSE_ERROR, SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
* Every user-facing message `@hydranium/glsp-server` raises.
|
|
11
|
+
*
|
|
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.
|
|
22
|
+
*/
|
|
23
|
+
export { DIAGRAM_READONLY_PARSE_ERROR, SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-source-model-write.d.ts","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,MAAM,EAAmB,MAAM,qBAAqB,CAAC;AAE1F;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM;IAC1C;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,uEAAuE;IACvE,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACvC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,iBAAiB,IAAI,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,SAAS,MAAM,EAClE,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"reconcile-source-model-write.d.ts","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,MAAM,EAAmB,MAAM,qBAAqB,CAAC;AAE1F;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM;IAC1C;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,uEAAuE;IACvE,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACvC,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,iBAAiB,IAAI,IAAI,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,SAAS,MAAM,EAClE,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,KAAK,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
|
@@ -30,15 +30,15 @@ export async function reconcileSourceModelWrite(model, version, hooks) {
|
|
|
30
30
|
await hooks.persist(outcome.merged);
|
|
31
31
|
return;
|
|
32
32
|
case 'no-op':
|
|
33
|
-
hooks.logger.debug(`updateSourceModel no-op (v${err.
|
|
33
|
+
hooks.logger.debug(`updateSourceModel no-op (v${err.expectedVersion} → v${err.actualVersion}); already in sync`);
|
|
34
34
|
return;
|
|
35
35
|
case 'conflict':
|
|
36
|
-
hooks.logger.warn(`updateSourceModel conflict (v${err.
|
|
36
|
+
hooks.logger.warn(`updateSourceModel conflict (v${err.expectedVersion} → v${err.actualVersion}); dropping the diagram edit — ` +
|
|
37
37
|
'a foreign writer changed the same field');
|
|
38
38
|
hooks.onConflictDropped();
|
|
39
39
|
return;
|
|
40
40
|
case 'unavailable':
|
|
41
|
-
hooks.logger.warn(`updateSourceModel refetch unavailable (v${err.
|
|
41
|
+
hooks.logger.warn(`updateSourceModel refetch unavailable (v${err.expectedVersion} → v${err.actualVersion}); forcing without version`);
|
|
42
42
|
await hooks.persist(model);
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile-source-model-write.js","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAsC,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA0B1F;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC5C,KAAa,EACb,OAA2B,EAC3B,KAAoC;IAEpC,IAAI,CAAC;QACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACZ,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAC;QACb,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5G,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,QAAQ;gBACV,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACpC,OAAO;YACV,KAAK,OAAO;gBACT,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"reconcile-source-model-write.js","sourceRoot":"","sources":["../../src/state/reconcile-source-model-write.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAsC,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA0B1F;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC5C,KAAa,EACb,OAA2B,EAC3B,KAAoC;IAEpC,IAAI,CAAC;QACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACZ,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAC;QACb,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5G,QAAQ,OAAO,CAAC,MAAM,EAAE,CAAC;YACtB,KAAK,QAAQ;gBACV,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBACpC,OAAO;YACV,KAAK,OAAO;gBACT,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,GAAG,CAAC,eAAe,OAAO,GAAG,CAAC,aAAa,oBAAoB,CAAC,CAAC;gBACjH,OAAO;YACV,KAAK,UAAU;gBACZ,KAAK,CAAC,MAAM,CAAC,IAAI,CACd,gCAAgC,GAAG,CAAC,eAAe,OAAO,GAAG,CAAC,aAAa,iCAAiC;oBACzG,yCAAyC,CAC9C,CAAC;gBACF,KAAK,CAAC,iBAAiB,EAAE,CAAC;gBAC1B,OAAO;YACV,KAAK,aAAa;gBACf,KAAK,CAAC,MAAM,CAAC,IAAI,CACd,2CAA2C,GAAG,CAAC,eAAe,OAAO,GAAG,CAAC,aAAa,4BAA4B,CACpH,CAAC;gBACF,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC3B,OAAO;QACb,CAAC;IACJ,CAAC;AACJ,CAAC"}
|
|
@@ -13,6 +13,45 @@ import { AstDocument, type AstDocumentSavedEvent, type AstDocumentUpdatedEvent,
|
|
|
13
13
|
import { type AbstractHydraniumGlspState } from '../state/abstract-hydranium-glsp-state.js';
|
|
14
14
|
import { type HydraniumGlspSubmissionHandler } from '../submission/hydranium-glsp-submission-handler.js';
|
|
15
15
|
import { SaveConflictPolicy } from './save-conflict-policy.js';
|
|
16
|
+
/**
|
|
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.
|
|
20
|
+
*
|
|
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.
|
|
27
|
+
*/
|
|
28
|
+
export declare const SAVE_TARGET_UNKNOWN: import("@hydranium/protocol").MessageDefinition<"Could not determine where to save this model">;
|
|
29
|
+
/**
|
|
30
|
+
* A model request arrived without the source URI it is required to carry.
|
|
31
|
+
* Rendered at the raise site, like its save-path sibling and for the same
|
|
32
|
+
* reason.
|
|
33
|
+
*/
|
|
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.">;
|
|
16
55
|
/**
|
|
17
56
|
* GLSP source-model storage base shared by all hydranium adopters.
|
|
18
57
|
* Provides the DI signature, the {@link ClientSessionListener} +
|
|
@@ -120,12 +159,29 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
120
159
|
loadSourceModel(action: RequestModelAction): MaybePromise<void>;
|
|
121
160
|
protected doLoadSourceModel(action: RequestModelAction): Promise<void>;
|
|
122
161
|
/**
|
|
123
|
-
* Capture the initial settled root and apply the initial edit mode.
|
|
124
|
-
*
|
|
125
|
-
* the first {@link handleModelUpdated} (at `Validated`, with diagnostics) flips
|
|
126
|
-
* it READONLY if the document has structural parse errors. Edit-mode +
|
|
127
|
-
* 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
|
|
128
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.
|
|
129
185
|
*/
|
|
130
186
|
protected captureSettledRoot(rootUri: string, document: AstDocument<AstNode, never>): Promise<void>;
|
|
131
187
|
/**
|
|
@@ -178,9 +234,10 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
178
234
|
*
|
|
179
235
|
* Synchronous by construction — the phase-agnostic lookup door plus the shared
|
|
180
236
|
* projection — so reacting to a secondary neither waits nor can force a build.
|
|
181
|
-
* `settled()` is not an alternative:
|
|
182
|
-
*
|
|
183
|
-
*
|
|
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.
|
|
184
241
|
*/
|
|
185
242
|
protected currentPrimaryDocument(): AstDocument<AstNode, unknown> | undefined;
|
|
186
243
|
/**
|
|
@@ -222,8 +279,10 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
222
279
|
/**
|
|
223
280
|
* Re-settle to a guaranteed fully-linked + reprojected root, capture it, and
|
|
224
281
|
* (unless suppressed) resubmit a deduped external GModel. Diagnostics for the
|
|
225
|
-
* edit-mode decision come from the event document
|
|
226
|
-
*
|
|
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.
|
|
227
286
|
*/
|
|
228
287
|
protected doUpdateAndSubmit(rootUri: string, eventDocument: AstDocument<AstNode, unknown>): Promise<Action[]>;
|
|
229
288
|
/**
|
|
@@ -241,12 +300,34 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
241
300
|
*/
|
|
242
301
|
protected isStructurallyBroken(document: AstDocument<AstNode, unknown>): boolean;
|
|
243
302
|
/**
|
|
244
|
-
* Seam: actions to emit when the structural-broken state transitions.
|
|
245
|
-
* a
|
|
246
|
-
* disabled while the syntax is broken but re-enabled once it parses, a
|
|
247
|
-
* generic for any Langium-backed diagram
|
|
248
|
-
*
|
|
249
|
-
*
|
|
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.
|
|
250
331
|
*/
|
|
251
332
|
protected onParseErrorChanged(_document: AstDocument<AstNode, unknown>, broken: boolean): Action[];
|
|
252
333
|
/**
|
|
@@ -305,6 +386,17 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
305
386
|
*
|
|
306
387
|
* Returns it VERBATIM, in whatever form the client sent;
|
|
307
388
|
* {@link toSourceModelUri} is what normalises it.
|
|
389
|
+
*
|
|
390
|
+
* A model request DOES carry a request id, so a throw here takes the
|
|
391
|
+
* client-request path rather than the toast path — and on that path `detail`
|
|
392
|
+
* comes from `cause?.toString?.()`. A single-argument throw therefore reaches
|
|
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.
|
|
308
400
|
*/
|
|
309
401
|
protected getSourceUri(action: RequestModelAction): string;
|
|
310
402
|
/**
|
|
@@ -314,12 +406,18 @@ export declare class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel =
|
|
|
314
406
|
* {@link AbstractHydraniumGlspState.setSourceRoot}.
|
|
315
407
|
*
|
|
316
408
|
* A save action carries no request id, so a throw here reaches the user as a
|
|
317
|
-
* toast built from `message`,
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
*
|
|
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.
|
|
323
421
|
*/
|
|
324
422
|
protected getFileUri(action: SaveModelAction): string;
|
|
325
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,E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) || 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
26
|
import { DEFAULT_SAVE_CONFLICT_POLICY, SaveConflictPolicy } from './save-conflict-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
|
/**
|
|
@@ -192,12 +231,29 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
192
231
|
await this.captureSettledRoot(rootUri, document);
|
|
193
232
|
}
|
|
194
233
|
/**
|
|
195
|
-
* Capture the initial settled root and apply the initial edit mode.
|
|
196
|
-
*
|
|
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
|
|
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
|
|
200
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.
|
|
201
257
|
*/
|
|
202
258
|
async captureSettledRoot(rootUri, document) {
|
|
203
259
|
this.state.setSourceRoot(rootUri, document.root);
|
|
@@ -284,9 +340,10 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
284
340
|
*
|
|
285
341
|
* Synchronous by construction — the phase-agnostic lookup door plus the shared
|
|
286
342
|
* projection — so reacting to a secondary neither waits nor can force a build.
|
|
287
|
-
* `settled()` is not an alternative:
|
|
288
|
-
*
|
|
289
|
-
*
|
|
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.
|
|
290
347
|
*/
|
|
291
348
|
currentPrimaryDocument() {
|
|
292
349
|
const document = this.sharedServices.model.ModelService.getDocument(this.state.sourceUri);
|
|
@@ -360,8 +417,10 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
360
417
|
/**
|
|
361
418
|
* Re-settle to a guaranteed fully-linked + reprojected root, capture it, and
|
|
362
419
|
* (unless suppressed) resubmit a deduped external GModel. Diagnostics for the
|
|
363
|
-
* edit-mode decision come from the event document
|
|
364
|
-
*
|
|
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.
|
|
365
424
|
*/
|
|
366
425
|
async doUpdateAndSubmit(rootUri, eventDocument) {
|
|
367
426
|
// Settle-gate the capture: never setSourceRoot off the event's possibly-transient
|
|
@@ -419,15 +478,48 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
419
478
|
return document.diagnostics.some(diagnostic => isStructuralDiagnostic(diagnostic));
|
|
420
479
|
}
|
|
421
480
|
/**
|
|
422
|
-
* Seam: actions to emit when the structural-broken state transitions.
|
|
423
|
-
* a
|
|
424
|
-
* disabled while the syntax is broken but re-enabled once it parses, a
|
|
425
|
-
* generic for any Langium-backed diagram
|
|
426
|
-
*
|
|
427
|
-
*
|
|
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.
|
|
428
509
|
*/
|
|
429
510
|
onParseErrorChanged(_document, broken) {
|
|
430
|
-
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
|
+
];
|
|
431
523
|
}
|
|
432
524
|
/**
|
|
433
525
|
* Seam: extra actions to dispatch right after the initial settled root is
|
|
@@ -516,11 +608,22 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
516
608
|
*
|
|
517
609
|
* Returns it VERBATIM, in whatever form the client sent;
|
|
518
610
|
* {@link toSourceModelUri} is what normalises it.
|
|
611
|
+
*
|
|
612
|
+
* A model request DOES carry a request id, so a throw here takes the
|
|
613
|
+
* client-request path rather than the toast path — and on that path `detail`
|
|
614
|
+
* comes from `cause?.toString?.()`. A single-argument throw therefore reaches
|
|
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.
|
|
519
622
|
*/
|
|
520
623
|
getSourceUri(action) {
|
|
521
624
|
const sourceUri = action.options?.[SOURCE_URI_ARG];
|
|
522
625
|
if (typeof sourceUri !== 'string') {
|
|
523
|
-
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})`);
|
|
524
627
|
}
|
|
525
628
|
return sourceUri;
|
|
526
629
|
}
|
|
@@ -531,17 +634,23 @@ let HydraniumGlspStorage = class HydraniumGlspStorage {
|
|
|
531
634
|
* {@link AbstractHydraniumGlspState.setSourceRoot}.
|
|
532
635
|
*
|
|
533
636
|
* A save action carries no request id, so a throw here reaches the user as a
|
|
534
|
-
* toast built from `message`,
|
|
535
|
-
*
|
|
536
|
-
*
|
|
537
|
-
*
|
|
538
|
-
*
|
|
539
|
-
*
|
|
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.
|
|
540
649
|
*/
|
|
541
650
|
getFileUri(action) {
|
|
542
651
|
const uri = action.fileUri ?? this.state.get(SOURCE_URI_ARG);
|
|
543
652
|
if (!uri) {
|
|
544
|
-
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})`);
|
|
545
654
|
}
|
|
546
655
|
return uri;
|
|
547
656
|
}
|
|
@@ -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,g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,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;CACH,CAAA;AAnmByC;IAAtC,MAAM,CAAC,UAAU,CAAC;8BAA6B,UAAU;oDAAC;AACG;IAA7D,MAAM,CAAC,cAAc,CAAC,kBAAkB,CAAC;;4DAA0D;AAC7D;IAAtC,MAAM,CAAC,UAAU,CAAC;;mDAA4E;AAC9C;IAAhD,MAAM,CAAC,oBAAoB,CAAC;;4DAA0D;AAC1C;IAA5C,MAAM,CAAC,gBAAgB,CAAC;;8DAAwD;AAC9B;IAAlD,MAAM,CAAC,sBAAsB,CAAC;;+DAA4F;AAClF;IAAxC,MAAM,CAAC,YAAY,CAAC;;0DAAuD;AASrB;IAAtD,MAAM,CAAC,cAAc,CAAC;IAAE,QAAQ,EAAE;;4DAAoD;AAU5B;IAA1D,MAAM,CAAC,kBAAkB,CAAC;IAAE,QAAQ,EAAE;;qEAAiE;AAqC9F;IADT,aAAa,EAAE;;;;gDAcf;AA9ES,oBAAoB;IADhC,UAAU,EAAE;GACA,oBAAoB,CAsmBhC"}
|
|
@@ -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;AAElF,OAAO,EAAe,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAuB7E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAA6C,EAAE,OAAgC;IACjH,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC7C,0EAA0E;QAC1E,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACxD,KAAK,MAAM,SAAS,IAAI,kBAAkB,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC;YACvE,OAAO,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;QAC3E,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AAClB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"diagnostic-markers.js","sourceRoot":"","sources":["../../src/validation/diagnostic-markers.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAe,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAuB7E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAA6C,EAAE,OAAgC;IACjH,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,UAAU,CAAC,UAAU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ACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/glsp-server",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.60",
|
|
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",
|
|
@@ -48,6 +48,14 @@
|
|
|
48
48
|
"types": "./lib/node/index.d.ts",
|
|
49
49
|
"default": "./lib/node/index.js"
|
|
50
50
|
},
|
|
51
|
+
"./messages": {
|
|
52
|
+
"types": "./lib/messages/index.d.ts",
|
|
53
|
+
"default": "./lib/messages/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./lib/messages": {
|
|
56
|
+
"types": "./lib/messages/index.d.ts",
|
|
57
|
+
"default": "./lib/messages/index.js"
|
|
58
|
+
},
|
|
51
59
|
"./testing": {
|
|
52
60
|
"types": "./lib/testing/index.d.ts",
|
|
53
61
|
"default": "./lib/testing/index.js"
|
|
@@ -79,9 +87,9 @@
|
|
|
79
87
|
"devDependencies": {
|
|
80
88
|
"@eclipse-glsp/protocol": "2.7.0",
|
|
81
89
|
"@eclipse-glsp/server": "2.7.0",
|
|
82
|
-
"@hydranium/core": "1.0.0-next.
|
|
83
|
-
"@hydranium/langium": "1.0.0-next.
|
|
84
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
90
|
+
"@hydranium/core": "1.0.0-next.60",
|
|
91
|
+
"@hydranium/langium": "1.0.0-next.60",
|
|
92
|
+
"@hydranium/protocol": "1.0.0-next.60",
|
|
85
93
|
"inversify": "6.2.2",
|
|
86
94
|
"reflect-metadata": "0.2.2",
|
|
87
95
|
"rimraf": "^5.0.0",
|
|
@@ -92,12 +100,12 @@
|
|
|
92
100
|
"peerDependencies": {
|
|
93
101
|
"@eclipse-glsp/protocol": "^2.6.0",
|
|
94
102
|
"@eclipse-glsp/server": "^2.6.0",
|
|
95
|
-
"@hydranium/core": "1.0.0-next.
|
|
96
|
-
"@hydranium/langium": "1.0.0-next.
|
|
97
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
103
|
+
"@hydranium/core": "1.0.0-next.60",
|
|
104
|
+
"@hydranium/langium": "1.0.0-next.60",
|
|
105
|
+
"@hydranium/protocol": "1.0.0-next.60",
|
|
98
106
|
"inversify": "^6.0.0",
|
|
99
107
|
"reflect-metadata": "^0.2.2",
|
|
100
|
-
"vscode-jsonrpc": "
|
|
108
|
+
"vscode-jsonrpc": "9.0.1",
|
|
101
109
|
"vscode-languageserver-types": "^3.17.5"
|
|
102
110
|
},
|
|
103
111
|
"engines": {
|
|
@@ -106,6 +114,7 @@
|
|
|
106
114
|
"publishConfig": {
|
|
107
115
|
"access": "public"
|
|
108
116
|
},
|
|
117
|
+
"//peerDependencies": "`vscode-jsonrpc` is EXACT rather than a range, because it is one link of an atomic chain with no independently movable link: `vscode-languageserver-protocol` depends on it at exactly 9.0.1, so any other value an adopter supplies is a SECOND physical copy rather than an upgrade. This wire stack breaks on copy identity rather than on structure — `ParameterStructures.auto` is a singleton compared by `===` in connection.js, so a request type built by one copy and sent over a connection owned by the other throws `Unknown parameter structure auto`. A caret or union range was rejected because npm then resolves a `vscode-jsonrpc@8.2.0` tree SILENTLY, with no diagnostic at all, and the failure surfaces only later at server init. Exact does not fail the install either — npm downgrades an unsatisfiable peer to a warning — but it is a NAMED ERESOLVE warning printing the required version beside the found one, and a hard error for anyone installing with `--strict-peer-deps`. **This is the head where it is not enough**: `@eclipse-glsp/*` carries its own exact `vscode-jsonrpc@8.2.0` dependency and root `overrides` do not ship, so a first install of this package ALWAYS lands two copies and the adopter must pin the chain in their own manifest. docs/adopting/requirements.md carries the block to paste.",
|
|
109
118
|
"//prepack": "The publish guard, and it deliberately is NOT a `prepare`: npm runs a workspace `prepare` BEFORE the root `postinstall` that applies patches/vscode-jsonrpc+9.0.1.patch, so building there fails on a cold clone and npm rolls the entire install back. `prepack` runs only when a tarball is made (`npm pack`, `npm publish`) and never on install, so it cannot break the install it has no business touching. It FAILS rather than rebuilds, because the rebuild is exactly the part that ordering defeats. What it defends against: `files` lists `lib`, `lib` is gitignored, and a `files` entry matching nothing is skipped SILENTLY — so `npm publish` from an unbuilt tree emits a tarball of `src` and nothing else, with no error.",
|
|
110
119
|
"//sideEffects": "The harness bare-imports `reflect-metadata`, which installs a global `Reflect` polyfill the inversify decorators in this package need before any container is built. That effect is invisible from the module's exports, so a bundler that treats the file as pure may reorder or drop the import and every `@injectable` resolution then fails at runtime. The rest of the package constructs no module-level state beyond frozen constants and DI symbols."
|
|
111
120
|
}
|
|
@@ -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
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
11
|
+
* Every user-facing message `@hydranium/glsp-server` raises.
|
|
12
|
+
*
|
|
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.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
export { DIAGRAM_READONLY_PARSE_ERROR, SAVE_TARGET_UNKNOWN, SOURCE_URI_MISSING } from '../storage/hydranium-glsp-storage.js';
|
|
@@ -59,17 +59,19 @@ export async function reconcileSourceModelWrite<TModel extends object>(
|
|
|
59
59
|
await hooks.persist(outcome.merged);
|
|
60
60
|
return;
|
|
61
61
|
case 'no-op':
|
|
62
|
-
hooks.logger.debug(`updateSourceModel no-op (v${err.
|
|
62
|
+
hooks.logger.debug(`updateSourceModel no-op (v${err.expectedVersion} → v${err.actualVersion}); already in sync`);
|
|
63
63
|
return;
|
|
64
64
|
case 'conflict':
|
|
65
65
|
hooks.logger.warn(
|
|
66
|
-
`updateSourceModel conflict (v${err.
|
|
66
|
+
`updateSourceModel conflict (v${err.expectedVersion} → v${err.actualVersion}); dropping the diagram edit — ` +
|
|
67
67
|
'a foreign writer changed the same field'
|
|
68
68
|
);
|
|
69
69
|
hooks.onConflictDropped();
|
|
70
70
|
return;
|
|
71
71
|
case 'unavailable':
|
|
72
|
-
hooks.logger.warn(
|
|
72
|
+
hooks.logger.warn(
|
|
73
|
+
`updateSourceModel refetch unavailable (v${err.expectedVersion} → v${err.actualVersion}); forcing without version`
|
|
74
|
+
);
|
|
73
75
|
await hooks.persist(model);
|
|
74
76
|
return;
|
|
75
77
|
}
|
|
@@ -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,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
type SourceModelStorage,
|
|
32
32
|
TEMPORARY_CLIENT_ID
|
|
33
33
|
} from '@eclipse-glsp/server';
|
|
34
|
-
import { Debouncer, DisposableCollection } from '@hydranium/protocol';
|
|
34
|
+
import { Debouncer, defineMessage, DisposableCollection } from '@hydranium/protocol';
|
|
35
35
|
import { inject, injectable, optional, postConstruct } from 'inversify';
|
|
36
36
|
import { type AstNode } from '@hydranium/langium';
|
|
37
37
|
import { URI } from '@hydranium/langium';
|
|
@@ -42,6 +42,57 @@ import { type HydraniumGlspSubmissionHandler } from '../submission/hydranium-gls
|
|
|
42
42
|
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
|
+
/**
|
|
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.
|
|
49
|
+
*
|
|
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.
|
|
56
|
+
*/
|
|
57
|
+
export const SAVE_TARGET_UNKNOWN = defineMessage(
|
|
58
|
+
'hydranium/glsp-server/save-target-unknown',
|
|
59
|
+
'Could not determine where to save this model'
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A model request arrived without the source URI it is required to carry.
|
|
64
|
+
* Rendered at the raise site, like its save-path sibling and for the same
|
|
65
|
+
* reason.
|
|
66
|
+
*/
|
|
67
|
+
export const SOURCE_URI_MISSING = defineMessage(
|
|
68
|
+
'hydranium/glsp-server/source-uri-missing',
|
|
69
|
+
'Could not open this model: the request did not say which document to load'
|
|
70
|
+
);
|
|
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
|
+
|
|
45
96
|
/** Window (ms) over which back-to-back external rebuilds collapse into one resubmit. */
|
|
46
97
|
const EXTERNAL_SUBMIT_DEBOUNCE_MS = 250;
|
|
47
98
|
|
|
@@ -235,12 +286,29 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
235
286
|
}
|
|
236
287
|
|
|
237
288
|
/**
|
|
238
|
-
* Capture the initial settled root and apply the initial edit mode.
|
|
239
|
-
*
|
|
240
|
-
* the first {@link handleModelUpdated} (at `Validated`, with diagnostics) flips
|
|
241
|
-
* it READONLY if the document has structural parse errors. Edit-mode +
|
|
242
|
-
* 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
|
|
243
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.
|
|
244
312
|
*/
|
|
245
313
|
protected async captureSettledRoot(rootUri: string, document: AstDocument<AstNode, never>): Promise<void> {
|
|
246
314
|
this.state.setSourceRoot(rootUri, document.root as TRoot);
|
|
@@ -333,9 +401,10 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
333
401
|
*
|
|
334
402
|
* Synchronous by construction — the phase-agnostic lookup door plus the shared
|
|
335
403
|
* projection — so reacting to a secondary neither waits nor can force a build.
|
|
336
|
-
* `settled()` is not an alternative:
|
|
337
|
-
*
|
|
338
|
-
*
|
|
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.
|
|
339
408
|
*/
|
|
340
409
|
protected currentPrimaryDocument(): AstDocument<AstNode, unknown> | undefined {
|
|
341
410
|
const document = this.sharedServices.model.ModelService.getDocument(this.state.sourceUri);
|
|
@@ -418,8 +487,10 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
418
487
|
/**
|
|
419
488
|
* Re-settle to a guaranteed fully-linked + reprojected root, capture it, and
|
|
420
489
|
* (unless suppressed) resubmit a deduped external GModel. Diagnostics for the
|
|
421
|
-
* edit-mode decision come from the event document
|
|
422
|
-
*
|
|
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.
|
|
423
494
|
*/
|
|
424
495
|
protected async doUpdateAndSubmit(rootUri: string, eventDocument: AstDocument<AstNode, unknown>): Promise<Action[]> {
|
|
425
496
|
// Settle-gate the capture: never setSourceRoot off the event's possibly-transient
|
|
@@ -481,15 +552,48 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
481
552
|
}
|
|
482
553
|
|
|
483
554
|
/**
|
|
484
|
-
* Seam: actions to emit when the structural-broken state transitions.
|
|
485
|
-
* a
|
|
486
|
-
* disabled while the syntax is broken but re-enabled once it parses, a
|
|
487
|
-
* generic for any Langium-backed diagram
|
|
488
|
-
*
|
|
489
|
-
*
|
|
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.
|
|
490
583
|
*/
|
|
491
584
|
protected onParseErrorChanged(_document: AstDocument<AstNode, unknown>, broken: boolean): Action[] {
|
|
492
|
-
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
|
+
];
|
|
493
597
|
}
|
|
494
598
|
|
|
495
599
|
/**
|
|
@@ -584,11 +688,25 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
584
688
|
*
|
|
585
689
|
* Returns it VERBATIM, in whatever form the client sent;
|
|
586
690
|
* {@link toSourceModelUri} is what normalises it.
|
|
691
|
+
*
|
|
692
|
+
* A model request DOES carry a request id, so a throw here takes the
|
|
693
|
+
* client-request path rather than the toast path — and on that path `detail`
|
|
694
|
+
* comes from `cause?.toString?.()`. A single-argument throw therefore reaches
|
|
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.
|
|
587
702
|
*/
|
|
588
703
|
protected getSourceUri(action: RequestModelAction): string {
|
|
589
704
|
const sourceUri = action.options?.[SOURCE_URI_ARG];
|
|
590
705
|
if (typeof sourceUri !== 'string') {
|
|
591
|
-
throw new GLSPServerError(
|
|
706
|
+
throw new GLSPServerError(
|
|
707
|
+
this.sharedServices.MessageRenderer.renderMessage(SOURCE_URI_MISSING),
|
|
708
|
+
`no '${SOURCE_URI_ARG}' option on the ${action.kind} action (received ${typeof sourceUri})`
|
|
709
|
+
);
|
|
592
710
|
}
|
|
593
711
|
return sourceUri;
|
|
594
712
|
}
|
|
@@ -600,18 +718,24 @@ export class HydraniumGlspStorage<TRoot extends AstNode, TSourceModel = string>
|
|
|
600
718
|
* {@link AbstractHydraniumGlspState.setSourceRoot}.
|
|
601
719
|
*
|
|
602
720
|
* A save action carries no request id, so a throw here reaches the user as a
|
|
603
|
-
* toast built from `message`,
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
*
|
|
607
|
-
*
|
|
608
|
-
*
|
|
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.
|
|
609
733
|
*/
|
|
610
734
|
protected getFileUri(action: SaveModelAction): string {
|
|
611
735
|
const uri = action.fileUri ?? this.state.get<string>(SOURCE_URI_ARG);
|
|
612
736
|
if (!uri) {
|
|
613
737
|
throw new GLSPServerError(
|
|
614
|
-
|
|
738
|
+
this.sharedServices.MessageRenderer.renderMessage(SAVE_TARGET_UNKNOWN),
|
|
615
739
|
`no fileUri on the save action and no ${SOURCE_URI_ARG} in the model state (clientId=${this.state.clientId})`
|
|
616
740
|
);
|
|
617
741
|
}
|
|
@@ -65,8 +65,15 @@ export function diagnosticsToMarkers(diagnostics: readonly TransferLspDiagnostic
|
|
|
65
65
|
* The ids of the elements drawn on this diagram for the diagnostic's target,
|
|
66
66
|
* starting at the node it points at and walking up its containers; empty when
|
|
67
67
|
* the path does not resolve or nothing on the chain is rendered.
|
|
68
|
+
*
|
|
69
|
+
* @param elementPath absent for a lexer or parser error, which Langium pushes
|
|
70
|
+
* onto the document without one — such a diagnostic points at text no node
|
|
71
|
+
* was built from, so it marks nothing.
|
|
68
72
|
*/
|
|
69
|
-
function renderedElementIds(elementPath: string, lookups: DiagnosticMarkerLookups): readonly string[] {
|
|
73
|
+
function renderedElementIds(elementPath: string | undefined, lookups: DiagnosticMarkerLookups): readonly string[] {
|
|
74
|
+
if (elementPath === undefined) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
70
77
|
let node: AstNode | undefined = lookups.resolveElement(elementPath);
|
|
71
78
|
while (node !== undefined) {
|
|
72
79
|
const ids = lookups.renderedIdsFor(node);
|