I packaged the most basic version of coc.nvim in unstable.
You can autoinstall extensions via let g:coc_global_extensions = ['coc-extension1', 'coc-extension2', 'coc-extension3', 'coc-extension4'] though it’s not nix-declarative.
I haven’t tried the coc-python extension much as it seems to be WIP, require .Net code etc.
Instead I’ve kept my pyls config
I’ve updated the coc.nvim wiki this week with a full example Language servers · neoclide/coc.nvim Wiki · GitHub .
Btw thanks for pushing me to install coc.nvim, it’s really awesome especially with neovim 0.4-dev and the floating windows).
Hey, just wanted to share a small caveat I noticed when configuring jedi for coc-python.
vim-ghost’s python is Neovim’s python executable - python3_host_prog. But, coc-python’s python executable is the first python which is found in $PATH. Therefor, you need to use direenv or a similar workaround to use coc-python.
I use the following as a base .envrc for my Python projects:
use nix -p python37Packages.{jedi,pylint}
To be further accurate, I feel I need to note that @wizzup’s example which adds jedi to the extraPythonPackages doesn’t help coc-python at all, according to my tests.
I use the following in my ~/.config/nixpkgs/config.nix:
Black should be fine, but jedi will probably not see the packages that you install only in the environment of the project, since it’s a different Python environment.
Haven’t tried, though.
And repetition can be factored out in a derivation that you call in all environments - but I still haven’t done it ^^
you’re right… I should think about my setups as any other code, that’s what nix is for after all. If I want to DRY, there are other ways to DRY than singletons/globals.
coc-pyls is deprecated, isn’t it ? so far I don’t think anyone can or is using the microsoft server declaratively.
I’ve kinda managed to package mpls/make it accessible:
but I haven’t found a way to tell coc-python to use it.
I’ve had some code to build coc from source too but didn’t have the time to test it and the current coc installer is quite straightforward.
the python mpls server has been merged so it possible to install and use coc just for configuration. I personally switched to the builtin lsp since the lua ecosystem is more approachable for me than node (on nixpkgs).
Do you mean the builtin lsp of neovim or something else? I thought that was only available for neovim version 5.0? Did you build this version yourself? Was it a lot of work to build it successfully?
I would like to test out the embedded lsp server, as I find coc.vim a bit bloated and wasn’t able to make it work for all the things I need.
Thanks for this code snippet regarding neovim nightly. Since I didn’t know much about overlays in nix I had to put it on hold, but now I finally was able to make it work. What I essentially did was to put this as my overlay.nix: