microsoft / microsoft/vscode-wasm
Streams should implement vscode-jsonrpc's `_ReadableStream` and `_WritableStream` interfaces
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 456
- Forks
- 40
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 4
Description
After seeing @dbaeumer's talk at WasmCon, I was inspired to compile the Noir LSP to WASI and hook it as the server component via the vscode-wasm harness. The current progress is available at https://github.com/noir-lang/vscode-noir/pull/41
One of the workarounds I needed to do was stubbing the following interfaces:
interface _ReadableStream {
onData(listener: (data: Uint8Array) => void): Disposable;
onClose(listener: () => void): Disposable;
onError(listener: (error: any) => void): Disposable;
onEnd(listener: () => void): Disposable;
}
interface _WritableStream {
onClose(listener: () => void): Disposable;
onError(listener: (error: any) => void): Disposable;
onEnd(listener: () => void): Disposable;
write(data: Uint8Array): Promise<void>;
write(data: string, encoding: _MessageBufferEncoding): Promise<void>;
end(): void;
}
This allows me to use the Readable and Writable provided by this library as streams for ReadableStreamMessageReader and WriteableStreamMessageWriter. If this library implemented those interfaces, these streams could be used directly without any stubs.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the library's Readable and Writable implementations and compare their public behavior with the _ReadableStream and _WritableStream definitions in the issue. Verify that they can be passed directly to vscode-jsonrpc's ReadableStreamMessageReader and WriteableStreamMessageWriter without stubs, including close, error, end, and write behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100