-
Notifications
You must be signed in to change notification settings - Fork 99
Add support for setting up language servers to use websockets #620
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
base: master
Are you sure you want to change the base?
Conversation
I have tried to make as few breaking changes as possible (I don't think there are any) except that I changed from |
679c8f1
to
e07c7e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me.
|
||
instance Pretty WebsocketLog where | ||
pretty l = case l of | ||
WebsocketPing -> "Ping" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should some of these include extra information beyond the constant string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just thought about it, but nothing interesting comes to mind - I think this should purely exist to get status information of the websocket, the rest should be logged elsewhere
Hello 👋 is there anything I could help with to get this one merged? This is going to be quite useful for a project I'm working on! |
Not really. I just came back from holidays and gotta finish this :) |
It’s usable though, you can pin it to this revision |
I'm testing it here and it doesn't seem to reply to any messages - it does read incoming requests but does not send a reply. |
You probably need defaultOptions Do you already have this? |
Alright, imma look into it tomorrow, thanks for testing. |
e07c7e3
to
3b31176
Compare
you are right, there must be something gone wrong when copy-pasting the working definition over - I'm investigating. |
i found the reason - |
My understanding is that stdio can be chunked but WebSockets are not, this means that we can just trust that whatever the websockets package gives is the full packet. I'm not a Haskeller so I asked Claude to start from scratch basing off of this PR's changes and this was the result. Now I get the responses accordingly. |
That is correct. I just want to figure out the best way to do this. I know how to „make it work“ that is not the problem. If you want to use whatever the LLM spat out, then that is not relevant to my PR :) |
76d3c9f
to
a97a845
Compare
Allow the user to set up an lsp server that talks to the user using the websocket protocol instead of standard IO and do enough refactoring to make the setup with websockets possible Whenever a new message arrives on the websocket, push the new message as well as an empty message as the followup - additionally, do not throw an error when the parser encounters an empty ByteString, it should be able to handle that by itself. Link the lspAsync to cascade a dead server to its sockets
a97a845
to
5b38a61
Compare
Allow the user to set up an lsp server that talks to the user using the websocket protocol instead of standard IO and do enough refactoring to make the setup with websockets possible