8.2.1 • Published 10 months ago
@opensumi/vscode-jsonrpc v8.2.1
Changelogs
- Optimized compatibility of the code for a browser environment by adding
globalbefore thesetImmediateandclearImmediatemethods (8.0.0-next.9). - Skip exceptions caused by non-standard Header content.
- Deprecate
WebSocketMessageWriterandWebSocketMessageReaderexported frombrowser/main, to be maintained by opensumi. - Because of reliance on
TextEncoderandTextDecoder, browser-related interfaces are no longer exported insrc/index. - Fix the issue of the stream possibly being destroyed when writing
Fork from vscode-jsonrpc@6.1.0.
VSCode JSON RPC
This npm module implements the base messaging protocol spoken between a VSCode language server and a VSCode language client.
The npm module can also be used standalone to establish a JSON-RPC channel between a client and a server. Below an example how to setup a JSON-RPC connection. First the client side.
import * as cp from 'child_process';
import * as rpc from 'vscode-jsonrpc';
let childProcess = cp.spawn(...);
// Use stdin and stdout for communication:
let connection = rpc.createMessageConnection(
new rpc.StreamMessageReader(childProcess.stdout),
new rpc.StreamMessageWriter(childProcess.stdin));
let notification = new rpc.NotificationType<string, void>('testNotification');
connection.listen();
connection.sendNotification(notification, 'Hello World');The server side looks very symmetrical:
import * as rpc from 'vscode-jsonrpc';
let connection = rpc.createMessageConnection(
new rpc.StreamMessageReader(process.stdin),
new rpc.StreamMessageWriter(process.stdout));
let notification = new rpc.NotificationType<string, void>('testNotification');
connection.onNotification(notification, (param: string) => {
console.log(param); // This prints Hello World
});
connection.listen();History
4.0.0
- move JS target to ES6.
3.0.0:
- converted the NPM module to use TypeScript 2.0.3.
- added strict null support.
- support for passing more than one parameter to a request or notification.
- Breaking changes:
- due to the use of TypeScript 2.0.3 and differences in d.ts generation users of the new version need to move to TypeScript 2.0.3 as well.
License
8.2.1
10 months ago
8.0.0-next.9
3 years ago
8.0.0-next.7
3 years ago
8.0.0-beta.7
3 years ago
8.0.0-next.6
3 years ago
8.0.0-next.5
3 years ago
8.0.0-next.4
3 years ago
8.0.0-next.3
4 years ago
8.0.0-next.2
4 years ago
8.0.0-next.1
4 years ago
6.1.1-beta.4
4 years ago
6.1.1-beta.5
4 years ago
6.1.1-beta.3
4 years ago