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: Refactor coc-* plugins and fix coc-go #96993

Merged
merged 4 commits into from Sep 4, 2020

Conversation

jbaum98
Copy link
Contributor

@jbaum98 jbaum98 commented Sep 3, 2020

Motivation for this change

I had an issue getting coc-go to work.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Result of nixpkgs-review 1

25 packages built:
- vimPlugins.Tagbar (vimPlugins.tagbar)
- vimPlugins.clang_complete
- vimPlugins.coc-explorer
- vimPlugins.coc-go
- vimPlugins.coc-markdownlint
- vimPlugins.completion-nvim
- vimPlugins.csv (vimPlugins.csv-vim)
- vimPlugins.denite (vimPlugins.denite-nvim)
- vimPlugins.deol-nvim
- vimPlugins.nvim-lspconfig
- vimPlugins.nvim-treesitter
- vimPlugins.polyglot (vimPlugins.vim-polyglot)
- vimPlugins.vim-clap
- vimPlugins.vim-dirvish
- vimPlugins.vim-floaterm
- vimPlugins.vim-flutter
- vimPlugins.vim-html-template-literals
- vimPlugins.vim-lsp
- vimPlugins.vim-monokai
- vimPlugins.vim-sneak
- vimPlugins.vim-test
- vimPlugins.vim-vsnip
- vimPlugins.vimspector
- vimPlugins.vimtex
- vimPlugins.zenburn

Jake Waksbaum added 3 commits September 2, 2020 23:43
There are 32 vim plugins, all related to the coc.nvim LSP plugin, that
are actually node packages and are included in nodePackages. In NixOS#82578,
those vim plugins were made to point at the corresponding node packages,
which fixed issues where the sources weren't being compiled properly
with Javascript build systems.

The way each of those vim plugins wraps its corresponding node package
is identical, so I factored that out into a function and eliminated the
duplication.

In addition, for some reason coc-go got missed, which led to it not
working correctly for me. I included it in my list of packages to wrap,
so that fixes that issue.
Because these plugins use the node packages as their source, there's no
reason to pull their sources from GitHub only to have it be overriden.

This will trigger the removal of these plugins from generated.nix the
next time update.py is run.
@jbaum98
Copy link
Contributor Author

jbaum98 commented Sep 3, 2020

I realized this accomplishes the same thing as #82723, but also does the refactor and removes them from vim-plugin-names.

@jbaum98
Copy link
Contributor Author

jbaum98 commented Sep 3, 2020

I also think this would resolve #64560, or rather, that it has already been resolved except for the issue of coc-go.

@jonringer
Copy link
Contributor

do you mind adding some documentation to the vimplugin docs which mention the exception around coc node modules?

@jbaum98
Copy link
Contributor Author

jbaum98 commented Sep 3, 2020

Yup I can do that.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff LGTM
gets rid of a bunch of boilerplate

https://github.com/NixOS/nixpkgs/pull/96993
25 packages built:
vimPlugins.clang_complete vimPlugins.coc-explorer vimPlugins.coc-go vimPlugins.coc-markdownlint vimPlugins.completion-nvim vimPlugins.csv-vim vimPlugins.denite-nvim vimPlugins.deol-nvim vimPlugins.nvim-lspconfig vimPlugins.nvim-treesitter vimPlugins.tagbar vimPlugins.vim-clap vimPlugins.vim-dirvish vimPlugins.vim-floaterm vimPlugins.vim-flutter vimPlugins.vim-html-template-literals vimPlugins.vim-lsp vimPlugins.vim-monokai vimPlugins.vim-polyglot vimPlugins.vim-sneak vimPlugins.vim-test vimPlugins.vim-vsnip vimPlugins.vimspector vimPlugins.vimtex vimPlugins.zenburn

still would like to hear from @timokau @evanjs

Copy link
Member

@timokau timokau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me, though I'm not very familiar with how coc was handled in the past and I have never used it.

];
nodePackage2VimPackage = name: buildVimPluginFrom2Nix {
pname = name;
inherit (nodePackages.${name}) version;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to inherit meta (description and license) as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh that's a very good idea.

@gvolpe
Copy link
Member

gvolpe commented Sep 4, 2020

@jbaum98 Right now CoC plugins can be accessed via pkgs.vimPlugins.coc-*. Would it remain the same after these changes or how would it be?

@jbaum98
Copy link
Contributor Author

jbaum98 commented Sep 4, 2020

Yes, they'll still be available in vimPlugins. What this does is removes the non-compiled versions, since they were overriden anyway, and changes the way they are added to vimPlugins in overrides.nix to reduce duplication.

@jonringer
Copy link
Contributor

@gvolpe Yea, I re-did my home-manager off this PR and it seems that the plugin names have stayed "the same"

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Result of nixpkgs-review pr 96993 1

25 packages built:
  • vimPlugins.clang_complete
  • vimPlugins.coc-explorer
  • vimPlugins.coc-go
  • vimPlugins.coc-markdownlint
  • vimPlugins.completion-nvim
  • vimPlugins.csv-vim
  • vimPlugins.denite-nvim
  • vimPlugins.deol-nvim
  • vimPlugins.nvim-lspconfig
  • vimPlugins.nvim-treesitter
  • vimPlugins.tagbar
  • vimPlugins.vim-clap
  • vimPlugins.vim-dirvish
  • vimPlugins.vim-floaterm
  • vimPlugins.vim-flutter
  • vimPlugins.vim-html-template-literals
  • vimPlugins.vim-lsp
  • vimPlugins.vim-monokai
  • vimPlugins.vim-polyglot
  • vimPlugins.vim-sneak
  • vimPlugins.vim-test
  • vimPlugins.vim-vsnip
  • vimPlugins.vimspector
  • vimPlugins.vimtex
  • vimPlugins.zenburn

@jonringer jonringer merged commit 58e585c into NixOS:master Sep 4, 2020
@jbaum98
Copy link
Contributor Author

jbaum98 commented Sep 4, 2020

Wait! I wanted to inherit meta like timokau suggested.

@jonringer
Copy link
Contributor

that shouldn't cause any rebuilds, :) just open a PR! xD

@jonringer
Copy link
Contributor

sorry, I'm trying to do a "last call" of merges before branchoff

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

4 participants