@hydranium/glsp-client-theia 1.0.0-next.4 → 1.0.0-next.42
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 +4 -3
- package/lib/browser/diagram-loader.d.ts +16 -4
- package/lib/browser/diagram-loader.d.ts.map +1 -1
- package/lib/browser/diagram-loader.js +18 -5
- package/lib/browser/diagram-loader.js.map +1 -1
- package/lib/browser/glsp-diagram-manager.d.ts +22 -0
- package/lib/browser/glsp-diagram-manager.d.ts.map +1 -1
- package/lib/browser/glsp-diagram-manager.js +26 -0
- package/lib/browser/glsp-diagram-manager.js.map +1 -1
- package/lib/browser/glsp-message-service.d.ts +8 -0
- package/lib/browser/glsp-message-service.d.ts.map +1 -1
- package/lib/browser/glsp-message-service.js +8 -0
- package/lib/browser/glsp-message-service.js.map +1 -1
- package/lib/node/glsp-server-connection-handler.d.ts +10 -0
- package/lib/node/glsp-server-connection-handler.d.ts.map +1 -1
- package/lib/node/glsp-server-connection-handler.js +1 -1
- package/lib/node/glsp-server-connection-handler.js.map +1 -1
- package/package.json +13 -11
- package/src/browser/diagram-loader.ts +18 -5
- package/src/browser/glsp-diagram-manager.ts +29 -0
- package/src/browser/glsp-message-service.ts +8 -0
- package/src/node/glsp-server-connection-handler.ts +11 -1
package/README.md
CHANGED
|
@@ -72,9 +72,10 @@ hydranium GLSP server. The declared peer dependencies are:
|
|
|
72
72
|
| `@eclipse-glsp/theia-integration` | `^2.6.0` |
|
|
73
73
|
| `@hydranium/client-theia` | `^1.0.0-next` |
|
|
74
74
|
| `@hydranium/protocol` | `^1.0.0-next` |
|
|
75
|
-
| `@theia/core` | `^1.
|
|
76
|
-
| `@theia/output` | `^1.
|
|
77
|
-
| `@theia/
|
|
75
|
+
| `@theia/core` | `^1.70.0` |
|
|
76
|
+
| `@theia/output` | `^1.70.0` |
|
|
77
|
+
| `@theia/process` | `^1.70.0` |
|
|
78
|
+
| `@theia/workspace` | `^1.70.0` |
|
|
78
79
|
| `inversify` | `^6.0.0` |
|
|
79
80
|
| `snabbdom` | `^3.5.1` |
|
|
80
81
|
|
|
@@ -110,10 +110,22 @@ export declare class HydraniumDiagramLoader extends DiagramLoader {
|
|
|
110
110
|
protected reportLoadFailure(err: unknown): Promise<boolean>;
|
|
111
111
|
/**
|
|
112
112
|
* The sentence a failed load is reported with, on every surface that reports
|
|
113
|
-
* it
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
113
|
+
* it. Public because the canvas overlay is one of those surfaces and lives in
|
|
114
|
+
* another class: it renders this failure exactly when the `StatusAction` did
|
|
115
|
+
* not land, so a second copy of the sentence there could only ever drift
|
|
116
|
+
* unseen.
|
|
117
|
+
*
|
|
118
|
+
* **The seam and the catalogue key answer different questions, so it carries
|
|
119
|
+
* both.** Overriding this method changes the WORDING for every user of one
|
|
120
|
+
* adopter's product; the key is what gives a reader the sentence in their own
|
|
121
|
+
* language, and no override can supply that without an adopter writing a
|
|
122
|
+
* subclass per locale — which is the thing a catalogue exists to avoid. Two
|
|
123
|
+
* of the three surfaces this reaches are user-visible, so the audience
|
|
124
|
+
* triage answers it: a host-bound string a user sees takes an inline key.
|
|
125
|
+
*
|
|
126
|
+
* The Output-channel line is therefore localized too, which is deliberate
|
|
127
|
+
* rather than overlooked — the alternative is a second English copy of one
|
|
128
|
+
* sentence, and the reason for a single source here has not changed.
|
|
117
129
|
*/
|
|
118
130
|
loadFailureLabel(err: unknown): string;
|
|
119
131
|
/** Render a thrown value as a message. Shared so the channel line, the status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagram-loader.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,KAAK,qBAAqB,EAAgB,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,QAAQ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BAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAYjE;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;IAItC;qFACiF;IACjF,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;CAG7C"}
|
|
@@ -21,6 +21,7 @@ exports.HydraniumDiagramLoader = void 0;
|
|
|
21
21
|
const client_1 = require("@eclipse-glsp/client");
|
|
22
22
|
const browser_1 = require("@hydranium/client-theia/lib/browser");
|
|
23
23
|
const protocol_1 = require("@hydranium/protocol");
|
|
24
|
+
const core_1 = require("@theia/core");
|
|
24
25
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
26
|
/**
|
|
26
27
|
* Diagram loader that never lets a load failure vanish.
|
|
@@ -128,13 +129,25 @@ let HydraniumDiagramLoader = class HydraniumDiagramLoader extends client_1.Diagr
|
|
|
128
129
|
}
|
|
129
130
|
/**
|
|
130
131
|
* The sentence a failed load is reported with, on every surface that reports
|
|
131
|
-
* it
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
132
|
+
* it. Public because the canvas overlay is one of those surfaces and lives in
|
|
133
|
+
* another class: it renders this failure exactly when the `StatusAction` did
|
|
134
|
+
* not land, so a second copy of the sentence there could only ever drift
|
|
135
|
+
* unseen.
|
|
136
|
+
*
|
|
137
|
+
* **The seam and the catalogue key answer different questions, so it carries
|
|
138
|
+
* both.** Overriding this method changes the WORDING for every user of one
|
|
139
|
+
* adopter's product; the key is what gives a reader the sentence in their own
|
|
140
|
+
* language, and no override can supply that without an adopter writing a
|
|
141
|
+
* subclass per locale — which is the thing a catalogue exists to avoid. Two
|
|
142
|
+
* of the three surfaces this reaches are user-visible, so the audience
|
|
143
|
+
* triage answers it: a host-bound string a user sees takes an inline key.
|
|
144
|
+
*
|
|
145
|
+
* The Output-channel line is therefore localized too, which is deliberate
|
|
146
|
+
* rather than overlooked — the alternative is a second English copy of one
|
|
147
|
+
* sentence, and the reason for a single source here has not changed.
|
|
135
148
|
*/
|
|
136
149
|
loadFailureLabel(err) {
|
|
137
|
-
return
|
|
150
|
+
return core_1.nls.localize('hydranium/glsp-client-theia/diagram-load-failed', 'Diagram failed to load: {0}', this.formatError(err));
|
|
138
151
|
}
|
|
139
152
|
/** Render a thrown value as a message. Shared so the channel line, the status
|
|
140
153
|
* overlay and any consumer rendering {@link DiagramLoadFailure.error} agree. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagram-loader.js","sourceRoot":"","sources":["../../src/browser/diagram-loader.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AAElF,iDAA+F;AAC/F,iEAAoE;AACpE,kDAA+C;AAC/C,4DAAkE;AAkClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,sBAAa;IACZ,OAAO,CAAiB;IAE/C,OAAO,GAAG,IAAI,mBAAQ,EAAsB,CAAC;IACtD,OAAO,CAAsB;IAEvC;;;+DAG2D;IAC3D,IAAI,WAAW;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACvB,CAAC;IAED;uEACmE;IACnE,eAAe;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC/B,CAAC;IAEQ,KAAK,CAAC,IAAI,CAAC,OAA+B;QAChD,IAAI,CAAC;YACF,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC1B,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACZ,sEAAsE;YACtE,mEAAmE;YACnE,sEAAsE;YACtE,2CAA2C;YAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;Y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AgB,CAAC,QAAQ,CAAC,qBAAY,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YACxF,OAAO,IAAI,CAAC;QACf,CAAC;QAAC,OAAO,SAAS,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,kEAAkE,EAAE,SAAS,CAAC,CAAC;YAClG,OAAO,KAAK,CAAC;QAChB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAC,GAAY;QAC1B,OAAO,UAAG,CAAC,QAAQ,CAAC,iDAAiD,EAAE,6BAA6B,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAChI,CAAC;IAED;qFACiF;IACvE,WAAW,CAAC,GAAY;QAC/B,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;CACH,CAAA;AA1GY,wDAAsB;AACU;IAAzC,IAAA,kBAAM,EAAC,uBAAa,CAAC;8BAA8B,uBAAa;uDAAC;iCADxD,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CA0GlC"}
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
import { GLSPDiagramManager } from '@eclipse-glsp/theia-integration';
|
|
10
10
|
import { type GLSPDiagramLanguage } from '@eclipse-glsp/theia-integration/lib/common';
|
|
11
|
+
import { type GLSPDiagramWidget } from '@eclipse-glsp/theia-integration/lib/browser';
|
|
12
|
+
import { type WidgetOpenerOptions } from '@theia/core/lib/browser';
|
|
11
13
|
/**
|
|
12
14
|
* `GLSPDiagramManager` subclass that derives the language-correlated getters
|
|
13
15
|
* (`fileExtensions`, `diagramType`, `contributionId`, `iconClass`) from a
|
|
@@ -42,5 +44,25 @@ export declare abstract class AbstractHydraniumGlspDiagramManager extends GLSPDi
|
|
|
42
44
|
get contributionId(): string;
|
|
43
45
|
get iconClass(): string;
|
|
44
46
|
get label(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Drops a `selection` key that is present but `undefined` before the base
|
|
49
|
+
* class reads it.
|
|
50
|
+
*
|
|
51
|
+
* Without this, opening a diagram from Theia's file picker throws and the
|
|
52
|
+
* editor never leaves "Loading diagram…". Upstream's
|
|
53
|
+
* `OptionsWithSelection.is` tests `'selection' in options`, which is true for
|
|
54
|
+
* a key explicitly set to `undefined`, and the branch it guards then calls
|
|
55
|
+
* `Object.keys` on that value. Theia's own `QuickFileOpenService` always sets
|
|
56
|
+
* the key — its `buildOpenerOptions` returns `{ selection: range }`, and
|
|
57
|
+
* `range` is `undefined` unless the query carried a `:line:column` suffix —
|
|
58
|
+
* so the crash is reached by the ordinary act of opening a diagram by name.
|
|
59
|
+
*
|
|
60
|
+
* Normalising the OPTIONS rather than rebinding
|
|
61
|
+
* `TheiaOpenerOptionsNavigationService`: the service is shared by every
|
|
62
|
+
* diagram type in the container, so replacing it would make one adopter's
|
|
63
|
+
* fix silently global, and the guard belongs where the value enters rather
|
|
64
|
+
* than where it is consumed. The base method stays the single implementation.
|
|
65
|
+
*/
|
|
66
|
+
protected handleNavigations(widget: GLSPDiagramWidget, options?: WidgetOpenerOptions): boolean;
|
|
45
67
|
}
|
|
46
68
|
//# sourceMappingURL=glsp-diagram-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-diagram-manager.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-diagram-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"glsp-diagram-manager.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-diagram-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BACsB,mCAAoC,SAAQ,kBAAkB;IACjF,8EAA8E;IAC9E,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,EAAE,mBAAmB,CAAC;IAEjE,wEAAwE;IACxE,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAEjD,sFAAsF;IACtF,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAE5C,IAAa,cAAc,IAAI,MAAM,EAAE,CAEtC;IAED,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;;;;;;;;;;;;;;;;;OAkBG;cACgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO;CAOzG"}
|
|
@@ -58,6 +58,32 @@ let AbstractHydraniumGlspDiagramManager = class AbstractHydraniumGlspDiagramMana
|
|
|
58
58
|
get label() {
|
|
59
59
|
return this.managerLabel;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Drops a `selection` key that is present but `undefined` before the base
|
|
63
|
+
* class reads it.
|
|
64
|
+
*
|
|
65
|
+
* Without this, opening a diagram from Theia's file picker throws and the
|
|
66
|
+
* editor never leaves "Loading diagram…". Upstream's
|
|
67
|
+
* `OptionsWithSelection.is` tests `'selection' in options`, which is true for
|
|
68
|
+
* a key explicitly set to `undefined`, and the branch it guards then calls
|
|
69
|
+
* `Object.keys` on that value. Theia's own `QuickFileOpenService` always sets
|
|
70
|
+
* the key — its `buildOpenerOptions` returns `{ selection: range }`, and
|
|
71
|
+
* `range` is `undefined` unless the query carried a `:line:column` suffix —
|
|
72
|
+
* so the crash is reached by the ordinary act of opening a diagram by name.
|
|
73
|
+
*
|
|
74
|
+
* Normalising the OPTIONS rather than rebinding
|
|
75
|
+
* `TheiaOpenerOptionsNavigationService`: the service is shared by every
|
|
76
|
+
* diagram type in the container, so replacing it would make one adopter's
|
|
77
|
+
* fix silently global, and the guard belongs where the value enters rather
|
|
78
|
+
* than where it is consumed. The base method stays the single implementation.
|
|
79
|
+
*/
|
|
80
|
+
handleNavigations(widget, options) {
|
|
81
|
+
if (options && 'selection' in options && options.selection === undefined) {
|
|
82
|
+
const { selection: _dropped, ...rest } = options;
|
|
83
|
+
return super.handleNavigations(widget, rest);
|
|
84
|
+
}
|
|
85
|
+
return super.handleNavigations(widget, options);
|
|
86
|
+
}
|
|
61
87
|
};
|
|
62
88
|
exports.AbstractHydraniumGlspDiagramManager = AbstractHydraniumGlspDiagramManager;
|
|
63
89
|
exports.AbstractHydraniumGlspDiagramManager = AbstractHydraniumGlspDiagramManager = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-diagram-manager.js","sourceRoot":"","sources":["../../src/browser/glsp-diagram-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAAwD;AACxD,uEAAqE;
|
|
1
|
+
{"version":3,"file":"glsp-diagram-manager.js","sourceRoot":"","sources":["../../src/browser/glsp-diagram-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAAwD;AACxD,uEAAqE;AAIrE,4DAA0D;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEI,IAAe,mCAAmC,GAAlD,MAAe,mCAAoC,SAAQ,sCAAkB;IAOjF,sFAAsF;IACnE,eAAe,CAAU;IAE5C,IAAa,cAAc;QACxB,OAAO,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,IAAa,WAAW;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC;IAC3C,CAAC;IAED,IAAa,cAAc;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC;IAC9C,CAAC;IAED,IAAa,SAAS;QACnB,OAAO,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,SAAS,IAAI,IAAA,yBAAgB,EAAC,oBAAoB,CAAC,CAAC;IAC3G,CAAC;IAED,IAAI,KAAK;QACN,OAAO,IAAI,CAAC,YAAY,CAAC;IAC5B,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACgB,iBAAiB,CAAC,MAAyB,EAAE,OAA6B;QAC1F,IAAI,OAAO,IAAI,WAAW,IAAI,OAAO,IAAK,OAAmC,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YACrG,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,OAAwD,CAAC;YAClG,OAAO,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACH,CAAA;AAxDqB,kFAAmC;8CAAnC,mCAAmC;IADxD,IAAA,sBAAU,GAAE;GACS,mCAAmC,CAwDxD"}
|
|
@@ -22,6 +22,14 @@ import { type interfaces } from '@theia/core/shared/inversify';
|
|
|
22
22
|
* Matching an English literal fails silently — no error, no log line, just the
|
|
23
23
|
* duplicate progress popup back — so this needs keeping in step with
|
|
24
24
|
* `RequestModelActionHandler` on every GLSP bump.
|
|
25
|
+
*
|
|
26
|
+
* **Exported to be imported, and it must NOT be externalized.** An adopter
|
|
27
|
+
* subclassing the message service needs the same literal to match on, and a
|
|
28
|
+
* second copy of it is a second thing to keep in step across that bump. It is
|
|
29
|
+
* also the one user-visible string in the framework that is deliberately excluded
|
|
30
|
+
* from the message catalogue: it exists to equal an upstream English literal that
|
|
31
|
+
* lives in no catalogue, so giving it a code and a translation would break the
|
|
32
|
+
* match it exists for.
|
|
25
33
|
*/
|
|
26
34
|
export declare const MODEL_LOADING_PROGRESS_TITLE = "Model loading in progress";
|
|
27
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-message-service.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-message-service.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACnH,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,8BAA8B,CAAC;AAE3E
|
|
1
|
+
{"version":3,"file":"glsp-message-service.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-message-service.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACnH,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,KAAK,UAAU,EAAc,MAAM,8BAA8B,CAAC;AAE3E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,4BAA4B,8BAA8B,CAAC;AAExE;;;;;;;;;;;;GAYG;AACH,qBACa,2BAA4B,SAAQ,uBAAuB;IACrE;;mBAEe;IACf,SAAS,CAAC,qBAAqB,cAAqB;cAEjC,aAAa,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;cAQhD,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;cAOlD,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;CAQjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,GAAG,IAAI,CAMnI"}
|
|
@@ -31,6 +31,14 @@ const inversify_1 = require("@theia/core/shared/inversify");
|
|
|
31
31
|
* Matching an English literal fails silently — no error, no log line, just the
|
|
32
32
|
* duplicate progress popup back — so this needs keeping in step with
|
|
33
33
|
* `RequestModelActionHandler` on every GLSP bump.
|
|
34
|
+
*
|
|
35
|
+
* **Exported to be imported, and it must NOT be externalized.** An adopter
|
|
36
|
+
* subclassing the message service needs the same literal to match on, and a
|
|
37
|
+
* second copy of it is a second thing to keep in step across that bump. It is
|
|
38
|
+
* also the one user-visible string in the framework that is deliberately excluded
|
|
39
|
+
* from the message catalogue: it exists to equal an upstream English literal that
|
|
40
|
+
* lives in no catalogue, so giving it a code and a translation would break the
|
|
41
|
+
* match it exists for.
|
|
34
42
|
*/
|
|
35
43
|
exports.MODEL_LOADING_PROGRESS_TITLE = 'Model loading in progress';
|
|
36
44
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-message-service.js","sourceRoot":"","sources":["../../src/browser/glsp-message-service.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"glsp-message-service.js","sourceRoot":"","sources":["../../src/browser/glsp-message-service.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAoFlF,0EAMC;AAvFD,uEAA0E;AAC1E,4DAA2E;AAE3E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,4BAA4B,GAAG,2BAA2B,CAA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;IACpF,CAAC;AACJ,CAAC"}
|
|
@@ -16,6 +16,16 @@ import type * as net from 'net';
|
|
|
16
16
|
export interface GlspServerConnectionHandlerOptions {
|
|
17
17
|
readonly languageContributionId: string;
|
|
18
18
|
readonly portCommand: string;
|
|
19
|
+
/**
|
|
20
|
+
* Product name for the connect-failure dialog this handler raises.
|
|
21
|
+
*
|
|
22
|
+
* It reaches the adopter's UI verbatim, so the framework default leaks a
|
|
23
|
+
* framework noun into a product that is not ours. Not a translation concern —
|
|
24
|
+
* routing it through a catalogue would ask an adopter to "translate" English
|
|
25
|
+
* into their own product name, and would make their branding
|
|
26
|
+
* locale-dependent.
|
|
27
|
+
*/
|
|
28
|
+
readonly serverName?: string;
|
|
19
29
|
readonly findPortTimeout?: number;
|
|
20
30
|
readonly findPortAttempts?: number;
|
|
21
31
|
readonly connectTimeoutMs?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-server-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/glsp-server-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,EAAE,yCAAyC,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,KAAK,GAAG,MAAM,KAAK,CAAC;AAEhC;;;iDAGiD;AACjD,MAAM,WAAW,kCAAkC;IAChD,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;;;;;GAYG;AACH,qBACa,2BAA4B,SAAQ,yCAAyC;gBAC9D,OAAO,EAAE,kCAAkC;IAapE,SAAS,CAAC,yBAAyB,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,UAAU;CAG7F"}
|
|
1
|
+
{"version":3,"file":"glsp-server-connection-handler.d.ts","sourceRoot":"","sources":["../../src/node/glsp-server-connection-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,EAAE,yCAAyC,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,KAAK,GAAG,MAAM,KAAK,CAAC;AAEhC;;;iDAGiD;AACjD,MAAM,WAAW,kCAAkC;IAChD,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC;CAC1D;AAED;;;;;;;;;;;;GAYG;AACH,qBACa,2BAA4B,SAAQ,yCAAyC;gBAC9D,OAAO,EAAE,kCAAkC;IAapE,SAAS,CAAC,yBAAyB,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,UAAU;CAG7F"}
|
|
@@ -44,7 +44,7 @@ let GlspServerConnectionHandler = class GlspServerConnectionHandler extends node
|
|
|
44
44
|
path: common_1.GLSPContribution.servicePath + '/' + options.languageContributionId,
|
|
45
45
|
portCommand: options.portCommand,
|
|
46
46
|
logComponent: 'GLSP',
|
|
47
|
-
serverName: 'Graphical Server',
|
|
47
|
+
serverName: options.serverName ?? 'Graphical Server',
|
|
48
48
|
findPortTimeout: options.findPortTimeout,
|
|
49
49
|
findPortAttempts: options.findPortAttempts,
|
|
50
50
|
connectTimeoutMs: options.connectTimeoutMs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-server-connection-handler.js","sourceRoot":"","sources":["../../src/node/glsp-server-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,uEAA8E;AAC9E,mEAAqF;AACrF,2DAA6F;AAE7F,4DAAqE;
|
|
1
|
+
{"version":3,"file":"glsp-server-connection-handler.js","sourceRoot":"","sources":["../../src/node/glsp-server-connection-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,uEAA8E;AAC9E,mEAAqF;AACrF,2DAA6F;AAE7F,4DAAqE;AAkCrE;;;;;;;;;;;;GAYG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,gDAAyC;IACvF,YAAyB,OAA2C;QACjE,KAAK,CAAC;YACH,IAAI,EAAE,yBAAgB,CAAC,WAAW,GAAG,GAAG,GAAG,OAAO,CAAC,sBAAsB;YACzE,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,YAAY,EAAE,MAAM;YACpB,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,kBAAkB;YACpD,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;YAC1C,eAAe,EAAE,OAAO,CAAC,eAAe;SAC1C,CAAC,CAAC;IACN,CAAC;IAES,yBAAyB,CAAC,aAAsB,EAAE,MAAkB;QAC3E,OAAO,IAAI,gCAAyB,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;CACH,CAAA;AAjBY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,sBAAU,GAAE;IAEG,WAAA,IAAA,qBAAS,GAAE,CAAA;;GADd,2BAA2B,CAiBvC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/glsp-client-theia",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.42",
|
|
4
4
|
"description": "Theia-coupled client primitives for GLSP heads built on @hydranium/glsp-server. Provides the action dispatcher, channel logger, and connection-handler bases that Theia-based adopters extend; companion of @hydranium/glsp-server.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hydranium",
|
|
@@ -78,11 +78,12 @@
|
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@eclipse-glsp/client": "2.7.0",
|
|
80
80
|
"@eclipse-glsp/theia-integration": "2.7.0",
|
|
81
|
-
"@hydranium/client-theia": "1.0.0-next.
|
|
82
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
83
|
-
"@theia/core": "^1.
|
|
84
|
-
"@theia/output": "^1.
|
|
85
|
-
"@theia/
|
|
81
|
+
"@hydranium/client-theia": "1.0.0-next.42",
|
|
82
|
+
"@hydranium/protocol": "1.0.0-next.42",
|
|
83
|
+
"@theia/core": "^1.70.0",
|
|
84
|
+
"@theia/output": "^1.70.0",
|
|
85
|
+
"@theia/process": "^1.70.0",
|
|
86
|
+
"@theia/workspace": "^1.70.0",
|
|
86
87
|
"@types/node": "^22.0.0",
|
|
87
88
|
"inversify": "6.2.2",
|
|
88
89
|
"rimraf": "^5.0.0",
|
|
@@ -92,11 +93,12 @@
|
|
|
92
93
|
"peerDependencies": {
|
|
93
94
|
"@eclipse-glsp/client": "^2.6.0",
|
|
94
95
|
"@eclipse-glsp/theia-integration": "^2.6.0",
|
|
95
|
-
"@hydranium/client-theia": "1.0.0-next.
|
|
96
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
97
|
-
"@theia/core": "^1.
|
|
98
|
-
"@theia/output": "^1.
|
|
99
|
-
"@theia/
|
|
96
|
+
"@hydranium/client-theia": "1.0.0-next.42",
|
|
97
|
+
"@hydranium/protocol": "1.0.0-next.42",
|
|
98
|
+
"@theia/core": "^1.70.0",
|
|
99
|
+
"@theia/output": "^1.70.0",
|
|
100
|
+
"@theia/process": "^1.70.0",
|
|
101
|
+
"@theia/workspace": "^1.70.0",
|
|
100
102
|
"inversify": "^6.0.0",
|
|
101
103
|
"snabbdom": "^3.5.1"
|
|
102
104
|
},
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { DiagramLoader, type DiagramLoadingOptions, StatusAction } from '@eclipse-glsp/client';
|
|
11
11
|
import { ChannelLogger } from '@hydranium/client-theia/lib/browser';
|
|
12
12
|
import { Deferred } from '@hydranium/protocol';
|
|
13
|
+
import { nls } from '@theia/core';
|
|
13
14
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -156,13 +157,25 @@ export class HydraniumDiagramLoader extends DiagramLoader {
|
|
|
156
157
|
|
|
157
158
|
/**
|
|
158
159
|
* The sentence a failed load is reported with, on every surface that reports
|
|
159
|
-
* it
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
160
|
+
* it. Public because the canvas overlay is one of those surfaces and lives in
|
|
161
|
+
* another class: it renders this failure exactly when the `StatusAction` did
|
|
162
|
+
* not land, so a second copy of the sentence there could only ever drift
|
|
163
|
+
* unseen.
|
|
164
|
+
*
|
|
165
|
+
* **The seam and the catalogue key answer different questions, so it carries
|
|
166
|
+
* both.** Overriding this method changes the WORDING for every user of one
|
|
167
|
+
* adopter's product; the key is what gives a reader the sentence in their own
|
|
168
|
+
* language, and no override can supply that without an adopter writing a
|
|
169
|
+
* subclass per locale — which is the thing a catalogue exists to avoid. Two
|
|
170
|
+
* of the three surfaces this reaches are user-visible, so the audience
|
|
171
|
+
* triage answers it: a host-bound string a user sees takes an inline key.
|
|
172
|
+
*
|
|
173
|
+
* The Output-channel line is therefore localized too, which is deliberate
|
|
174
|
+
* rather than overlooked — the alternative is a second English copy of one
|
|
175
|
+
* sentence, and the reason for a single source here has not changed.
|
|
163
176
|
*/
|
|
164
177
|
loadFailureLabel(err: unknown): string {
|
|
165
|
-
return
|
|
178
|
+
return nls.localize('hydranium/glsp-client-theia/diagram-load-failed', 'Diagram failed to load: {0}', this.formatError(err));
|
|
166
179
|
}
|
|
167
180
|
|
|
168
181
|
/** Render a thrown value as a message. Shared so the channel line, the status
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
import { codiconCSSString } from '@eclipse-glsp/client';
|
|
11
11
|
import { GLSPDiagramManager } from '@eclipse-glsp/theia-integration';
|
|
12
12
|
import { type GLSPDiagramLanguage } from '@eclipse-glsp/theia-integration/lib/common';
|
|
13
|
+
import { type GLSPDiagramWidget } from '@eclipse-glsp/theia-integration/lib/browser';
|
|
14
|
+
import { type WidgetOpenerOptions } from '@theia/core/lib/browser';
|
|
13
15
|
import { injectable } from '@theia/core/shared/inversify';
|
|
14
16
|
|
|
15
17
|
/**
|
|
@@ -64,4 +66,31 @@ export abstract class AbstractHydraniumGlspDiagramManager extends GLSPDiagramMan
|
|
|
64
66
|
get label(): string {
|
|
65
67
|
return this.managerLabel;
|
|
66
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Drops a `selection` key that is present but `undefined` before the base
|
|
72
|
+
* class reads it.
|
|
73
|
+
*
|
|
74
|
+
* Without this, opening a diagram from Theia's file picker throws and the
|
|
75
|
+
* editor never leaves "Loading diagram…". Upstream's
|
|
76
|
+
* `OptionsWithSelection.is` tests `'selection' in options`, which is true for
|
|
77
|
+
* a key explicitly set to `undefined`, and the branch it guards then calls
|
|
78
|
+
* `Object.keys` on that value. Theia's own `QuickFileOpenService` always sets
|
|
79
|
+
* the key — its `buildOpenerOptions` returns `{ selection: range }`, and
|
|
80
|
+
* `range` is `undefined` unless the query carried a `:line:column` suffix —
|
|
81
|
+
* so the crash is reached by the ordinary act of opening a diagram by name.
|
|
82
|
+
*
|
|
83
|
+
* Normalising the OPTIONS rather than rebinding
|
|
84
|
+
* `TheiaOpenerOptionsNavigationService`: the service is shared by every
|
|
85
|
+
* diagram type in the container, so replacing it would make one adopter's
|
|
86
|
+
* fix silently global, and the guard belongs where the value enters rather
|
|
87
|
+
* than where it is consumed. The base method stays the single implementation.
|
|
88
|
+
*/
|
|
89
|
+
protected override handleNavigations(widget: GLSPDiagramWidget, options?: WidgetOpenerOptions): boolean {
|
|
90
|
+
if (options && 'selection' in options && (options as { selection?: unknown }).selection === undefined) {
|
|
91
|
+
const { selection: _dropped, ...rest } = options as WidgetOpenerOptions & { selection?: unknown };
|
|
92
|
+
return super.handleNavigations(widget, rest);
|
|
93
|
+
}
|
|
94
|
+
return super.handleNavigations(widget, options);
|
|
95
|
+
}
|
|
67
96
|
}
|
|
@@ -24,6 +24,14 @@ import { type interfaces, injectable } from '@theia/core/shared/inversify';
|
|
|
24
24
|
* Matching an English literal fails silently — no error, no log line, just the
|
|
25
25
|
* duplicate progress popup back — so this needs keeping in step with
|
|
26
26
|
* `RequestModelActionHandler` on every GLSP bump.
|
|
27
|
+
*
|
|
28
|
+
* **Exported to be imported, and it must NOT be externalized.** An adopter
|
|
29
|
+
* subclassing the message service needs the same literal to match on, and a
|
|
30
|
+
* second copy of it is a second thing to keep in step across that bump. It is
|
|
31
|
+
* also the one user-visible string in the framework that is deliberately excluded
|
|
32
|
+
* from the message catalogue: it exists to equal an upstream English literal that
|
|
33
|
+
* lives in no catalogue, so giving it a code and a translation would break the
|
|
34
|
+
* match it exists for.
|
|
27
35
|
*/
|
|
28
36
|
export const MODEL_LOADING_PROGRESS_TITLE = 'Model loading in progress';
|
|
29
37
|
|
|
@@ -21,6 +21,16 @@ import type * as net from 'net';
|
|
|
21
21
|
export interface GlspServerConnectionHandlerOptions {
|
|
22
22
|
readonly languageContributionId: string;
|
|
23
23
|
readonly portCommand: string;
|
|
24
|
+
/**
|
|
25
|
+
* Product name for the connect-failure dialog this handler raises.
|
|
26
|
+
*
|
|
27
|
+
* It reaches the adopter's UI verbatim, so the framework default leaks a
|
|
28
|
+
* framework noun into a product that is not ours. Not a translation concern —
|
|
29
|
+
* routing it through a catalogue would ask an adopter to "translate" English
|
|
30
|
+
* into their own product name, and would make their branding
|
|
31
|
+
* locale-dependent.
|
|
32
|
+
*/
|
|
33
|
+
readonly serverName?: string;
|
|
24
34
|
readonly findPortTimeout?: number;
|
|
25
35
|
readonly findPortAttempts?: number;
|
|
26
36
|
readonly connectTimeoutMs?: number;
|
|
@@ -55,7 +65,7 @@ export class GlspServerConnectionHandler extends AbstractSocketForwardingConnect
|
|
|
55
65
|
path: GLSPContribution.servicePath + '/' + options.languageContributionId,
|
|
56
66
|
portCommand: options.portCommand,
|
|
57
67
|
logComponent: 'GLSP',
|
|
58
|
-
serverName: 'Graphical Server',
|
|
68
|
+
serverName: options.serverName ?? 'Graphical Server',
|
|
59
69
|
findPortTimeout: options.findPortTimeout,
|
|
60
70
|
findPortAttempts: options.findPortAttempts,
|
|
61
71
|
connectTimeoutMs: options.connectTimeoutMs,
|