Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kuuote/deno-lsp_stream
Deno module that TransformStream for handling LSP Base Protocol
https://github.com/kuuote/deno-lsp_stream
deno language-server-protocol
Last synced: 23 days ago
JSON representation
Deno module that TransformStream for handling LSP Base Protocol
- Host: GitHub
- URL: https://github.com/kuuote/deno-lsp_stream
- Owner: kuuote
- License: other
- Created: 2024-01-13T12:32:10.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-11T15:45:50.000Z (9 months ago)
- Last Synced: 2024-12-05T08:14:15.420Z (29 days ago)
- Topics: deno, language-server-protocol
- Language: TypeScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lsp_stream
It provides Decoder/Encoder of
[Base Protocol of Language Server Protocol](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#baseProtocol)```typescript
import { LspEncoderStream } from "./lsp_stream.ts";
import { JsonStringifyStream } from "jsr:/@std/[email protected]";const stream = new JsonStringifyStream();
const writer = stream.writable.getWriter();
stream.readable
.pipeThrough(new LspEncoderStream())
.pipeTo(Deno.stdout.writable);
await writer.write({ foo: "bar" });
await writer.write({ baz: 100 });
``````typescript
import { LspDecoderStream } from "./lsp_stream.ts";const stream = Deno.stdin.readable
.pipeThrough(new LspDecoderStream());
const reader = stream.getReader();
const result = await reader.read();
if (!result.done) {
const msg = JSON.parse(result.value);
}
```# License
NYSL