@hydranium/glsp-client-theia 1.0.0-next.31 → 1.0.0-next.313

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +60 -98
  2. package/lib/browser/client-contribution.d.ts +87 -25
  3. package/lib/browser/client-contribution.d.ts.map +1 -1
  4. package/lib/browser/client-contribution.js +233 -53
  5. package/lib/browser/client-contribution.js.map +1 -1
  6. package/lib/browser/diagram-only-marker-manager.d.ts.map +1 -1
  7. package/lib/browser/diagram-only-marker-manager.js.map +1 -1
  8. package/lib/browser/diagram-widget.d.ts +43 -25
  9. package/lib/browser/diagram-widget.d.ts.map +1 -1
  10. package/lib/browser/diagram-widget.js +76 -26
  11. package/lib/browser/diagram-widget.js.map +1 -1
  12. package/lib/browser/glsp-client-theia-module.d.ts +12 -5
  13. package/lib/browser/glsp-client-theia-module.d.ts.map +1 -1
  14. package/lib/browser/glsp-client-theia-module.js +27 -12
  15. package/lib/browser/glsp-client-theia-module.js.map +1 -1
  16. package/lib/browser/glsp-diagram-manager.d.ts +40 -1
  17. package/lib/browser/glsp-diagram-manager.d.ts.map +1 -1
  18. package/lib/browser/glsp-diagram-manager.js +100 -0
  19. package/lib/browser/glsp-diagram-manager.js.map +1 -1
  20. package/lib/browser/glsp-message-service.d.ts.map +1 -1
  21. package/lib/browser/glsp-message-service.js.map +1 -1
  22. package/lib/browser/glsp-saveable.d.ts +67 -0
  23. package/lib/browser/glsp-saveable.d.ts.map +1 -0
  24. package/lib/browser/glsp-saveable.js +110 -0
  25. package/lib/browser/glsp-saveable.js.map +1 -0
  26. package/lib/browser/glsp-theia-frontend-module.d.ts.map +1 -1
  27. package/lib/browser/glsp-theia-frontend-module.js +4 -1
  28. package/lib/browser/glsp-theia-frontend-module.js.map +1 -1
  29. package/lib/browser/hydranium-glsp-diagram-configuration.d.ts +3 -1
  30. package/lib/browser/hydranium-glsp-diagram-configuration.d.ts.map +1 -1
  31. package/lib/browser/hydranium-glsp-diagram-configuration.js +3 -1
  32. package/lib/browser/hydranium-glsp-diagram-configuration.js.map +1 -1
  33. package/lib/browser/index.d.ts +4 -3
  34. package/lib/browser/index.d.ts.map +1 -1
  35. package/lib/browser/index.js +7 -5
  36. package/lib/browser/index.js.map +1 -1
  37. package/lib/browser/theia-diagram-loader.d.ts +25 -0
  38. package/lib/browser/theia-diagram-loader.d.ts.map +1 -0
  39. package/lib/browser/theia-diagram-loader.js +42 -0
  40. package/lib/browser/theia-diagram-loader.js.map +1 -0
  41. package/lib/browser/window-session.d.ts +57 -0
  42. package/lib/browser/window-session.d.ts.map +1 -0
  43. package/lib/browser/window-session.js +102 -0
  44. package/lib/browser/window-session.js.map +1 -0
  45. package/lib/node/connection-container-module.js.map +1 -1
  46. package/lib/node/glsp-server-connection-handler.d.ts +11 -20
  47. package/lib/node/glsp-server-connection-handler.d.ts.map +1 -1
  48. package/lib/node/glsp-server-connection-handler.js +12 -15
  49. package/lib/node/glsp-server-connection-handler.js.map +1 -1
  50. package/package.json +37 -46
  51. package/src/browser/client-contribution.ts +254 -55
  52. package/src/browser/diagram-widget.ts +80 -28
  53. package/src/browser/glsp-client-theia-module.ts +34 -13
  54. package/src/browser/glsp-diagram-manager.ts +112 -3
  55. package/src/browser/glsp-saveable.ts +111 -0
  56. package/src/browser/glsp-theia-frontend-module.ts +4 -1
  57. package/src/browser/hydranium-glsp-diagram-configuration.ts +3 -1
  58. package/src/browser/index.ts +12 -5
  59. package/src/browser/theia-diagram-loader.ts +31 -0
  60. package/src/browser/window-session.ts +114 -0
  61. package/src/node/glsp-server-connection-handler.ts +12 -24
  62. package/style/diagram-loading.css +2 -5
  63. package/lib/browser/action-dispatcher.d.ts +0 -85
  64. package/lib/browser/action-dispatcher.d.ts.map +0 -1
  65. package/lib/browser/action-dispatcher.js +0 -238
  66. package/lib/browser/action-dispatcher.js.map +0 -1
  67. package/lib/browser/diagram-loader.d.ts +0 -123
  68. package/lib/browser/diagram-loader.d.ts.map +0 -1
  69. package/lib/browser/diagram-loader.js +0 -153
  70. package/lib/browser/diagram-loader.js.map +0 -1
  71. package/lib/browser/hidden-bounds-updater.d.ts +0 -122
  72. package/lib/browser/hidden-bounds-updater.d.ts.map +0 -1
  73. package/lib/browser/hidden-bounds-updater.js +0 -207
  74. package/lib/browser/hidden-bounds-updater.js.map +0 -1
  75. package/lib/testing/bind-recorder.d.ts +0 -67
  76. package/lib/testing/bind-recorder.d.ts.map +0 -1
  77. package/lib/testing/bind-recorder.js +0 -72
  78. package/lib/testing/bind-recorder.js.map +0 -1
  79. package/lib/testing/index.d.ts +0 -10
  80. package/lib/testing/index.d.ts.map +0 -1
  81. package/lib/testing/index.js +0 -30
  82. package/lib/testing/index.js.map +0 -1
  83. package/src/browser/action-dispatcher.ts +0 -257
  84. package/src/browser/diagram-loader.ts +0 -173
  85. package/src/browser/hidden-bounds-updater.ts +0 -212
  86. package/src/testing/bind-recorder.ts +0 -126
  87. package/src/testing/index.ts +0 -15
@@ -20,89 +20,269 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
20
20
  return function (target, key) { decorator(target, key, paramIndex); }
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.HydraniumGlspClientContribution = void 0;
23
+ exports.HydraniumGlspClientContribution = exports.DEFAULT_GLSP_CLIENT_STARTUP_TIMEOUT_MS = void 0;
24
+ const client_1 = require("@eclipse-glsp/client");
24
25
  const theia_integration_1 = require("@eclipse-glsp/theia-integration");
26
+ const common_1 = require("@eclipse-glsp/theia-integration/lib/common");
27
+ const browser_1 = require("@hydranium/client-theia/browser");
28
+ const common_2 = require("@hydranium/client-theia/common");
29
+ const glsp_client_1 = require("@hydranium/glsp-client");
30
+ const protocol_1 = require("@hydranium/protocol");
31
+ const core_1 = require("@theia/core");
25
32
  const promise_util_1 = require("@theia/core/lib/common/promise-util");
26
33
  const inversify_1 = require("@theia/core/shared/inversify");
27
- const output_channel_1 = require("@theia/output/lib/browser/output-channel");
28
- const browser_1 = require("@theia/workspace/lib/browser");
34
+ const browser_2 = require("@theia/workspace/lib/browser");
35
+ // GLSP's channel connection uses the top-level `vscode-jsonrpc`'s root entry, which
36
+ // installs no runtime layer; without the browser entry, no message is received.
37
+ require("vscode-jsonrpc/browser");
38
+ exports.DEFAULT_GLSP_CLIENT_STARTUP_TIMEOUT_MS = 30_000;
29
39
  /**
30
40
  * Theia GLSP client contribution for adopters whose GLSP server runs in a
31
41
  * sideloaded VS Code extension process (or any other deferred-start setup).
32
- * The behaviours adopters reliably need are lifted:
33
42
  *
34
- * 1. `waitForBackendConnected`: tail the OutputChannel for a server-printed
35
- * ready marker. While a socket connection might open earlier, the GLSP
36
- * server typically does internal initialisation before it can accept
37
- * client connections — we wait for it to say so.
38
- * 2. `start`: defer until a workspace is opened. If Theia starts without a
39
- * workspace, this prevents the frontend-backend connection (and its
40
- * "connecting" progress spinner) from firing prematurely.
43
+ * The client starts once a workspace is open and sends its first request at
44
+ * once; the backend handler holds it until its socket to the server is up. A
45
+ * start that fails, and a connection lost after one succeeded, start a fresh
46
+ * client after a backoff, for as long as the contribution lives. Each start is
47
+ * reported through the {@link ConnectionReporter}, and announced through
48
+ * {@link onDidStartClient} and {@link onDidLoseClient}.
41
49
  *
42
50
  * A `GLSPClient` override filtering inbound messages by clientId is
43
51
  * deliberately NOT provided: upstream's `BaseJsonrpcGLSPClient.onActionMessage`
44
- * already filters by clientId, so the `TheiaJsonrpcGLSPClient` returned by
45
- * `BaseGLSPClientContribution.createGLSPClient` is correct as-is.
52
+ * already filters by clientId.
46
53
  */
47
54
  let HydraniumGlspClientContribution = class HydraniumGlspClientContribution extends theia_integration_1.BaseGLSPClientContribution {
48
- outputChannelManager;
49
55
  workspaceService;
56
+ connectionReporter;
57
+ logger;
58
+ /** Times the restart escalation reset: the container's {@link Clock}, or a `SystemClock`. */
59
+ clock = new protocol_1.SystemClock();
50
60
  id;
51
- channelName;
52
- readyMarker;
61
+ /** Delay before the restart following each consecutive failed start or lost
62
+ * client; the last repeats. */
63
+ restartDelaysMs = [1_000, 2_000, 4_000, 8_000];
64
+ /** How long a client must stay up before the restart delays start over, so
65
+ * a server that fails right after starting is not restarted at once. */
66
+ restartEscalationResetMs = 30_000;
67
+ consecutiveFailures = 0;
68
+ restartTimer;
69
+ /** Running since the current client started; cleared once a restart has taken it into account. */
70
+ sinceStart;
71
+ /** Clients started so far, which numbers them in the log: they share {@link id}. */
72
+ startedClients = 0;
73
+ /** The attempt waiting for a channel, if any. */
74
+ channelRequest;
75
+ disposed = false;
76
+ clientStartedEmitter = new core_1.Emitter();
77
+ clientLostEmitter = new core_1.Emitter();
78
+ /** Fires with each client once it has started and its server has answered. */
79
+ onDidStartClient = this.clientStartedEmitter.event;
80
+ /** Fires when the started client stops; {@link glspClient} already waits
81
+ * for its replacement then. */
82
+ onDidLoseClient = this.clientLostEmitter.event;
53
83
  constructor(options) {
54
84
  super();
55
85
  this.id = options.languageContributionId;
56
- this.channelName = options.channelName;
57
- this.readyMarker = options.readyMarker;
58
- }
59
- /** Wait for the server to print its ready marker into the OutputChannel.
60
- * Resolves immediately if the marker is already present (server started
61
- * before the client contribution mounted). */
62
- async waitForBackendConnected() {
63
- const channel = this.outputChannelManager.getChannel(this.channelName);
64
- const channelText = channel.resource?.textModel?.getValue() ?? '';
65
- if (channelText.includes(this.readyMarker)) {
86
+ this.glspClientStartupTimeout = options.startupTimeoutMs ?? exports.DEFAULT_GLSP_CLIENT_STARTUP_TIMEOUT_MS;
87
+ }
88
+ /** The client every diagram load awaits; after a failed start, a fresh one. */
89
+ get glspClient() {
90
+ return this.glspClientDeferred.state === 'rejected' ? this.restart() : this.glspClientDeferred.promise;
91
+ }
92
+ /** Start a fresh client over a fresh channel at once, if the last start failed. */
93
+ restart() {
94
+ if (!this.disposed && this.glspClientDeferred.state === 'rejected') {
95
+ this.replaceClient();
96
+ void this.activateClient();
97
+ }
98
+ return this.glspClientDeferred.promise;
99
+ }
100
+ /** Point {@link glspClient} at a fresh client still to start, and tear down
101
+ * the old one's channel. */
102
+ replaceClient() {
103
+ clearTimeout(this.restartTimer);
104
+ // Replaced before the old channel goes, so the old client stopping is
105
+ // not taken for a loss of the new one.
106
+ this.glspClientDeferred = new promise_util_1.Deferred();
107
+ this.toDispose.dispose();
108
+ // Upstream refuses to open a channel while the collection is disposed.
109
+ this.toDispose.push(core_1.Disposable.NULL);
110
+ }
111
+ /** Settles the promise current when it began, so a start a restart overtook
112
+ * cannot settle its successor. */
113
+ async activateClient() {
114
+ const pending = this.glspClientDeferred;
115
+ await this.workspaceOpened();
116
+ if (this.disposed) {
66
117
  return;
67
118
  }
68
- const deferred = new promise_util_1.Deferred();
69
- const channelListener = channel.onContentChange(() => {
70
- const text = channel.resource?.textModel?.getValue() ?? '';
71
- if (text.includes(this.readyMarker)) {
72
- channelListener.dispose();
73
- deferred.resolve();
119
+ const attempt = this.connectionReporter.connecting(this.connectionTarget);
120
+ const timeout = this.glspClientStartupTimeout > 0
121
+ ? setTimeout(() => pending.reject(new Error(this.startupTimeoutMessage())), this.glspClientStartupTimeout)
122
+ : undefined;
123
+ pending.promise.then(client => {
124
+ clearTimeout(timeout);
125
+ attempt.connected();
126
+ this.sinceStart = this.clock.stopwatch();
127
+ this.logger.info(`[${this.id}] Diagram client ${++this.startedClients} started.`);
128
+ this.clientStartedEmitter.fire(client);
129
+ this.restartOnLoss(client);
130
+ }, (error) => {
131
+ clearTimeout(timeout);
132
+ if (this.disposed) {
133
+ attempt.cancelled();
134
+ return;
135
+ }
136
+ attempt.failed((0, protocol_1.describeError)(error), () => void this.restart());
137
+ this.scheduleRestart(() => {
138
+ if (this.glspClientDeferred === pending) {
139
+ void this.restart();
140
+ }
141
+ });
142
+ });
143
+ try {
144
+ const connection = await this.createConnection();
145
+ // Ahead of the client's own listener, whose teardown rejects with a
146
+ // transport message instead.
147
+ connection.onClose(() => pending.reject(new Error(this.unreachableMessage())));
148
+ // Upstream builds the connection from the `vscode-jsonrpc` hoisted
149
+ // beside it and the client's typed messages from its protocol's copy;
150
+ // a type sent over another copy's connection throws.
151
+ const client = await this.createGLSPClient((0, protocol_1.sendByMethodName)(connection));
152
+ connection.onDispose(() => client.stop());
153
+ await this.start(client);
154
+ pending.resolve(client);
155
+ }
156
+ catch (error) {
157
+ pending.reject(error);
158
+ }
159
+ }
160
+ /** Run `restart` after the delay for the failures so far, and return that delay. */
161
+ scheduleRestart(restart) {
162
+ if (this.sinceStart !== undefined && this.sinceStart.elapsedMs >= this.restartEscalationResetMs) {
163
+ this.consecutiveFailures = 0;
164
+ }
165
+ this.sinceStart = undefined;
166
+ const delay = this.restartDelaysMs[Math.min(this.consecutiveFailures, this.restartDelaysMs.length - 1)];
167
+ this.consecutiveFailures++;
168
+ clearTimeout(this.restartTimer);
169
+ this.restartTimer = setTimeout(restart, delay);
170
+ return delay;
171
+ }
172
+ /** Once `client` stops, replace it and start its replacement after the
173
+ * restart delay, unless a dispose stopped it. */
174
+ restartOnLoss(client) {
175
+ const listener = client.onCurrentStateChanged(state => {
176
+ if (state !== client_1.ClientState.ServerError && state !== client_1.ClientState.Stopped) {
177
+ return;
178
+ }
179
+ listener.dispose();
180
+ if (!this.disposed) {
181
+ this.replaceClient();
182
+ this.clientLostEmitter.fire();
183
+ const delay = this.scheduleRestart(() => void this.activateClient());
184
+ // Upstream's client has just logged that it will not be restarted, which holds for it alone.
185
+ this.logger.info(`[${this.id}] Diagram client ${this.startedClients} lost; starting a fresh one in ${delay} ms.`);
74
186
  }
75
187
  });
76
- return deferred.promise;
77
188
  }
189
+ /** Start the client and initialize its server, rejecting on failure; the
190
+ * caller settles {@link glspClient}. */
78
191
  async start(glspClient) {
79
- // Defer starting the GLSP client until a workspace is opened. If Theia
80
- // starts without a workspace, this prevents creating the frontend-
81
- // backend connection (and showing the "connecting" progress) prematurely.
192
+ await glspClient.start();
193
+ await this.initialize(glspClient);
194
+ }
195
+ /** Without upstream's own error notification, which would duplicate the reporter's. */
196
+ async initialize(glspClient) {
197
+ return glspClient.initializeServer(await this.createInitializeParameters());
198
+ }
199
+ /** Upstream's base client, without the notifications of its Theia subclass,
200
+ * which would duplicate the reporter's. */
201
+ async createGLSPClient(connectionProvider) {
202
+ return new glsp_client_1.HydraniumGlspClient({ id: this.id, connectionProvider });
203
+ }
204
+ /**
205
+ * Whichever channel arrives goes to the attempt waiting now, and one that
206
+ * arrives with none waiting is closed. Theia holds each open until its
207
+ * websocket is back, and after an outage every held open past the first
208
+ * throws "already open" without reaching its handler, so the first to arrive
209
+ * has to serve the latest attempt. Without Theia's replay, which would be a
210
+ * second opener of the same path.
211
+ */
212
+ async createChannelConnection() {
213
+ this.channelRequest?.reject(new Error('A newer start took over the channel request.'));
214
+ const request = new promise_util_1.Deferred();
215
+ this.channelRequest = request;
216
+ this.connectionProvider.listen(common_1.GLSPContribution.getPath(this), (_path, channel) => {
217
+ const waiting = this.channelRequest;
218
+ this.channelRequest = undefined;
219
+ if (waiting && !this.disposed) {
220
+ waiting.resolve(channel);
221
+ }
222
+ else {
223
+ channel.close();
224
+ }
225
+ }, false);
226
+ const channel = await request.promise;
227
+ const connection = (0, common_1.createChannelConnection)(channel, this.logger);
228
+ this.toDispose.push(core_1.Disposable.create(() => this.disposeChannel(connection, channel)));
229
+ return connection;
230
+ }
231
+ /** Also closes the channel: upstream leaves a Theia channel open, and the
232
+ * next one on the same path then cannot open. */
233
+ async disposeChannel(connection, channel) {
234
+ await super.disposeChannel(connection, channel);
235
+ channel.close();
236
+ }
237
+ /** Also fails a start in flight, so nothing reports it after this. */
238
+ dispose() {
239
+ this.disposed = true;
240
+ clearTimeout(this.restartTimer);
241
+ this.glspClientDeferred.promise.catch(() => undefined);
242
+ this.glspClientDeferred.reject(new Error('The diagram client was disposed.'));
243
+ this.clientStartedEmitter.dispose();
244
+ this.clientLostEmitter.dispose();
245
+ super.dispose();
246
+ }
247
+ async workspaceOpened() {
82
248
  const roots = this.workspaceService.tryGetRoots();
83
- if (!roots || roots.length === 0) {
84
- await new Promise(resolve => {
85
- const disposable = this.workspaceService.onWorkspaceChanged(changedRoots => {
86
- if (changedRoots && changedRoots.length > 0) {
87
- disposable.dispose();
88
- resolve();
89
- }
90
- });
91
- });
249
+ if (roots.length === 0) {
250
+ await core_1.Event.toPromise(core_1.Event.filter(this.workspaceService.onWorkspaceChanged, changedRoots => changedRoots.length > 0));
92
251
  }
93
- await this.waitForBackendConnected();
94
- return super.start(glspClient);
252
+ }
253
+ get connectionTarget() {
254
+ return (this.cachedConnectionTarget ??= {
255
+ connectingMessage: core_1.nls.localize('hydranium/glsp-client-theia/diagram-server-connecting', 'Connecting to the diagram server…'),
256
+ connectedMessage: core_1.nls.localize('hydranium/glsp-client-theia/diagram-server-connected', 'Connected to the diagram server.')
257
+ });
258
+ }
259
+ /** One object per contribution: the reporter keys what it has shown on it. */
260
+ cachedConnectionTarget;
261
+ unreachableMessage() {
262
+ return core_1.nls.localize('hydranium/glsp-client-theia/diagram-server-unreachable', 'Could not connect to the diagram server.');
263
+ }
264
+ startupTimeoutMessage() {
265
+ return core_1.nls.localize('hydranium/glsp-client-theia/diagram-server-timeout', 'The diagram server did not answer within {0} seconds.', String(Math.round(this.glspClientStartupTimeout / 1000)));
95
266
  }
96
267
  };
97
268
  exports.HydraniumGlspClientContribution = HydraniumGlspClientContribution;
98
269
  __decorate([
99
- (0, inversify_1.inject)(output_channel_1.OutputChannelManager),
100
- __metadata("design:type", output_channel_1.OutputChannelManager)
101
- ], HydraniumGlspClientContribution.prototype, "outputChannelManager", void 0);
102
- __decorate([
103
- (0, inversify_1.inject)(browser_1.WorkspaceService),
104
- __metadata("design:type", browser_1.WorkspaceService)
270
+ (0, inversify_1.inject)(browser_2.WorkspaceService),
271
+ __metadata("design:type", browser_2.WorkspaceService)
105
272
  ], HydraniumGlspClientContribution.prototype, "workspaceService", void 0);
273
+ __decorate([
274
+ (0, inversify_1.inject)(browser_1.ConnectionReporter),
275
+ __metadata("design:type", Object)
276
+ ], HydraniumGlspClientContribution.prototype, "connectionReporter", void 0);
277
+ __decorate([
278
+ (0, inversify_1.inject)(browser_1.ChannelLogger),
279
+ __metadata("design:type", browser_1.ChannelLogger)
280
+ ], HydraniumGlspClientContribution.prototype, "logger", void 0);
281
+ __decorate([
282
+ (0, inversify_1.inject)(common_2.Clock),
283
+ (0, inversify_1.optional)(),
284
+ __metadata("design:type", Object)
285
+ ], HydraniumGlspClientContribution.prototype, "clock", void 0);
106
286
  exports.HydraniumGlspClientContribution = HydraniumGlspClientContribution = __decorate([
107
287
  (0, inversify_1.injectable)(),
108
288
  __param(0, (0, inversify_1.unmanaged)()),
@@ -1 +1 @@
1
- {"version":3,"file":"client-contribution.js","sourceRoot":"","sources":["../../src/browser/client-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAGlF,uEAA6E;AAC7E,sEAA+D;AAC/D,4DAA6E;AAC7E,6EAAgF;AAChF,0DAAgE;AAYhE;;;;;;;;;;;;;;;;;GAiBG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,8CAA0B;IACpC,oBAAoB,CAAwB;IACvC,gBAAgB,CAAoB;IAExE,EAAE,CAAS;IACD,WAAW,CAAS;IACpB,WAAW,CAAS;IAEvC,YAAyB,OAAkC;QACxD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED;;mDAE+C;IACrC,KAAK,CAAC,uBAAuB;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvE,MAAM,WAAW,GACb,OAA4E,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACvH,IAAI,WAAW,CAAC,QAAQ,CAAC,IA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B,CAAC;8BAAkC,qCAAoB;6EAAC;AACvC;IAA5C,IAAA,kBAAM,EAAC,0BAAgB,CAAC;8BAAuC,0BAAgB;yEAAC;0CAFvE,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;IASG,WAAA,IAAA,qBAAS,GAAE,CAAA;;GARd,+BAA+B,CAsD3C"}
1
+ {"version":3,"file":"client-contribution.js","sourceRoot":"","sources":["../../src/browser/client-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,iDAA2F;AAC3F,uEAA6E;AAC7E,uEAAuG;AACvG,6DAA2G;AAC3G,2DAAuD;AACvD,wDAA6D;AAC7D,kDAAmG;AACnG,sCAA4E;AAC5E,sEAA+D;AAC/D,4DAAuF;AACvF,0DAAgE;AAChE,oFAAoF;AACpF,gFAAgF;AAChF,kCAAgC;AAEnB,QAAA,sCAAsC,GAAG,MAAM,CAAC;AAU7D;;;;;;;;;;;;;;GAcG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,8CAA0B;IAC/B,gBAAgB,CAAoB;IAClC,kBAAkB,CAAsB;IAC7C,MAAM,CAAiB;IACjE,6FAA6F;IAC/C,KAAK,GAAU,IAAI,sBAAW,EAAE,CAAC;IAEtE,EAAE,CAAS;IAEpB;oCACgC;IACb,eAAe,GAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACrF;6EACyE;IACtD,wBAAwB,GAAW,MAAM,CAAC;IACnD,mBAAmB,GAAG,CAAC,CAAC;IACxB,YAAY,CAAiC;IACvD,kGAAkG;IACxF,UAAU,CAAa;IACjC,oFAAoF;IAC1E,cAAc,GAAG,CAAC,CAAC;IAC7B,iDAAiD;IACvC,cAAc,CAAqB;IACnC,QAAQ,GAAG,KAAK,CAAC;IACR,oBAAoB,GAAG,IAAI,cAAO,EAAc,CAAC;IACjD,iBAAiB,GAAG,IAAI,cAAO,EAAQ,CAAC;IAE3D,8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EAAE,0CAA0C,CAAC,CAAC;IAC7H,CAAC;IAES,qBAAqB;QAC5B,OAAO,UAAG,CAAC,QAAQ,CAChB,oDAAoD,EACpD,uDAAuD,EACvD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC,CAC1D,CAAC;IACL,CAAC;CACH,CAAA;;AAvP+C;IAA5C,IAAA,kBAAM,EAAC,0BAAgB,CAAC;8BAAuC,0BAAgB;yEAAC;AAClC;IAA9C,IAAA,kBAAM,EAAC,4BAAkB,CAAC;;2EAA4D;AAC7C;IAAzC,IAAA,kBAAM,EAAC,uBAAa,CAAC;8BAA6B,uBAAa;+DAAC;AAEnB;IAA7C,IAAA,kBAAM,EAAC,cAAK,CAAC;IAAE,IAAA,oBAAQ,GAAE;;8DAAqD;0CALrE,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;IAkCG,WAAA,IAAA,qBAAS,GAAE,CAAA;;GAjCd,+BAA+B,CAwP3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-only-marker-manager.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG1E;;;;;;;;;;;;;;GAcG;AACH,qBACa,yBAA0B,SAAQ,qBAAqB;IACjE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;CAG7E"}
1
+ {"version":3,"file":"diagram-only-marker-manager.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG1E;;;;;;;;;;;;;;GAcG;AACH,qBACa,yBAA0B,SAAQ,qBAAqB;IACjE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAE1E;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-only-marker-manager.js","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAA0E;AAC1E,4DAA0D;AAE1D;;;;;;;;;;;;;;GAcG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,8BAAqB;IACjE,UAAU,CAAC,QAAkB,EAAE,OAAgB,EAAE,UAAmB;QACjE,6DAA6D;IAChE,CAAC;CACH,CAAA;AAJY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAIrC"}
1
+ {"version":3,"file":"diagram-only-marker-manager.js","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAA0E;AAC1E,4DAA0D;AAE1D;;;;;;;;;;;;;;GAcG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,8BAAqB;IACjE,UAAU,CAAC,QAAkB,EAAE,OAAgB,EAAE,UAAmB;QACjE,6DAA6D;IAChE,CAAC;CACH,CAAA;;oCAJY,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAIrC"}
@@ -6,9 +6,13 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { GLSPDiagramWidget } from '@eclipse-glsp/theia-integration';
9
+ import { type Args } from '@eclipse-glsp/client';
10
+ import { GLSPDiagramWidget, type GLSPDiagramWidgetOptions } from '@eclipse-glsp/theia-integration';
11
+ import { type DiagramLoadOutcome, HydraniumDiagramLoader } from '@hydranium/glsp-client';
10
12
  import { type Message } from '@theia/core/lib/browser';
11
- import { type DiagramLoadOutcome, HydraniumDiagramLoader } from './diagram-loader';
13
+ import { Emitter, type Event } from '@theia/core';
14
+ import { type Container } from '@theia/core/shared/inversify';
15
+ import { WindowSessionService } from './window-session';
12
16
  import '../../style/diagram-loading.css';
13
17
  /** Class on the overlay root. Adopters style / override via this contract. */
14
18
  export declare const DIAGRAM_LOADING_CLASS = "hydranium-diagram-loading";
@@ -24,32 +28,48 @@ export declare const DIAGRAM_LOADING_FAILED_CLASS = "hydranium-diagram-loading-f
24
28
  * model to read as a broken editor rather than a slow one.
25
29
  *
26
30
  * **How the pending state is sourced.** From {@link HydraniumDiagramLoader}, not
27
- * from `actionDispatcher.onceModelInitialized()`. The loader settles on failure
28
- * as well as on success, and it does so even when its own error-reporting
29
- * dispatch throws; `onceModelInitialized()` simply never settles on a failed
30
- * load. That distinction is not academic here: this overlay is opaque and covers
31
- * the widget node, while GLSP's `StatusOverlay` — where the loader reports the
32
- * failure — mounts *inside* the diagram's base div. Keyed on model
33
- * initialization, a failed load would leave a spinner turning on top of the
34
- * error message explaining it. Keyed on the loader, exactly one component decides
35
- * whether the canvas is pending and the two mechanisms compose instead of
36
- * competing.
31
+ * from `actionDispatcher.onceModelInitialized()`: the loader settles on failure
32
+ * as well as on success, even when its own error report throws, while
33
+ * `onceModelInitialized()` never settles on a failed load and would leave the
34
+ * spinner turning for good.
37
35
  *
38
- * **The one case where this overlay reports the failure itself.** When
39
- * `DiagramLoadFailure.surfaced` is `false` the loader could not dispatch its
40
- * `StatusAction` — the action dispatcher was what failed — so the status overlay
41
- * shows nothing. Uncovering the canvas would then leave a blank diagram whose only
42
- * explanation is a line in the Output channel. In that case, and only that case,
43
- * the overlay stays up and swaps the spinner for the error text.
36
+ * A failed load keeps the overlay up with the error and a Retry, which asks for
37
+ * a fresh widget through {@link onDidRequestReopen}.
44
38
  *
45
39
  * Bound unconditionally by `AbstractHydraniumGlspTheiaFrontendModule`. To opt out,
46
40
  * override {@link showLoadingOverlay} to a no-op; to change what is rendered,
47
41
  * override {@link createLoadingOverlay} or {@link loadingLabel}.
42
+ *
43
+ * Its saveable is a {@link HydraniumGlspSaveable}, which keeps a pending save
44
+ * dirty, so Theia's exit check still counts it; see {@link createSaveable}.
48
45
  */
49
46
  export declare class HydraniumGlspDiagramWidget extends GLSPDiagramWidget {
47
+ protected readonly windowSessions: WindowSessionService;
50
48
  protected loadingOverlay?: HTMLElement;
49
+ protected readonly reopenRequestEmitter: Emitter<void>;
50
+ /** Fires when this diagram asks to be replaced by a fresh widget, as its
51
+ * Retry does; `AbstractHydraniumGlspDiagramManager` reopens it. A load is
52
+ * not repeated in place, since GLSP's model source registers its handlers
53
+ * once per load. */
54
+ readonly onDidRequestReopen: Event<void>;
55
+ /**
56
+ * Replaces the saveable GLSP's `configure` builds inline, with no factory
57
+ * seam. The widget factory calls `configure` before the widget reaches the
58
+ * shell, so Theia only ever tracks this one.
59
+ */
60
+ configure(options: GLSPDiagramWidgetOptions, diContainer: Container): void;
61
+ /** The widget's saveable. Override to change how saves and dirty state behave. */
62
+ protected createSaveable(): GLSPDiagramWidget['saveable'];
63
+ /** Adds the window's resume token, so a reload or reconnect takes this diagram's session over. */
64
+ protected getRequestModelOptions(): Args;
51
65
  protected onAfterAttach(msg: Message): void;
52
66
  dispose(): void;
67
+ /**
68
+ * GLSP's restore with `animate: false`; compare the two on a GLSP upgrade.
69
+ * An animated restore holds back every later command, so a Delete right
70
+ * after a select-all typed as the diagram opens finds nothing selected.
71
+ */
72
+ protected setViewportData(viewportData: Parameters<GLSPDiagramWidget['setViewportData']>[0]): Promise<void>;
53
73
  /**
54
74
  * Cover the canvas until the load settles.
55
75
  *
@@ -59,13 +79,7 @@ export declare class HydraniumGlspDiagramWidget extends GLSPDiagramWidget {
59
79
  * rather than creating and immediately removing one, so there is no flash.
60
80
  */
61
81
  protected showLoadingOverlay(): void;
62
- /**
63
- * Take the overlay down, or keep it as the failure's only reporter.
64
- *
65
- * The overlay is retained ONLY for a failure the loader could not surface;
66
- * anything else uncovers the canvas, so a load that failed *and was reported*
67
- * reveals GLSP's status overlay rather than double-reporting on top of it.
68
- */
82
+ /** Take the overlay down, or keep it as the failure's report. */
69
83
  protected onLoadSettled(outcome: DiagramLoadOutcome): void;
70
84
  /**
71
85
  * Repurpose the pending overlay in place as a failure report: same node, so
@@ -78,6 +92,10 @@ export declare class HydraniumGlspDiagramWidget extends GLSPDiagramWidget {
78
92
  * is a no-op rather than a fallback wording.
79
93
  */
80
94
  protected showLoadFailure(error: unknown): void;
95
+ /** Ask for a fresh widget, after a failed load. */
96
+ protected retryLoad(): void;
97
+ /** Build the failure overlay's Retry button, which calls {@link retryLoad}. */
98
+ protected createRetryButton(): HTMLElement;
81
99
  protected hideLoadingOverlay(): void;
82
100
  /** Build the overlay DOM. Override to change the wording or add content; the
83
101
  * root must carry {@link DIAGRAM_LOADING_CLASS} for the shipped styling, and
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-widget.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-widget.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,KAAK,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAInF,OAAO,iCAAiC,CAAC;AAEzC,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AAEjE;kFACkF;AAClF,eAAO,MAAM,4BAA4B,qCAAoC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBACa,0BAA2B,SAAQ,iBAAiB;IAC9D,SAAS,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC;cAEpB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI;IAO3C,OAAO,IAAI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