neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.33k stars 956 forks source link

Adding nixd as a nix language server as rnix-lsp seems no longer actively maintained since Nov. 2022 #4688

Closed AkechiShiro closed 1 year ago

AkechiShiro commented 1 year ago

Is your feature request related to a problem? Please describe. It seems the only language server as an extension for the Nix language is not maintained anymore or doesn't look like it's actively maintained.

Describe the solution you'd like I'd like a new coc extension named coc-nixd that relies on nixd.

Describe alternatives you've considered Using only rnix-lsp as a language server for nix support despite it not having active commits/maintenance.

Additional context Latest commit in rnix-lsp (27 November 2022) Latest commit in nixd (26 June 2023)

If there is anything I could help with to help making this happen, I'll be happy to give it a try, I'll first go read the contributions guidelines.

fannheyward commented 1 year ago

Try this in your coc-settings.json (not tested)

"languageserver": {
  "nixd": {
    "command": "nixd",
    "rootPatterns": [".nixd.json"],
    "filetypes": ["nix"]
  }
}
AkechiShiro commented 1 year ago

That didn't seem to work alright actually, there is a config mentioned in the readme of rnix-lsp : https://github.com/nix-community/rnix-lsp#cocnvim

{
  "languageserver": {
    "nix": {
      "command": "rnix-lsp",
      "filetypes": [
        "nix"
      ]
    }
  }
}

I believe this should be documented, let me know if I can open up a PR with this documentation or maybe just adding a link towards this README section. I'm not sure where this would go since this isn't a coc-extension but more a language-server config.

AkechiShiro commented 1 year ago

There is also a nixd configuration which is another nix LSP, actively maintained : https://github.com/nix-community/nixd/blob/main/docs/editor-setup.md#cocnvim

AkechiShiro commented 1 year ago

I'm still trying to make it work maybe I have an issue, do the file .nixd.json need to exist for the LSP to start showing errors ?