Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vimPlugins.coc: init at 19.02.2019 #56091

Closed
wants to merge 1 commit into from
Closed

vimPlugins.coc: init at 19.02.2019 #56091

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 20, 2019

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@tobim
Copy link
Contributor

tobim commented Feb 20, 2019

This package will need a few extra steps in order to function: https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim. There are several examples how to achieve that in overrides.nix.

@ghost
Copy link
Author

ghost commented Feb 20, 2019

@tobim Is it possible to specify the dependency of watchman as an option? It would allow people to override it when installing the vim package (but I have experience with options / configurations). Should that even be done? I can make the package batteries included.

@tobim
Copy link
Contributor

tobim commented Feb 20, 2019

I'm inclined to say "batteries included" is the way to go for this kind of plugin.

@ghost
Copy link
Author

ghost commented Feb 20, 2019

@tobim the build requires the pulling of some NPM packages, which it cannot do, because it's sandboxed (I'm on NixOS). I generated the npm dependencies for the project with node2nix but I'm not sure how to include them to the override.nix. Any idea?

@tobim
Copy link
Contributor

tobim commented Feb 20, 2019

Not my area of expertise, but a git grep through nixpkgs found /pkgs/misc/base16-builder which you might be able to copy from.

@ghost
Copy link
Author

ghost commented Feb 21, 2019

@tobim Thanks, that was useful, I've updated the override and the build. Now the packages are local and I've also included watchman to the mix. I don't know how to test the changes from the nixpkgs fork though, can you give it a shot?

@tobim
Copy link
Contributor

tobim commented Feb 21, 2019

I tried an ran into a few problems. I added the generated derivation to the buildInputs and changed the call to node2nix a bit:

node2nix -8 package.json --composition node.nix --node-env ./../../../../development/node-packages/node-env.nix

Building that fails however, because it tries to access a file that is in the source of coc:

npm ERR! path /nix/store/yq146kwp1kdpm6nq6g73adnf20frmmfj-node-coc.nvim-0.0.55/lib/node_modules/coc.nvim/bin/server.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/nix/store/yq146kwp1kdpm6nq6g73adnf20frmmfj-node-coc.nvim-0.0.55/lib/node_modules/coc.nvim/bin/server.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

I think the approach needs to be changed to something similar to what LanguageClient-neovim does on overrides.nix: Do the entire definition of the plugin in overrides.nix. Look at tools/networking/airfield/default.nix for more inspiration.

@ghost
Copy link
Author

ghost commented Feb 25, 2019

@tobim I tried to get yarn to find the offline modules, but that fails. The airfield package is 4 years old and I'm not sure if what's there is still relevant. I don't know if the approach to wrapping a single binary works here. Do you want to take this over?

@teto
Copy link
Member

teto commented Feb 28, 2019

would be neat to have to test the neovim floating window system (as advertised on coc homepage):
https://user-images.githubusercontent.com/251450/52922829-23614e00-335f-11e9-8d33-3dae30ea4a9a.gif

@tobim
Copy link
Contributor

tobim commented Mar 15, 2019

Sorry for the silence from my side. I don't really have the time to do this right now, at least not in the next couple of weeks.

@teto
Copy link
Member

teto commented May 21, 2019

I thought it would be a nightmare to install but in fact reasonably little is required to get started (non declarative way). I've pushed the most basic plugin possible at #61796

@teto teto mentioned this pull request May 22, 2019
10 tasks
@teto
Copy link
Member

teto commented May 26, 2019

It's not as good as nix integration but seems like setting let g:coc_global_extensions = ['coc-extension1', 'coc-extension2', 'coc-extension3', 'coc-extension4'] in the vimrc file will let coc.nvim autoinstall the extensions.

@nixos-discourse
Copy link

This pull request has been mentioned on Nix community. There might be relevant details there:

https://discourse.nixos.org/t/coc-nvim-nvim-stuff/2974/7

@ghost
Copy link
Author

ghost commented Aug 2, 2019

I'm back working on this, if anyone has any ideas how to integrate it, please share.

@ghost
Copy link
Author

ghost commented Aug 12, 2019

I'll close this for now and re-openen it when it's ready.

@ghost ghost closed this Aug 12, 2019
@teto
Copy link
Member

teto commented Sep 7, 2019

@ivegotasthma do you have by any chance coc-python working ? you seem to be one with the best coc understanding out there :)

@ghost
Copy link
Author

ghost commented Sep 10, 2019

@teto I don't :/ I'm a newb when it comes to nix expressions and this task seems too complex for my skill set. Anyone is welcome to take it over.

@wizzup
Copy link
Contributor

wizzup commented Oct 15, 2019

Sorry, I am a little bit confused, please help me clarify some question.

Do this have any relation with (supposedly working for anyone but me) vimPlugins.coc-nvim?
Which have been merged

But I can't make it to work correctly in nix-shell (details here and here)

Also there are couples of coc related vim plugins in vim-plugin-names

If I use one of those, do I still need to use coc-vim/coc-nvim?

@rvolosatovs
Copy link
Member

coc-nvim works fine for me. I configure it as part of my neovim package https://github.com/rvolosatovs/infrastructure/blob/8b68427ff259299b94838aa89a2d1036f6d1e099/nixpkgs/neovim/config.nix#L81-L113

Regarding plugins it seems that some of them work and some don't(https://github.com/rvolosatovs/infrastructure/blob/8b68427ff259299b94838aa89a2d1036f6d1e099/nixpkgs/neovim/default.nix#L10-L15), but I honestly don't use them, as coc does everything I need it already. In case the plugins don't work for you when added declaratively I suppose you could just manage them impurely.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants