tliron / glsp

Language Server Protocol SDK for Go
Apache License 2.0
165 stars 22 forks source link

Notification/Requests from Server => Client #33

Closed tris203 closed 3 months ago

tris203 commented 3 months ago

Firstly, thanks for this library. It makes implementing a LSP in Go a pleasure and the API is delightful!

Forgive me if I'm wrong, but I think the current implementation is purely re-active. Eg, responding to client requests on the server.

If I look at for example window/ShowMessage or $/progress these are notifications sent to the client from the server. However they seem to be implemented in the same way as textDocument/didOpen for example. Which is a request sent from the client.

From this, I believe it is currently impossible to send arbitrary messages from the server to a client, and only to respond to Requests/Act on notifications from the client.

I would be happy to work towards fixing this if this is something you agree with.

Thanks

tris203 commented 3 months ago

I see now I am mistaken

I can use the Call and Notify methods on the context

Thanks!