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

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
package/README.md CHANGED
@@ -1,60 +1,23 @@
1
1
  # `@hydranium/glsp-client-theia`
2
2
 
3
- Theia client primitives for the hydranium **GLSP head** — the companion of
4
- `@hydranium/glsp-server` in the
5
- [Hydranium](https://github.com/eclipse-emfcloud/hydranium) framework.
6
-
7
- It sits between `@eclipse-glsp/theia-integration` and an adopter's diagram: the
8
- module composition, the instrumented dispatcher and bounds updater, the loading
9
- overlay, the marker-propagation switch, and the backend socket bridge. Install it
10
- if you are mounting a hydranium GLSP diagram in a Theia application.
3
+ The Theia integration for the
4
+ [Hydranium](https://github.com/eclipse-emfcloud/hydranium) GLSP head, the
5
+ companion of `@hydranium/glsp-server`. Install it to mount a Hydranium diagram
6
+ in a Theia application. It builds on `@eclipse-glsp/theia-integration`,
7
+ `@hydranium/glsp-client` and `@hydranium/client-theia`.
11
8
 
12
9
  ## What it gives you
13
10
 
14
- - **`AbstractHydraniumGlspTheiaFrontendModule`** — a `GLSPTheiaFrontendModule`
15
- subclass that absorbs the overrides every adopter otherwise writes verbatim.
16
- You declare `diagramLanguage`, `diagramConfiguration` and `diagramManager`;
17
- optionally set `logLevelPreference` (the base then binds the log-threshold
18
- contribution for you) and override `bindClientContribution()` — returning
19
- `SkipClientContribution` for a secondary diagram type that shares a server with
20
- a primary one.
21
- - **`createGlspClientTheiaModule(context, options)`** — the standard per-diagram
22
- bindings, all unconditional: the cross-head `ChannelLogger`,
23
- `HydraniumGlspActionDispatcher`, `HydraniumDiagramLoader`,
24
- `HydraniumHiddenBoundsUpdater`, and `HydraniumGlspMessageService`. Each
25
- replaces a GLSP default with a strict superset of its behaviour, so a head that
26
- wants the original rebinds that one token back.
27
- - **Loading feedback that cannot silently vanish.** `HydraniumDiagramLoader`
28
- catches every load failure — the dispatcher-init, connect and first
29
- `RequestModelAction` steps upstream leaves unwrapped — routes it to the Output
30
- channel, and reports it as an error `StatusAction`. It publishes a terminal
31
- `DiagramLoadOutcome`, which `HydraniumGlspDiagramWidget` keys its opaque canvas
32
- overlay on (`DIAGRAM_LOADING_CLASS`, `DIAGRAM_LOADING_FAILED_CLASS`).
33
- `HydraniumGlspMessageService` then drops the now-redundant "Model loading in
34
- progress" toast (`MODEL_LOADING_PROGRESS_TITLE`) and forwards every other
35
- progress report untouched.
36
- - **Instrumentation.** `HydraniumGlspActionDispatcher` logs action traffic into
37
- the shared Output channel and pairs requests with responses — by id, or by kind
38
- for the GLSP flow actions that carry none (`HYDRANIUM_DEFAULT_LOGGED_KINDS`,
39
- `HYDRANIUM_DEFAULT_KIND_PAIRS`, extensible via
40
- `HydraniumGlspActionDispatcherOptions`). `HydraniumHiddenBoundsUpdater` emits
41
- one trace line per bounds request with the measured element count and the raw
42
- `getBBox` cost — the client-side phase that scales with rendered elements
43
- rather than model size.
44
- - **`AbstractHydraniumGlspDiagramConfiguration`** with
45
- `propagateMarkersToProblemsView` — set it `false` for a head whose co-resident
46
- LSP already publishes the same diagnostics, and the per-diagram container binds
47
- `NoOpExternalMarkerManager` instead: markers still decorate the diagram, but
48
- Theia's Problems view stops double-listing them.
49
- **`AbstractHydraniumGlspDiagramManager`** derives the language-correlated
50
- getters from one descriptor plus a label.
51
- - **`HydraniumGlspClientContribution`** — for a server that starts late: it tails
52
- the Output channel for a server-printed ready marker and defers `start` until a
53
- workspace is open.
54
- - **Backend (`./node`)** — `GlspServerConnectionHandler` (the socket bridge,
55
- plugging in `@eclipse-glsp/theia-integration`'s `SocketConnectionForwarder`) and
56
- `createGlspConnectionContainerModule(handler)` for the frontend-scoped module
57
- boilerplate.
11
+ - A diagram mounted from one subclass of
12
+ `AbstractHydraniumGlspTheiaFrontendModule`.
13
+ - Load failures shown on the diagram with a Retry, and logged to the Output
14
+ channel beside the diagram's action traffic.
15
+ - A client that waits for a workspace, and starts again after a failed start
16
+ or a lost connection.
17
+ - Unsaved diagram changes kept across a reload or a reconnect, while the server
18
+ stays the same.
19
+ - Problems listed once when the LSP head reports them too.
20
+ - The backend handler that relays the channel to the GLSP server's socket.
58
21
 
59
22
  ## Install
60
23
 
@@ -62,73 +25,72 @@ if you are mounting a hydranium GLSP diagram in a Theia application.
62
25
  npm install @hydranium/glsp-client-theia
63
26
  ```
64
27
 
65
- You must already have a Theia application wired for GLSP — `@eclipse-glsp/client`
66
- and `@eclipse-glsp/theia-integration` are peers, not bundled — and a running
67
- hydranium GLSP server. The declared peer dependencies are:
68
-
69
28
  | Peer | Range |
70
29
  | --------------------------------- | ------------- |
71
30
  | `@eclipse-glsp/client` | `^2.6.0` |
72
31
  | `@eclipse-glsp/theia-integration` | `^2.6.0` |
73
32
  | `@hydranium/client-theia` | `^1.0.0-next` |
33
+ | `@hydranium/glsp-client` | `^1.0.0-next` |
74
34
  | `@hydranium/protocol` | `^1.0.0-next` |
75
35
  | `@theia/core` | `^1.70.0` |
76
- | `@theia/output` | `^1.70.0` |
77
36
  | `@theia/process` | `^1.70.0` |
78
37
  | `@theia/workspace` | `^1.70.0` |
79
38
  | `inversify` | `^6.0.0` |
80
39
  | `snabbdom` | `^3.5.1` |
40
+ | `vscode-jsonrpc` | `^9.0.0` |
81
41
 
82
42
  ## Wiring
83
43
 
84
- This package declares no `theiaExtensions` — it is a library your own Theia
85
- extension builds on. That extension declares the entries; a diagram is one
86
- frontend/backend pair:
87
-
88
- - the **frontend** entry points at a module that
89
- `export default new MyDiagramModule()`, where `MyDiagramModule` extends
90
- `AbstractHydraniumGlspTheiaFrontendModule`. Your `DiagramConfiguration`
91
- subclass calls `createGlspClientTheiaModule` in its container initialisation,
92
- passing the `channelLogger` name;
93
- - the **backend** entry is typically
94
- `export default createGlspConnectionContainerModule(MyHandler)`, where
95
- `MyHandler` extends `GlspServerConnectionHandler`. The handler's
96
- `languageContributionId` decides the per-language service path Theia routes
97
- frontend connections to.
98
-
99
- **The `style/` directory needs no action from you.** It holds one stylesheet,
100
- `diagram-loading.css`, for the widget's loading overlay, and the widget module
101
- imports it itself — precisely so an adopter cannot ship an unstyled `div` in
102
- normal flow by forgetting it. It is listed in `files` because it must be present
103
- in the published tarball for that import to resolve; your bundler needs a CSS
104
- loader, which a Theia application's webpack configuration already has. Colours
105
- come from `--theia-*` theme variables, and every rule is overridable from a
106
- stylesheet loaded afterwards.
44
+ This package declares no `theiaExtensions`; your own Theia extension declares
45
+ them, one frontend and backend pair per diagram.
46
+
47
+ - The frontend entry exports `new MyDiagramModule()`, where `MyDiagramModule`
48
+ extends `AbstractHydraniumGlspTheiaFrontendModule` and names the diagram's
49
+ language, configuration and manager. Return a subclass of
50
+ `HydraniumGlspClientContribution` from its `bindClientContribution()`, and
51
+ set its `logLevelPreference` to have it bind the log level preference.
52
+ - Your diagram configuration extends
53
+ `AbstractHydraniumGlspDiagramConfiguration` and calls
54
+ `createGlspClientTheiaModule` from its `configureContainer`, not from the
55
+ frontend module: called earlier, GLSP's own bindings silently replace its
56
+ rebinds. It binds `@hydranium/glsp-client`'s classes over the Output
57
+ channel; your host-neutral diagram module still calls
58
+ `configureHydraniumModelElements` from that package and names
59
+ `HydraniumGEdge` for its edge types. Set `propagateMarkersToProblemsView`
60
+ to `false` when the LSP head already reports the same problems.
61
+ - One frontend module calls `bindEditorDiskSync` from
62
+ `@hydranium/client-theia`, since a diagram save writes a file an editor can
63
+ have open.
64
+ - The backend entry exports `createGlspConnectionContainerModule(MyHandler)`,
65
+ where `MyHandler` extends `GlspServerConnectionHandler`.
66
+
67
+ The widget imports its own stylesheet, so your bundler needs a CSS loader,
68
+ which a Theia application has.
69
+
70
+ For the whole setup, see *Host in Theia* in
71
+ [Adopting Hydranium](https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/ADOPTING.md).
107
72
 
108
73
  ## Entry points
109
74
 
110
- | Subpath | Holds | Environment |
111
- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
112
- | `.` | Re-exports `./browser` — the larger of the two tiers and safe to load anywhere. | browser-neutral (gated) |
113
- | `./browser` | The frontend module bases, `createGlspClientTheiaModule`, the dispatcher, loader, widget, bounds updater, message service, diagram manager and configuration bases, `NoOpExternalMarkerManager` | browser / Theia frontend (gated) |
114
- | `./node` | `GlspServerConnectionHandler`, `createGlspConnectionContainerModule` | Node / Theia backend |
115
- | `./testing` | `makeBindRecorder`, the GLSP-module-specific Inversify double (the cross-head doubles live in `@hydranium/client-theia/testing`) | browser-neutral (gated) |
75
+ | Subpath | Use it for | Runs in |
76
+ | ----------------------------- | ---------------------------------------------------- | --------------- |
77
+ | `.` | The same as `./browser` | Theia frontend |
78
+ | `./browser` | The frontend module, configuration and manager bases | Theia frontend |
79
+ | `./node` | The connection handler and its backend module | Theia backend |
80
+ | `./style/diagram-loading.css` | The loading overlay's stylesheet, imported for you | browser |
116
81
 
117
- Every subpath also has a `./lib/<name>` twin for consumers on
118
- `moduleResolution: "Node"`. "Gated" means the repository's neutral-bundle check
119
- enforces that the entry bundles for the browser with no `node:*` import,
120
- transitive ones included; `./node` is deliberately outside that gate. Also
121
- worth reading: [what "gated neutral" does and does not promise](../../docs/concepts/browser-hosting.md#a-note-on-what-gated-neutral-does-and-does-not-promise).
82
+ The subpaths need a TypeScript `moduleResolution` that reads `exports`
83
+ (`NodeNext` or `Bundler`); see *Requirements* in
84
+ [Adopting Hydranium](https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/ADOPTING.md).
122
85
 
123
86
  ## Status
124
87
 
125
- Alpha — pre-v0, not yet published. The API is not stable and may change without a
126
- deprecation cycle. See [`docs/concepts/architecture.md`](../../docs/concepts/architecture.md) for
127
- the GLSP head's place among the heads, and the
128
- [repository README](../../README.md) for current status and known limitations.
88
+ Alpha: every release is a prerelease that may break the API, so pin an exact
89
+ version. Guides and known limitations:
90
+ [Adopting Hydranium](https://github.com/eclipse-emfcloud/hydranium/blob/main/docs/ADOPTING.md).
129
91
 
130
92
  ## License
131
93
 
132
- `MIT` — see this package's [`LICENSE`](./LICENSE). Third-party notices for the
133
- runtime dependency closure are collected in the repository
134
- [`NOTICE.md`](../../NOTICE.md).
94
+ `MIT` — see this package's [`LICENSE`](./LICENSE), and the repository
95
+ [`NOTICE.md`](https://github.com/eclipse-emfcloud/hydranium/blob/main/NOTICE.md)
96
+ for third-party notices.
@@ -6,48 +6,110 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { type GLSPClient } from '@eclipse-glsp/client';
9
+ import { type GLSPClient, type InitializeResult } from '@eclipse-glsp/client';
10
10
  import { BaseGLSPClientContribution } from '@eclipse-glsp/theia-integration';
11
- import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
11
+ import { ChannelLogger, ConnectionReporter, type ConnectionTarget } from '@hydranium/client-theia/browser';
12
+ import { Clock } from '@hydranium/client-theia/common';
13
+ import { type Stopwatch } from '@hydranium/protocol';
14
+ import { type Channel, Emitter, Event } from '@theia/core';
15
+ import { Deferred } from '@theia/core/lib/common/promise-util';
12
16
  import { WorkspaceService } from '@theia/workspace/lib/browser';
13
- /** Options for `HydraniumGlspClientContribution`. The channel name is the
14
- * Theia Output channel both the LSP and GLSP sides write to (so log lines
15
- * interleave); the ready marker is a server-printed substring that signals
16
- * "the GLSP server is accepting client connections". */
17
+ import 'vscode-jsonrpc/browser';
18
+ export declare const DEFAULT_GLSP_CLIENT_STARTUP_TIMEOUT_MS = 30000;
19
+ /** Options for `HydraniumGlspClientContribution`. */
17
20
  export interface ClientContributionOptions {
18
21
  readonly languageContributionId: string;
19
- readonly channelName: string;
20
- readonly readyMarker: string;
22
+ /** How long a start may take, from the workspace opening to the server
23
+ * answering `initializeServer`, before it fails; `0` or less waits for good. */
24
+ readonly startupTimeoutMs?: number;
21
25
  }
22
26
  /**
23
27
  * Theia GLSP client contribution for adopters whose GLSP server runs in a
24
28
  * sideloaded VS Code extension process (or any other deferred-start setup).
25
- * The behaviours adopters reliably need are lifted:
26
29
  *
27
- * 1. `waitForBackendConnected`: tail the OutputChannel for a server-printed
28
- * ready marker. While a socket connection might open earlier, the GLSP
29
- * server typically does internal initialisation before it can accept
30
- * client connections — we wait for it to say so.
31
- * 2. `start`: defer until a workspace is opened. If Theia starts without a
32
- * workspace, this prevents the frontend-backend connection (and its
33
- * "connecting" progress spinner) from firing prematurely.
30
+ * The client starts once a workspace is open and sends its first request at
31
+ * once; the backend handler holds it until its socket to the server is up. A
32
+ * start that fails, and a connection lost after one succeeded, start a fresh
33
+ * client after a backoff, for as long as the contribution lives. Each start is
34
+ * reported through the {@link ConnectionReporter}, and announced through
35
+ * {@link onDidStartClient} and {@link onDidLoseClient}.
34
36
  *
35
37
  * A `GLSPClient` override filtering inbound messages by clientId is
36
38
  * deliberately NOT provided: upstream's `BaseJsonrpcGLSPClient.onActionMessage`
37
- * already filters by clientId, so the `TheiaJsonrpcGLSPClient` returned by
38
- * `BaseGLSPClientContribution.createGLSPClient` is correct as-is.
39
+ * already filters by clientId.
39
40
  */
40
41
  export declare class HydraniumGlspClientContribution extends BaseGLSPClientContribution {
41
- protected outputChannelManager: OutputChannelManager;
42
42
  protected readonly workspaceService: WorkspaceService;
43
+ protected readonly connectionReporter: ConnectionReporter;
44
+ protected readonly logger: ChannelLogger;
45
+ /** Times the restart escalation reset: the container's {@link Clock}, or a `SystemClock`. */
46
+ protected readonly clock: Clock;
43
47
  readonly id: string;
44
- protected readonly channelName: string;
45
- protected readonly readyMarker: string;
48
+ /** Delay before the restart following each consecutive failed start or lost
49
+ * client; the last repeats. */
50
+ protected readonly restartDelaysMs: readonly number[];
51
+ /** How long a client must stay up before the restart delays start over, so
52
+ * a server that fails right after starting is not restarted at once. */
53
+ protected readonly restartEscalationResetMs: number;
54
+ protected consecutiveFailures: number;
55
+ protected restartTimer?: ReturnType<typeof setTimeout>;
56
+ /** Running since the current client started; cleared once a restart has taken it into account. */
57
+ protected sinceStart?: Stopwatch;
58
+ /** Clients started so far, which numbers them in the log: they share {@link id}. */
59
+ protected startedClients: number;
60
+ /** The attempt waiting for a channel, if any. */
61
+ protected channelRequest?: Deferred<Channel>;
62
+ protected disposed: boolean;
63
+ protected readonly clientStartedEmitter: Emitter<GLSPClient>;
64
+ protected readonly clientLostEmitter: Emitter<void>;
65
+ /** Fires with each client once it has started and its server has answered. */
66
+ readonly onDidStartClient: Event<GLSPClient>;
67
+ /** Fires when the started client stops; {@link glspClient} already waits
68
+ * for its replacement then. */
69
+ readonly onDidLoseClient: Event<void>;
46
70
  constructor(options: ClientContributionOptions);
47
- /** Wait for the server to print its ready marker into the OutputChannel.
48
- * Resolves immediately if the marker is already present (server started
49
- * before the client contribution mounted). */
50
- protected waitForBackendConnected(): Promise<void>;
71
+ /** The client every diagram load awaits; after a failed start, a fresh one. */
72
+ get glspClient(): Promise<GLSPClient>;
73
+ /** Start a fresh client over a fresh channel at once, if the last start failed. */
74
+ restart(): Promise<GLSPClient>;
75
+ /** Point {@link glspClient} at a fresh client still to start, and tear down
76
+ * the old one's channel. */
77
+ protected replaceClient(): void;
78
+ /** Settles the promise current when it began, so a start a restart overtook
79
+ * cannot settle its successor. */
80
+ protected activateClient(): Promise<void>;
81
+ /** Run `restart` after the delay for the failures so far, and return that delay. */
82
+ protected scheduleRestart(restart: () => void): number;
83
+ /** Once `client` stops, replace it and start its replacement after the
84
+ * restart delay, unless a dispose stopped it. */
85
+ protected restartOnLoss(client: GLSPClient): void;
86
+ /** Start the client and initialize its server, rejecting on failure; the
87
+ * caller settles {@link glspClient}. */
51
88
  protected start(glspClient: GLSPClient): Promise<void>;
89
+ /** Without upstream's own error notification, which would duplicate the reporter's. */
90
+ protected initialize(glspClient: GLSPClient): Promise<InitializeResult>;
91
+ /** Upstream's base client, without the notifications of its Theia subclass,
92
+ * which would duplicate the reporter's. */
93
+ protected createGLSPClient(connectionProvider: Parameters<BaseGLSPClientContribution['createGLSPClient']>[0]): Promise<GLSPClient>;
94
+ /**
95
+ * Whichever channel arrives goes to the attempt waiting now, and one that
96
+ * arrives with none waiting is closed. Theia holds each open until its
97
+ * websocket is back, and after an outage every held open past the first
98
+ * throws "already open" without reaching its handler, so the first to arrive
99
+ * has to serve the latest attempt. Without Theia's replay, which would be a
100
+ * second opener of the same path.
101
+ */
102
+ protected createChannelConnection(): ReturnType<BaseGLSPClientContribution['createChannelConnection']>;
103
+ /** Also closes the channel: upstream leaves a Theia channel open, and the
104
+ * next one on the same path then cannot open. */
105
+ protected disposeChannel(connection: Parameters<BaseGLSPClientContribution['disposeChannel']>[0], channel: Channel): Promise<void>;
106
+ /** Also fails a start in flight, so nothing reports it after this. */
107
+ dispose(): void;
108
+ protected workspaceOpened(): Promise<void>;
109
+ protected get connectionTarget(): ConnectionTarget;
110
+ /** One object per contribution: the reporter keys what it has shown on it. */
111
+ protected cachedConnectionTarget?: ConnectionTarget;
112
+ protected unreachableMessage(): string;
113
+ protected startupTimeoutMessage(): string;
52
114
  }
53
115
  //# sourceMappingURL=client-contribution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/client-contribution.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,UAAU,E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