Ability to send LSP messages to Nova

When using a LanguageClient, we have the ability to send requests from an extension to the LSP server with sendRequest and sendNotification.

I want to be able to also send fake “responses” from the extension to Nova as an LSP client. I’ve run into a few use cases where I’d like this:

  • Be able to request a list of specific or non-standard code actions in my extension, then send the response to Nova for processing (hey Nova, run this code action for me).
  • Be able to send an edit response to Nova for handling, instead of manually using TextEditor.edit (hey Nova, apply this edit for me).

This is a little tricky from the LSP’s perspective, since the fundamental lifecycle is for the Client to send a request, and then process the response. The protocol doesn’t provide a well defined way to do what I’m asking.

There are definitely other ways I’ve found to handle my use cases, but I thought I’d bring it up.

For code actions, it’s more likely we will expose an AssistantRegistry endpoint for code actions outside of the LanguageClient implementation so that extensions could provide their own code actions.

1 Like