Recommended Way to Handle Custom LSP Messages Sent from Client #504
-
I am working on extending LSP to add my own custom messages for a particular domain. One scenario is that, on the client, a user-facing command is invoked; when it is handled on the client, an LSP request is sent to the server, which will require the server to take some action. This could also be done using the LSP's Command feature. The server then sends either a progress notification or another type of notification back to the client in order to satisfy the requirements of LSP. Currently, I have configured my language project to have its own Is there a recommended way to achieve this scenario besides the way that I am doing it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can add handlers to the |
Beta Was this translation helpful? Give feedback.
You can add handlers to the
Connection
even after callingstartLanguageServer
. The only concern with that might be that you could miss custom messages that are received right after starting to listen on the connection. I already thought about adding an optional parameter for custom message handlers to that function.