Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Error - this.socket.onMessage is not a function #13

Open
Wathsara opened this issue Sep 25, 2019 · 0 comments
Open

Error - this.socket.onMessage is not a function #13

Wathsara opened this issue Sep 25, 2019 · 0 comments

Comments

@Wathsara
Copy link

var initialize = "null";
const socket:rpc.IWebSocket = new WebSocket('ws://localhost:8080/mypath');
const reader = new rpc.WebSocketMessageReader(socket);
const writer = new rpc.WebSocketMessageWriter(socket);
const logger = new rpc.ConsoleLogger();
const connection = rpc.createMessageConnection(reader, writer, logger);
const notification = new rpc.NotificationType<string, void>('onInitialize');
connection.onNotification(notification, (param: any) => {
	initialize=param; // This prints Hello World
});
connection.listen();

When I tried the above code which is in the readme file it gives an error like before

Request textDocument/completion failed with message: this.socket.onMessage is not a function

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant