Skip to content

Commit

Permalink
Update to vscode-jsonrpc 8.0.2 to be compliant with client
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-fleck-at committed Dec 19, 2022
1 parent e4d1fb1 commit 2d1669b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [1.1.0 - Upcoming]()

### Changes

- [protocol] Update to vscode-jsonrpc 8.0.2 to be compliant with client [#136](https://github.com/eclipse-glsp/glsp-theia-integration/pull/136)

### Breaking Changes

- [theia] Updated Theia dependencies to `1.27.0`. Due to API breaks, Theia versions `<1.27.0` are no longer supported. [#119](https://github.com/eclipse-glsp/glsp-theia-integration/pull/119) - Contributed on behalf of STMicroelectronics <br>
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Pod
spec:
containers:
- name: node
image: eclipseglsp/ci:alpine-v3.1
image: eclipseglsp/ci:alpine
tty: true
resources:
limits:
Expand Down Expand Up @@ -32,7 +32,7 @@ spec:
pipeline {
agent {
kubernetes {
label 'glsp-agent-pod'
label 'glsp-theia-agent-pod'
yaml kubernetes_config
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "1.0.0",
"engines": {
"yarn": ">=1.7.0 <2",
"node": ">=14.18.0"
"node": ">=16.11.0"
},
"scripts": {
"all": "yarn install && yarn lint",
Expand Down
1 change: 1 addition & 0 deletions packages/theia-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@eclipse-glsp/client": "next",
"@theia/core": "^1.27.0",
"@theia/messages": "^1.27.0",
"vscode-jsonrpc": "8.0.2",
"sprotty-theia": "0.12.0"
},
"scripts": {
Expand Down
18 changes: 11 additions & 7 deletions packages/theia-integration/src/browser/channel-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Channel, Disposable, DisposableCollection, Emitter, MessageProvider } from '@theia/core';
import { createMessageConnection, Logger, Message, MessageConnection } from 'vscode-jsonrpc';
import { AbstractMessageReader, DataCallback, MessageReader } from 'vscode-jsonrpc/lib/messageReader';

import { AbstractMessageWriter, MessageWriter } from 'vscode-jsonrpc/lib/messageWriter';
import {
AbstractMessageReader, AbstractMessageWriter, createMessageConnection, DataCallback, Logger, Message,
MessageConnection, MessageReader, MessageWriter
} from 'vscode-jsonrpc';

// Temporary fix/workaround to enable comparability with Theia >=1.27 until https://github.com/eclipse-theia/theia/issues/11405 is resolved

Expand Down Expand Up @@ -46,8 +46,8 @@ export class ChannelMessageReader extends AbstractMessageReader implements Messa
this.toDispose.dispose();
}

listen(callback: DataCallback): void {
this.onMessageEmitter.event(callback);
listen(callback: DataCallback): Disposable {
return this.onMessageEmitter.event(callback);
}
}

Expand All @@ -62,12 +62,16 @@ export class ChannelMessageWriter extends AbstractMessageWriter implements Messa
this.toDispose = channel.onClose(() => this.fireClose());
}

write(msg: Message): void {
async write(msg: Message): Promise<void> {
const writeBuffer = this.channel.getWriteBuffer();
writeBuffer.writeBytes(Buffer.from(JSON.stringify(msg, undefined, 0)));
writeBuffer.commit();
}

end(): void {
this.dispose();
}

override dispose(): void {
super.dispose();
this.toDispose.dispose();
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10812,6 +10812,11 @@ [email protected]:
core-util-is "1.0.2"
extsprintf "^1.2.0"

[email protected]:
version "8.0.2"
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz#f239ed2cd6004021b6550af9fd9d3e47eee3cac9"
integrity sha512-RY7HwI/ydoC1Wwg4gJ3y6LpU9FJRZAUnTYMXthqhFXXu77ErDd/xkREpGuk4MyYkk4a+XDWAMqe0S3KkelYQEQ==

vscode-jsonrpc@^5.0.0, vscode-jsonrpc@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz#9bab9c330d89f43fc8c1e8702b5c36e058a01794"
Expand Down

0 comments on commit 2d1669b

Please sign in to comment.