Skip to content

Implement dispose method on WebSocketMessageReader. #602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ethan-vanderheijden
Copy link
Contributor

Implementing dispose() according to the spec:
https://github.com/microsoft/vscode-languageserver-node/blob/21f4f0af6bf1623483c3e65f36e550bfdb6245a6/jsonrpc/src/common/messageReader.ts#L48

Although the listen() method returns a disposable callback, it seems like it's not used. Instead, the dispose() method is called on the reader (see here).

Without implementing the dispose method, you can stop the language client, but calling languageClient.start() will not restart it properly.

Copy link
Collaborator

@kaisalmen kaisalmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Thank you.

@kaisalmen kaisalmen merged commit d14e40c into TypeFox:main Feb 14, 2024
@ethan-vanderheijden
Copy link
Contributor Author

Sorry, can you do a new release of vscode-ws-jsonrpc?

@kaisalmen
Copy link
Collaborator

@ethan-vanderheijden yes, good point. I wanted to put out the next release when everything else is ready, but #600 is not yet done. A new version should be there end of the day.

@kaisalmen
Copy link
Collaborator

@ethan-vanderheijden https://www.npmjs.com/package/vscode-ws-jsonrpc/v/3.2.0 is now available.

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

Successfully merging this pull request may close these issues.

2 participants