SuperCollider VSCode / Language Server Protocol support

Neovim attempt

(should this be a seperate thread?)

I did a quick attempt at setting this up in neovim today but I didn’t quite succeed. Sharing my notes here in case someone else would like to pick up from here and make a more serious attempt at it.

Firstly, I installed the network refactor branch of SuperCollider as described by Scott along with the quark.

I forked (locally) neovim-lsp-config and added a server config called supercollider.lua in nvim-lspconfig/lua/lspconfig/server_configurations at master · neovim/nvim-lspconfig · GitHub looking like this:

local util = require 'lspconfig.util'

local bin_name = 'sclang'
local cmd = { bin_name, '-i vscode' }

-- local lspreadport = 58110
-- local lspwriteport = 58111

return {
  default_config = {
    cmd = cmd,
    filetypes = { 'supercollider' },
    root_dir = util.find_git_ancestor,
    single_file_support = true,
    settings = {
	-- TODO
      supercollider = { },
    },
    -- capabilities = util.default_config.capabilities or vim.lsp.protocol.make_client_capabilities(),
  },
  commands = {},
  docs = {
    description = [[
https://github.com/scztt/vscode-supercollider

`vscode-supercollider` is a lsp server for SuperCollider
]],
  },
}

And then added this to my setup function for nvim-lspconfig:

-- SuperCollider
require'lspconfig'.supercollider.setup{}

When opening a supercollider file, it detects the server but does not attach it. Not sure why. Here’s the output of :LspInfo

 Language client log: /home/mads/.cache/nvim/lsp.log
 Detected filetype:   supercollider
 
 0 client(s) attached to this buffer: 
 
 Other clients that match the filetype: supercollider
 
 Config: supercollider
 	filetypes:         supercollider
 	root directory:    /home/mads/.local/share/SuperCollider/downloaded-quarks/mk-synthlib
 	cmd:               sclang -i vscode
 	cmd is executable: true
 	autostart:         true
 	custom handlers:   
 
 Configured servers list: clangd, supercollider, psalm, cssls, bashls, cmake, vimls, html, rust_analyzer, pyright, sumneko_lua
1 Like