-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Based on some preliminary investigation, NeoVim can only connect to LSP servers via a stdin/stdout based communication mechanism. This currently will not work with sclang, as there are many places where sclang forcibly writes to stdout, which would disrupt LSP communication. Instead, for the vscode plugin, we use simple UDP pipes since they are already well-supported by sclang and easy to implement in VSCode. Until the sclang stdout issues can be solved, the UDP mechanism will be used.
IF it is indeed not possible to convince NeoVim to connect to an LSP server via UDP, then the solution to this would be as follows. (Note that this is not throwaway work, as an architecture where the LSP "wrapper" and an sclang instance are separated is probably desirable in the long run anyway.)
There is a preliminary implementation that may be a good starting point here:
https://github.com/davidgranstrom/sclang-lsp-stdio
- Create a simple Python (or Lua, or nodejs) command line tool that can launch sclang. Command line tool should set correct environment variables (https://github.com/scztt/vscode-supercollider/blob/develop/src/context.ts#L49), and launch sclang with the correct arguments (https://github.com/scztt/vscode-supercollider/blob/develop/src/context.ts#L66).
- Connect to sclang's stdin/stdout pipes so that they can be rerouted or logged rather than e.g. forwarded to out command line scripts stdout.
- Connect command line script to sclang via UDP sockets (see https://github.com/scztt/vscode-supercollider/blob/develop/src/context.ts#L117). Connection should be made only after
***LSP READY***is posted (https://github.com/scztt/vscode-supercollider/blob/develop/src/context.ts#LL132C45-L132C61). UDP sockets should be connected directly to stdin/stdout of the utility script so they can communicate with the LSP client (e.g. NeoVim). - Lifetime and exit code of command line script should mirror that of sclang, e.g. if sclang exits script should also (with the same error code).
Note that there MAY be extra work in NeoVim specifically to enable SuperCollider support. There are forum messages outlining some of this work, and some things may already be implemented. See:
Metadata
Metadata
Assignees
Labels
Projects
Status