@lspeasy/client 3.0.2 → 3.0.3
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/dist/capability-guard.d.ts +78 -4
- package/dist/capability-guard.d.ts.map +1 -1
- package/dist/capability-guard.js +78 -4
- package/dist/capability-guard.js.map +1 -1
- package/dist/capability-proxy.js.map +1 -1
- package/dist/client.d.ts +215 -13
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +162 -14
- package/dist/client.js.map +1 -1
- package/dist/connection/health.d.ts +40 -0
- package/dist/connection/health.d.ts.map +1 -1
- package/dist/connection/health.js +40 -0
- package/dist/connection/health.js.map +1 -1
- package/dist/connection/heartbeat.d.ts +29 -0
- package/dist/connection/heartbeat.d.ts.map +1 -1
- package/dist/connection/heartbeat.js +29 -0
- package/dist/connection/heartbeat.js.map +1 -1
- package/dist/connection/partial-result-collector.js.map +1 -1
- package/dist/connection/registration-store.js.map +1 -1
- package/dist/connection/types.d.ts +46 -4
- package/dist/connection/types.d.ts.map +1 -1
- package/dist/connection/types.js +11 -3
- package/dist/connection/types.js.map +1 -1
- package/dist/index.d.ts +48 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -1
- package/dist/index.js.map +1 -1
- package/dist/notifications/wait.d.ts +57 -2
- package/dist/notifications/wait.d.ts.map +1 -1
- package/dist/notifications/wait.js +44 -1
- package/dist/notifications/wait.js.map +1 -1
- package/dist/progress.js.map +1 -1
- package/dist/types.d.ts +51 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/validation.d.ts +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js.map +1 -1
- package/package.json +6 -7
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Lifecycle state
|
|
2
|
+
* Lifecycle state of an `LSPClient` connection.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Transitions: `Disconnected` → `Connecting` (on `connect()`) → `Connected`
|
|
6
|
+
* (after `initialized`) → `Disconnecting` (on `disconnect()`) →
|
|
7
|
+
* `Disconnected`.
|
|
8
|
+
*
|
|
9
|
+
* Listen for state changes via `LSPClient.onConnectionStateChange`.
|
|
10
|
+
*
|
|
11
|
+
* @category Client
|
|
3
12
|
*/
|
|
4
13
|
export declare enum ConnectionState {
|
|
5
14
|
Connecting = "connecting",
|
|
@@ -9,39 +18,72 @@ export declare enum ConnectionState {
|
|
|
9
18
|
}
|
|
10
19
|
/**
|
|
11
20
|
* Configuration for optional heartbeat monitoring.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* When `enabled` is `true`, the client sends a `$/ping` request at each
|
|
24
|
+
* `interval` milliseconds. If no response arrives within `timeout`
|
|
25
|
+
* milliseconds, the connection is marked unresponsive.
|
|
26
|
+
*
|
|
27
|
+
* @config
|
|
28
|
+
* @category Client
|
|
12
29
|
*/
|
|
13
30
|
export interface HeartbeatConfig {
|
|
31
|
+
/** Whether heartbeat monitoring is active. */
|
|
14
32
|
enabled?: boolean;
|
|
33
|
+
/** Interval between pings in milliseconds. */
|
|
15
34
|
interval: number;
|
|
35
|
+
/** Time to wait for a pong response in milliseconds. */
|
|
16
36
|
timeout: number;
|
|
17
37
|
}
|
|
18
38
|
/**
|
|
19
|
-
*
|
|
39
|
+
* Snapshot of the current heartbeat monitoring status.
|
|
40
|
+
*
|
|
41
|
+
* @category Client
|
|
20
42
|
*/
|
|
21
43
|
export interface HeartbeatStatus {
|
|
44
|
+
/** Whether heartbeat monitoring is active. */
|
|
22
45
|
enabled: boolean;
|
|
46
|
+
/** Interval between pings in milliseconds. */
|
|
23
47
|
interval: number;
|
|
48
|
+
/** Timeout in milliseconds before a ping is considered unanswered. */
|
|
24
49
|
timeout: number;
|
|
50
|
+
/** Timestamp of the last outgoing ping, or `null` if no ping has been sent. */
|
|
25
51
|
lastPing: Date | null;
|
|
52
|
+
/** Timestamp of the last received pong, or `null` if no pong has been received. */
|
|
26
53
|
lastPong: Date | null;
|
|
54
|
+
/** Whether the server responded to the most recent ping within the timeout window. */
|
|
27
55
|
isResponsive: boolean;
|
|
28
56
|
}
|
|
29
57
|
/**
|
|
30
|
-
* Aggregated connection health
|
|
58
|
+
* Aggregated connection health snapshot returned by
|
|
59
|
+
* `LSPClient.getConnectionHealth()`.
|
|
60
|
+
*
|
|
61
|
+
* @category Client
|
|
31
62
|
*/
|
|
32
63
|
export interface ConnectionHealth {
|
|
64
|
+
/** Current lifecycle state of the connection. */
|
|
33
65
|
state: ConnectionState;
|
|
66
|
+
/** Timestamp of the last outgoing message, or `null` if none has been sent. */
|
|
34
67
|
lastMessageSent: Date | null;
|
|
68
|
+
/** Timestamp of the last incoming message, or `null` if none has been received. */
|
|
35
69
|
lastMessageReceived: Date | null;
|
|
70
|
+
/** Heartbeat monitoring snapshot, present only when heartbeat is configured. */
|
|
36
71
|
heartbeat?: HeartbeatStatus;
|
|
37
72
|
}
|
|
38
73
|
/**
|
|
39
|
-
*
|
|
74
|
+
* Payload emitted when the connection state changes.
|
|
75
|
+
* Subscribe via `LSPClient.onConnectionStateChange()`.
|
|
76
|
+
*
|
|
77
|
+
* @category Client
|
|
40
78
|
*/
|
|
41
79
|
export interface StateChangeEvent {
|
|
80
|
+
/** The state the connection was in before this transition. */
|
|
42
81
|
previous: ConnectionState;
|
|
82
|
+
/** The state the connection has transitioned into. */
|
|
43
83
|
current: ConnectionState;
|
|
84
|
+
/** Wall-clock time at which the state transition occurred. */
|
|
44
85
|
timestamp: Date;
|
|
86
|
+
/** Optional human-readable description of why the state changed. */
|
|
45
87
|
reason?: string;
|
|
46
88
|
}
|
|
47
89
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/connection/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/connection/types.ts"],"names":[],"mappings":"AAAA;;;;;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
2
1
|
/**
|
|
3
|
-
* Lifecycle state
|
|
2
|
+
* Lifecycle state of an `LSPClient` connection.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Transitions: `Disconnected` → `Connecting` (on `connect()`) → `Connected`
|
|
6
|
+
* (after `initialized`) → `Disconnecting` (on `disconnect()`) →
|
|
7
|
+
* `Disconnected`.
|
|
8
|
+
*
|
|
9
|
+
* Listen for state changes via `LSPClient.onConnectionStateChange`.
|
|
10
|
+
*
|
|
11
|
+
* @category Client
|
|
4
12
|
*/
|
|
5
|
-
var ConnectionState;
|
|
13
|
+
export var ConnectionState;
|
|
6
14
|
(function (ConnectionState) {
|
|
7
15
|
ConnectionState["Connecting"] = "connecting";
|
|
8
16
|
ConnectionState["Connected"] = "connected";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/connection/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/connection/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,4CAAyB,CAAA;IACzB,0CAAuB,CAAA;IACvB,kDAA+B,CAAA;IAC/B,gDAA6B,CAAA;AAC/B,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* LSP client package for connecting to language servers.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Use `@lspeasy/client` when you need to build the **consumer** side of the
|
|
6
|
+
* Language Server Protocol — an editor extension, a CLI analysis tool, a test
|
|
7
|
+
* harness, or any process that speaks to a language server process.
|
|
8
|
+
*
|
|
9
|
+
* The primary entry point is {@link LSPClient}. Construct it with
|
|
10
|
+
* {@link ClientOptions}, call `connect(transport)` to complete the LSP
|
|
11
|
+
* handshake, then use `expect<ServerCaps>()` to get typed access to
|
|
12
|
+
* capability-aware namespaces (e.g. `client.textDocument.hover(params)`).
|
|
13
|
+
*
|
|
14
|
+
* ### Transport Decision Tree
|
|
15
|
+
*
|
|
16
|
+
* **Stdio** (`StdioTransport` from `@lspeasy/core/node`)
|
|
17
|
+
* — Use when: spawning the language server as a child process (the canonical
|
|
18
|
+
* editor extension pattern). Zero network overhead; server and client share
|
|
19
|
+
* a lifespan. Failure mode: server process dies silently → stdout EOF fires
|
|
20
|
+
* `onClose`; pair with `HeartbeatMonitor` on long-lived processes.
|
|
21
|
+
*
|
|
22
|
+
* **WebSocket** (`WebSocketTransport` from `@lspeasy/core`)
|
|
23
|
+
* — Use when: the language server runs remotely (CI, container, cloud dev env)
|
|
24
|
+
* or must be browser-accessible. Supports reconnect with exponential back-off.
|
|
25
|
+
* Failure mode: network partition → `onError` fires without `onClose`;
|
|
26
|
+
* enable `enableReconnect` and subscribe to `ConnectionHealthTracker` events.
|
|
27
|
+
*
|
|
28
|
+
* **TCP** (`TcpTransport` from `@lspeasy/core/node`)
|
|
29
|
+
* — Use when: you need a persistent local socket and control both ends
|
|
30
|
+
* (e.g. a test harness or a daemon that outlives the client process).
|
|
31
|
+
* Failure mode: port conflict at startup; use `mode: 'client'` only after
|
|
32
|
+
* confirming the server is listening, or wrap in a retry loop.
|
|
33
|
+
*
|
|
34
|
+
* **DedicatedWorkerTransport** (`DedicatedWorkerTransport` from `@lspeasy/core`)
|
|
35
|
+
* — Use when: running the language server in a Web Worker for browser isolation.
|
|
36
|
+
* Zero latency (shared memory), no WebSocket overhead. Failure mode: worker
|
|
37
|
+
* uncaught exception terminates silently; subscribe to `worker.onerror`.
|
|
38
|
+
*
|
|
39
|
+
* ### Connection health
|
|
40
|
+
* Use {@link ConnectionHealthTracker} and {@link HeartbeatMonitor} to detect
|
|
41
|
+
* silent transport failures. Subscribe to state-change events via
|
|
42
|
+
* {@link ConnectionState}.
|
|
43
|
+
*
|
|
44
|
+
* ### Dynamic registration
|
|
45
|
+
* The client handles `client/registerCapability` and
|
|
46
|
+
* `client/unregisterCapability` requests from the server automatically,
|
|
47
|
+
* updating the typed namespaces at runtime.
|
|
48
|
+
*
|
|
49
|
+
* @packageDocumentation
|
|
3
50
|
*/
|
|
4
51
|
export { LSPClient } from './client.js';
|
|
5
52
|
export { CapabilityGuard, ClientCapabilityGuard } from './capability-guard.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACnG,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAGxE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* LSP client package for connecting to language servers.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Use `@lspeasy/client` when you need to build the **consumer** side of the
|
|
6
|
+
* Language Server Protocol — an editor extension, a CLI analysis tool, a test
|
|
7
|
+
* harness, or any process that speaks to a language server process.
|
|
8
|
+
*
|
|
9
|
+
* The primary entry point is {@link LSPClient}. Construct it with
|
|
10
|
+
* {@link ClientOptions}, call `connect(transport)` to complete the LSP
|
|
11
|
+
* handshake, then use `expect<ServerCaps>()` to get typed access to
|
|
12
|
+
* capability-aware namespaces (e.g. `client.textDocument.hover(params)`).
|
|
13
|
+
*
|
|
14
|
+
* ### Transport Decision Tree
|
|
15
|
+
*
|
|
16
|
+
* **Stdio** (`StdioTransport` from `@lspeasy/core/node`)
|
|
17
|
+
* — Use when: spawning the language server as a child process (the canonical
|
|
18
|
+
* editor extension pattern). Zero network overhead; server and client share
|
|
19
|
+
* a lifespan. Failure mode: server process dies silently → stdout EOF fires
|
|
20
|
+
* `onClose`; pair with `HeartbeatMonitor` on long-lived processes.
|
|
21
|
+
*
|
|
22
|
+
* **WebSocket** (`WebSocketTransport` from `@lspeasy/core`)
|
|
23
|
+
* — Use when: the language server runs remotely (CI, container, cloud dev env)
|
|
24
|
+
* or must be browser-accessible. Supports reconnect with exponential back-off.
|
|
25
|
+
* Failure mode: network partition → `onError` fires without `onClose`;
|
|
26
|
+
* enable `enableReconnect` and subscribe to `ConnectionHealthTracker` events.
|
|
27
|
+
*
|
|
28
|
+
* **TCP** (`TcpTransport` from `@lspeasy/core/node`)
|
|
29
|
+
* — Use when: you need a persistent local socket and control both ends
|
|
30
|
+
* (e.g. a test harness or a daemon that outlives the client process).
|
|
31
|
+
* Failure mode: port conflict at startup; use `mode: 'client'` only after
|
|
32
|
+
* confirming the server is listening, or wrap in a retry loop.
|
|
33
|
+
*
|
|
34
|
+
* **DedicatedWorkerTransport** (`DedicatedWorkerTransport` from `@lspeasy/core`)
|
|
35
|
+
* — Use when: running the language server in a Web Worker for browser isolation.
|
|
36
|
+
* Zero latency (shared memory), no WebSocket overhead. Failure mode: worker
|
|
37
|
+
* uncaught exception terminates silently; subscribe to `worker.onerror`.
|
|
38
|
+
*
|
|
39
|
+
* ### Connection health
|
|
40
|
+
* Use {@link ConnectionHealthTracker} and {@link HeartbeatMonitor} to detect
|
|
41
|
+
* silent transport failures. Subscribe to state-change events via
|
|
42
|
+
* {@link ConnectionState}.
|
|
43
|
+
*
|
|
44
|
+
* ### Dynamic registration
|
|
45
|
+
* The client handles `client/registerCapability` and
|
|
46
|
+
* `client/unregisterCapability` requests from the server automatically,
|
|
47
|
+
* updating the typed namespaces at runtime.
|
|
48
|
+
*
|
|
49
|
+
* @packageDocumentation
|
|
3
50
|
*/
|
|
4
51
|
export { LSPClient } from './client.js';
|
|
5
52
|
export { CapabilityGuard, ClientCapabilityGuard } from './capability-guard.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAS/E,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAOnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,12 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Options for `NotificationWaiter` and `LSPClient.waitForNotification`.
|
|
3
|
+
*
|
|
4
|
+
* @config
|
|
5
|
+
* @typeParam TParams - The notification params type for the awaited method.
|
|
6
|
+
* @category Client
|
|
3
7
|
*/
|
|
4
8
|
export interface NotificationWaitOptions<TParams> {
|
|
9
|
+
/**
|
|
10
|
+
* Maximum time to wait in milliseconds before rejecting with a timeout error.
|
|
11
|
+
*/
|
|
5
12
|
timeout: number;
|
|
13
|
+
/**
|
|
14
|
+
* Optional predicate to skip notifications that don't match the expected
|
|
15
|
+
* content. The waiter continues listening until a matching notification
|
|
16
|
+
* arrives or the timeout expires.
|
|
17
|
+
*/
|
|
6
18
|
filter?: (params: TParams) => boolean;
|
|
7
19
|
}
|
|
8
20
|
/**
|
|
9
|
-
* Tracks a single wait-for-notification operation and timeout lifecycle.
|
|
21
|
+
* Tracks a single wait-for-notification operation and its timeout lifecycle.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Created internally by `LSPClient.waitForNotification`. Use
|
|
25
|
+
* `LSPClient.waitForNotification` rather than instantiating this class
|
|
26
|
+
* directly.
|
|
27
|
+
*
|
|
28
|
+
* @useWhen
|
|
29
|
+
* You need to await a specific server-to-client notification after triggering
|
|
30
|
+
* a server-side operation — for example, waiting for
|
|
31
|
+
* `textDocument/publishDiagnostics` after saving a document.
|
|
32
|
+
*
|
|
33
|
+
* @avoidWhen
|
|
34
|
+
* You need to listen for ongoing notifications (not a one-shot wait) — use
|
|
35
|
+
* `LSPClient.onNotification` for persistent subscriptions instead.
|
|
36
|
+
*
|
|
37
|
+
* @never
|
|
38
|
+
* NEVER create a `NotificationWaiter` without setting a timeout — an
|
|
39
|
+
* indefinite wait will leak the waiter permanently if the notification never
|
|
40
|
+
* arrives (e.g. the server suppresses it for certain file types).
|
|
41
|
+
*
|
|
42
|
+
* NEVER use `NotificationWaiter` to wait for notifications that arrive before
|
|
43
|
+
* the waiter is registered. The waiter only sees notifications emitted after
|
|
44
|
+
* `start()` is called; earlier notifications are silently missed.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* // Wait for diagnostics after saving
|
|
49
|
+
* const diags = await client.waitForNotification(
|
|
50
|
+
* 'textDocument/publishDiagnostics',
|
|
51
|
+
* {
|
|
52
|
+
* timeout: 5000,
|
|
53
|
+
* filter: (params) => params.uri === 'file:///src/main.ts',
|
|
54
|
+
* }
|
|
55
|
+
* );
|
|
56
|
+
* console.log(diags.diagnostics);
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @typeParam TParams - The notification params type.
|
|
60
|
+
* @category Client
|
|
10
61
|
*/
|
|
11
62
|
export declare class NotificationWaiter<TParams> {
|
|
12
63
|
private readonly method;
|
|
@@ -22,6 +73,10 @@ export declare class NotificationWaiter<TParams> {
|
|
|
22
73
|
start(): void;
|
|
23
74
|
/**
|
|
24
75
|
* Returns whether an incoming notification satisfies this waiter.
|
|
76
|
+
*
|
|
77
|
+
* @param method - The notification method string of the incoming message.
|
|
78
|
+
* @param params - The notification params to test against the optional filter predicate.
|
|
79
|
+
* @returns `true` when the method matches and the filter (if any) passes.
|
|
25
80
|
*/
|
|
26
81
|
matches(method: string, params: TParams): boolean;
|
|
27
82
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../src/notifications/wait.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"wait.d.ts","sourceRoot":"","sources":["../../src/notifications/wait.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB,CAAC,OAAO;IAC9C;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAAa,kBAAkB,CAAC,OAAO;IAMnC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAGxB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAT5B,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA4B;IACtD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAElD,YACmB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,uBAAuB,CAAC,OAAO,CAAC,EAC1D,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,EAClC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,EACb,SAAS,EAAE,MAAM,IAAI,EAIvC;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CASZ;IAED;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAUhD;IAED;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAG7B;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAGzB;IAED;;OAEG;IACH,OAAO,IAAI,IAAI,CAOd;CACF"}
|
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tracks a single wait-for-notification operation and timeout lifecycle.
|
|
2
|
+
* Tracks a single wait-for-notification operation and its timeout lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Created internally by `LSPClient.waitForNotification`. Use
|
|
6
|
+
* `LSPClient.waitForNotification` rather than instantiating this class
|
|
7
|
+
* directly.
|
|
8
|
+
*
|
|
9
|
+
* @useWhen
|
|
10
|
+
* You need to await a specific server-to-client notification after triggering
|
|
11
|
+
* a server-side operation — for example, waiting for
|
|
12
|
+
* `textDocument/publishDiagnostics` after saving a document.
|
|
13
|
+
*
|
|
14
|
+
* @avoidWhen
|
|
15
|
+
* You need to listen for ongoing notifications (not a one-shot wait) — use
|
|
16
|
+
* `LSPClient.onNotification` for persistent subscriptions instead.
|
|
17
|
+
*
|
|
18
|
+
* @never
|
|
19
|
+
* NEVER create a `NotificationWaiter` without setting a timeout — an
|
|
20
|
+
* indefinite wait will leak the waiter permanently if the notification never
|
|
21
|
+
* arrives (e.g. the server suppresses it for certain file types).
|
|
22
|
+
*
|
|
23
|
+
* NEVER use `NotificationWaiter` to wait for notifications that arrive before
|
|
24
|
+
* the waiter is registered. The waiter only sees notifications emitted after
|
|
25
|
+
* `start()` is called; earlier notifications are silently missed.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* // Wait for diagnostics after saving
|
|
30
|
+
* const diags = await client.waitForNotification(
|
|
31
|
+
* 'textDocument/publishDiagnostics',
|
|
32
|
+
* {
|
|
33
|
+
* timeout: 5000,
|
|
34
|
+
* filter: (params) => params.uri === 'file:///src/main.ts',
|
|
35
|
+
* }
|
|
36
|
+
* );
|
|
37
|
+
* console.log(diags.diagnostics);
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @typeParam TParams - The notification params type.
|
|
41
|
+
* @category Client
|
|
3
42
|
*/
|
|
4
43
|
export class NotificationWaiter {
|
|
5
44
|
method;
|
|
@@ -26,6 +65,10 @@ export class NotificationWaiter {
|
|
|
26
65
|
}
|
|
27
66
|
/**
|
|
28
67
|
* Returns whether an incoming notification satisfies this waiter.
|
|
68
|
+
*
|
|
69
|
+
* @param method - The notification method string of the incoming message.
|
|
70
|
+
* @param params - The notification params to test against the optional filter predicate.
|
|
71
|
+
* @returns `true` when the method matches and the filter (if any) passes.
|
|
29
72
|
*/
|
|
30
73
|
matches(method, params) {
|
|
31
74
|
if (method !== this.method) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wait.js","sourceRoot":"","sources":["../../src/notifications/wait.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wait.js","sourceRoot":"","sources":["../../src/notifications/wait.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAA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IACH,OAAO;QACL,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACjC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;QACjC,CAAC;QAED,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CACF"}
|
package/dist/progress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../src/progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoCH;;;GAGG;AACH,MAAM,OAAO,eAAe;IAClB,QAAQ,GAAG,IAAI,GAAG,EAAkC,CAAC;IACrD,cAAc,GAAsB,EAAE,CAAC;IAE/C;;OAEG;IACH,UAAU,CAAC,KAAoB,EAAE,OAAwB
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../src/progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoCH;;;GAGG;AACH,MAAM,OAAO,eAAe;IAClB,QAAQ,GAAG,IAAI,GAAG,EAAkC,CAAC;IACrD,cAAc,GAAsB,EAAE,CAAC;IAE/C;;OAEG;IACH,UAAU,CAAC,KAAoB,EAAE,OAAwB;QACvD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,OAAO;YACL,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,OAAwB;QACpC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO;YACL,OAAO,EAAE,GAAG,EAAE;gBACZ,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBACnD,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;oBACjB,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;gBACvC,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,cAAc,CAAC,MAAsB;QACzC,uCAAuC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QAED,2BAA2B;QAC3B,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;CACF"}
|
package/dist/types.d.ts
CHANGED
|
@@ -10,7 +10,14 @@ import type { HeartbeatConfig } from './connection/types.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export type { Client } from '@lspeasy/core';
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Configuration for an `LSPClient` instance.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Passed to the `LSPClient` constructor. All fields are optional; the client
|
|
17
|
+
* works with zero configuration.
|
|
18
|
+
*
|
|
19
|
+
* @config
|
|
20
|
+
* @category Client
|
|
14
21
|
*/
|
|
15
22
|
export interface ClientOptions<ClientCaps extends Partial<ClientCapabilities> = ClientCapabilities> {
|
|
16
23
|
/**
|
|
@@ -61,43 +68,81 @@ export interface ClientOptions<ClientCaps extends Partial<ClientCapabilities> =
|
|
|
61
68
|
onValidationError?: (error: ZodError, response: ResponseMessage) => void;
|
|
62
69
|
}
|
|
63
70
|
/**
|
|
64
|
-
* Initialize result from server
|
|
71
|
+
* Initialize result from server.
|
|
72
|
+
*
|
|
73
|
+
* @category Client
|
|
65
74
|
*/
|
|
66
75
|
export interface InitializeResult {
|
|
76
|
+
/** Server capabilities advertised in the `initialize` response. */
|
|
67
77
|
capabilities: import('vscode-languageserver-protocol').ServerCapabilities;
|
|
78
|
+
/** Optional server identification returned by the language server. */
|
|
68
79
|
serverInfo?: {
|
|
80
|
+
/** Human-readable name of the language server. */
|
|
69
81
|
name: string;
|
|
82
|
+
/** Optional version string of the language server. */
|
|
70
83
|
version?: string;
|
|
71
84
|
};
|
|
72
85
|
}
|
|
73
86
|
/**
|
|
74
|
-
*
|
|
87
|
+
* Return value of `LSPClient.sendCancellableRequest`.
|
|
88
|
+
*
|
|
89
|
+
* @remarks
|
|
90
|
+
* `promise` rejects with a cancellation error when `cancel()` is called.
|
|
91
|
+
* Always attach a `.catch()` handler to `promise` before calling `cancel()`
|
|
92
|
+
* to avoid unhandled promise rejections.
|
|
93
|
+
*
|
|
94
|
+
* @typeParam T - The expected response result type.
|
|
95
|
+
* @category Client
|
|
75
96
|
*/
|
|
76
97
|
export interface CancellableRequest<T> {
|
|
77
98
|
/**
|
|
78
|
-
* Promise that resolves with the request result
|
|
99
|
+
* Promise that resolves with the request result or rejects on cancellation.
|
|
79
100
|
*/
|
|
80
101
|
promise: Promise<T>;
|
|
81
102
|
/**
|
|
82
|
-
*
|
|
103
|
+
* Cancels the in-flight request and sends `$/cancelRequest` to the server.
|
|
83
104
|
*/
|
|
84
105
|
cancel: () => void;
|
|
85
106
|
}
|
|
86
107
|
/**
|
|
87
|
-
* Options for
|
|
108
|
+
* Options for `LSPClient.sendRequestWithPartialResults`.
|
|
109
|
+
*
|
|
110
|
+
* @config
|
|
111
|
+
* @typeParam TPartial - The partial result element type.
|
|
112
|
+
* @category Client
|
|
88
113
|
*/
|
|
89
114
|
export interface PartialRequestOptions<TPartial> {
|
|
115
|
+
/**
|
|
116
|
+
* Custom `partialResultToken` value; auto-generated when omitted.
|
|
117
|
+
*/
|
|
90
118
|
token?: string | number;
|
|
119
|
+
/**
|
|
120
|
+
* Called for each `$/progress` notification carrying a partial result.
|
|
121
|
+
*/
|
|
91
122
|
onPartial: (partial: TPartial) => void;
|
|
92
123
|
}
|
|
93
124
|
/**
|
|
94
125
|
* Result returned by partial-result enabled requests.
|
|
95
126
|
*/
|
|
96
127
|
export type PartialRequestResult<TPartial, TResult> = PartialRequestOutcome<TPartial, TResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Namespace for sending notebook-document lifecycle notifications to a server.
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* Available on `client.notebookDocument` after `connect()`. Mirrors the
|
|
133
|
+
* standard LSP `notebookDocument/*` notification methods for clients that
|
|
134
|
+
* declare `notebookDocumentSync` capability.
|
|
135
|
+
*
|
|
136
|
+
* @category Client
|
|
137
|
+
*/
|
|
97
138
|
export interface NotebookDocumentNamespace {
|
|
139
|
+
/** Notify the server that a notebook document was opened. */
|
|
98
140
|
didOpen(params: DidOpenNotebookDocumentParams): Promise<void>;
|
|
141
|
+
/** Notify the server that a notebook document changed. */
|
|
99
142
|
didChange(params: DidChangeNotebookDocumentParams): Promise<void>;
|
|
143
|
+
/** Notify the server that a notebook document was saved. */
|
|
100
144
|
didSave(params: DidSaveNotebookDocumentParams): Promise<void>;
|
|
145
|
+
/** Notify the server that a notebook document was closed. */
|
|
101
146
|
didClose(params: DidCloseNotebookDocumentParams): Promise<void>;
|
|
102
147
|
}
|
|
103
148
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAEV,kBAAkB,EAClB,2BAA2B,EAC3B,6BAA6B,EAC7B,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,EACrB,MAAM,EACN,QAAQ,EACR,UAAU,EACV,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,QAAQ,E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CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE"}
|
package/dist/validation.d.ts
CHANGED
|
@@ -39,5 +39,5 @@ export interface ValidationOptions {
|
|
|
39
39
|
/**
|
|
40
40
|
* Creates a response validator with custom options
|
|
41
41
|
*/
|
|
42
|
-
export declare function createValidator(options?: ValidationOptions): <T>(method:
|
|
42
|
+
export declare function createValidator(options?: ValidationOptions): <T>(method: LSPRequestMethod, schema: z.ZodSchema<T>, response: unknown) => T;
|
|
43
43
|
//# sourceMappingURL=validation.d.ts.map
|
package/dist/validation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;aAE9B,MAAM,EAAE,MAAM;aACd,MAAM,EAAE,CAAC,CAAC,QAAQ;aAClB,QAAQ,EAAE,OAAO;IAHnC,YACkB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,CAAC,CAAC,QAAQ,EAClB,QAAQ,EAAE,OAAO,EAIlC;CACF;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACtB,QAAQ,EAAE,OAAO,GAChB,CAAC,CAQH;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC9D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,iBAAsB,IAGpC,CAAC,
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;aAE9B,MAAM,EAAE,MAAM;aACd,MAAM,EAAE,CAAC,CAAC,QAAQ;aAClB,QAAQ,EAAE,OAAO;IAHnC,YACkB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,CAAC,CAAC,QAAQ,EAClB,QAAQ,EAAE,OAAO,EAIlC;CACF;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EACtB,QAAQ,EAAE,OAAO,GAChB,CAAC,CAQH;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC9D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,iBAAsB,IAGpC,CAAC,UAChB,gBAAgB,UAChB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YACZ,OAAO,KAChB,CAAC,CAcL"}
|
package/dist/validation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,M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B,CAAC;QAED,IAAI,CAAC;YACH,OAAO,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QACpD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,uBAAuB,IAAI,iBAAiB,EAAE,CAAC;gBAClE,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lspeasy/client",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Connect to LSP servers with typed client API",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/pradeepmouli/lspeasy/issues"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
|
-
"author": "Pradeep Mouli",
|
|
17
|
+
"author": "Pradeep Mouli <pmouli@mac.com> (https://github.com/pradeepmouli)",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "https://github.com/pradeepmouli/lspeasy.git",
|
|
@@ -37,15 +37,14 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@lspeasy/core": "2.1.
|
|
40
|
+
"@lspeasy/core": "2.1.3"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"zod": "^4.3
|
|
43
|
+
"zod": "^4.4.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"typescript": "^
|
|
47
|
-
"vscode-languageserver-protocol": "^3.17.5"
|
|
48
|
-
"zod": "^4.3.6"
|
|
46
|
+
"typescript": "^6.0.3",
|
|
47
|
+
"vscode-languageserver-protocol": "^3.17.5"
|
|
49
48
|
},
|
|
50
49
|
"engines": {
|
|
51
50
|
"node": ">=20.0.0"
|