@effected/lsp 0.4.0 → 0.5.0
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/LspFrame.js +1 -2
- package/LspProbe.js +1 -2
- package/LspProcess.js +1 -2
- package/LspStdio.js +1 -2
- package/LspTestFailure.js +1 -2
- package/index.d.ts +0 -6
- package/internal/LaunchFailed.js +1 -2
- package/internal/messages.js +1 -2
- package/package.json +1 -1
- package/testing.d.ts +0 -8
package/LspFrame.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Result, Schema, Stream } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/LspFrame.ts
|
|
4
4
|
/** The longest header block, terminator excluded, the decoder buffers before failing `HeaderTooLarge`. */
|
|
5
5
|
const MAX_HEADER_BYTES = 8192;
|
|
6
6
|
/** How many bytes of an offending header an error echoes. */
|
|
@@ -273,5 +273,4 @@ var LspFrame = class {
|
|
|
273
273
|
}
|
|
274
274
|
};
|
|
275
275
|
|
|
276
|
-
//#endregion
|
|
277
276
|
export { LspFrame, LspFrameError, LspFrameErrorCode };
|
package/LspProbe.js
CHANGED
|
@@ -3,7 +3,7 @@ import { truncate } from "./internal/messages.js";
|
|
|
3
3
|
import { spawnParts } from "./LspProcess.js";
|
|
4
4
|
import { Duration, Effect, Ref } from "effect";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/LspProbe.ts
|
|
7
7
|
/**
|
|
8
8
|
* The smallest proof that an installed Language Server bin boots: the whole
|
|
9
9
|
* LSP lifecycle over stdio, and exit code 0.
|
|
@@ -122,5 +122,4 @@ const probe = (command, options) => Effect.gen(function* () {
|
|
|
122
122
|
}));
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
//#endregion
|
|
126
125
|
export { LspProbe };
|
package/LspProcess.js
CHANGED
|
@@ -4,7 +4,7 @@ import { isLspMessage, notJsonRpc, truncate } from "./internal/messages.js";
|
|
|
4
4
|
import { Cause, Deferred, Duration, Effect, Option, Queue, Ref, Result, Stream, SubscriptionRef } from "effect";
|
|
5
5
|
import { ChildProcessSpawner } from "effect/process";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/LspProcess.ts
|
|
8
8
|
const concat = (chunks) => {
|
|
9
9
|
const bytes = new Uint8Array(chunks.reduce((total, chunk) => total + chunk.length, 0));
|
|
10
10
|
let at = 0;
|
|
@@ -278,5 +278,4 @@ const spawnParts = (command, options = {}) => Effect.gen(function* () {
|
|
|
278
278
|
};
|
|
279
279
|
});
|
|
280
280
|
|
|
281
|
-
//#endregion
|
|
282
281
|
export { LspProcess, spawnParts };
|
package/LspStdio.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LaunchFailed } from "./internal/LaunchFailed.js";
|
|
2
2
|
import { Cause, Effect, Exit, References, Runtime } from "effect";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/LspStdio.ts
|
|
5
5
|
/**
|
|
6
6
|
* Run an Effect Language Server over stdio without ever writing a log line or
|
|
7
7
|
* a failure report onto stdout, which is the LSP wire, and exit with the code
|
|
@@ -113,5 +113,4 @@ var LspStdio = class LspStdio {
|
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
//#endregion
|
|
117
116
|
export { LspStdio };
|
package/LspTestFailure.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/LspTestFailure.ts
|
|
4
4
|
/**
|
|
5
5
|
* Why {@link LspProbe.initialize} could not prove a Language Server boots.
|
|
6
6
|
*
|
|
@@ -33,5 +33,4 @@ var LspTestFailure = class extends Schema.TaggedError()("LspTestFailure", {
|
|
|
33
33
|
message: Schema.String
|
|
34
34
|
}) {};
|
|
35
35
|
|
|
36
|
-
//#endregion
|
|
37
36
|
export { LspTestFailure };
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Effect, Result, Runtime, Schema, Stream } from "effect";
|
|
2
|
-
//#region src/LspFrame.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Why a byte stream is not a sequence of LSP base-protocol frames.
|
|
5
4
|
*
|
|
@@ -142,8 +141,6 @@ export declare class LspFrame {
|
|
|
142
141
|
*/
|
|
143
142
|
static decodeStream<E, R>(self: Stream.Stream<Uint8Array, E, R>): Stream.Stream<unknown, E | LspFrameError, R>;
|
|
144
143
|
}
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/LspMessage.d.ts
|
|
147
144
|
/**
|
|
148
145
|
* A JSON-RPC 2.0 message as an LSP frame body carries it: a request (an `id`
|
|
149
146
|
* and a `method`), a notification (a `method`, no `id`) or a response (an
|
|
@@ -176,8 +173,6 @@ interface LspMessage {
|
|
|
176
173
|
readonly data?: unknown;
|
|
177
174
|
};
|
|
178
175
|
}
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/LspStdio.d.ts
|
|
181
176
|
/**
|
|
182
177
|
* How a Language Server session ended, as the server's own message loop
|
|
183
178
|
* observed it. {@link LspStdio.exitCode} maps it to the exit code the LSP
|
|
@@ -310,6 +305,5 @@ export declare class LspStdio {
|
|
|
310
305
|
*/
|
|
311
306
|
static teardown(host: LspExitHost): Runtime.Teardown;
|
|
312
307
|
}
|
|
313
|
-
//#endregion
|
|
314
308
|
export type { LspExitHost, LspFrameDecoded, LspMessage, LspSessionEnd };
|
|
315
309
|
//# sourceMappingURL=index.d.ts.map
|
package/internal/LaunchFailed.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Runtime } from "effect";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/LaunchFailed.ts
|
|
4
4
|
/**
|
|
5
5
|
* The failure `LspStdio.launch` re-raises after reporting a failed server on
|
|
6
6
|
* stderr itself. `errorReported: false` keeps `runMain` from reporting it a
|
|
@@ -31,5 +31,4 @@ var LaunchFailed = class extends Error {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
//#endregion
|
|
35
34
|
export { LaunchFailed };
|
package/internal/messages.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LspTestFailure } from "../LspTestFailure.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/internal/messages.ts
|
|
4
4
|
/** How much text a failure message echoes. */
|
|
5
5
|
const ECHO = 2e3;
|
|
6
6
|
/**
|
|
@@ -26,5 +26,4 @@ const notJsonRpc = (message) => new LspTestFailure({
|
|
|
26
26
|
message: `the server sent a frame that is not a JSON-RPC 2.0 message: ${truncate(JSON.stringify(message) ?? String(message))}`
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { isLspMessage, notJsonRpc, truncate };
|
package/package.json
CHANGED
package/testing.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Duration, Effect, PlatformError, Schema, Scope } from "effect";
|
|
2
2
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
3
|
-
//#region src/LspMessage.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A JSON-RPC 2.0 message as an LSP frame body carries it: a request (an `id`
|
|
6
5
|
* and a `method`), a notification (a `method`, no `id`) or a response (an
|
|
@@ -33,8 +32,6 @@ interface LspMessage {
|
|
|
33
32
|
readonly data?: unknown;
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/LspTestFailure.d.ts
|
|
38
35
|
declare const LspTestFailure_base: Schema.Class<LspTestFailure, Schema.TaggedStruct<"LspTestFailure", {
|
|
39
36
|
/** Which failure occurred; see the list above. */
|
|
40
37
|
readonly reason: Schema.Literals<readonly ["StreamEnded", "InvalidFrame", "NotJsonRpc", "TimedOut"]>;
|
|
@@ -62,8 +59,6 @@ declare const LspTestFailure_base: Schema.Class<LspTestFailure, Schema.TaggedStr
|
|
|
62
59
|
* @public
|
|
63
60
|
*/
|
|
64
61
|
export declare class LspTestFailure extends LspTestFailure_base {}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/LspProbe.d.ts
|
|
67
62
|
/**
|
|
68
63
|
* Options for {@link LspProbe.initialize}.
|
|
69
64
|
*
|
|
@@ -153,8 +148,6 @@ export declare class LspProbe {
|
|
|
153
148
|
*/
|
|
154
149
|
static readonly initialize: (command: ChildProcess.Command, options?: LspProbeOptions) => Effect.Effect<LspProbeResult, LspTestFailure | PlatformError.PlatformError, ChildProcessSpawner.ChildProcessSpawner>;
|
|
155
150
|
}
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region src/LspProcess.d.ts
|
|
158
151
|
/**
|
|
159
152
|
* Options for {@link LspProcess.stderrUntil}.
|
|
160
153
|
*
|
|
@@ -302,6 +295,5 @@ export declare class LspProcess {
|
|
|
302
295
|
/** Spawn `command` for the life of the current scope. */
|
|
303
296
|
static readonly spawn: (command: ChildProcess.Command) => Effect.Effect<LspProcess, PlatformError.PlatformError, ChildProcessSpawner.ChildProcessSpawner | Scope.Scope>;
|
|
304
297
|
}
|
|
305
|
-
//#endregion
|
|
306
298
|
export type { LspMessage, LspProbeOptions, LspProbeResult, LspProcessStderrUntilOptions };
|
|
307
299
|
//# sourceMappingURL=testing.d.ts.map
|