diff --git a/pkgs/applications/editors/vim/plugins/hooks/neovim-require-check-hook.sh b/pkgs/applications/editors/vim/plugins/hooks/neovim-require-check-hook.sh index fcbec2d6afb4..56f92e6e1eb9 100644 --- a/pkgs/applications/editors/vim/plugins/hooks/neovim-require-check-hook.sh +++ b/pkgs/applications/editors/vim/plugins/hooks/neovim-require-check-hook.sh @@ -60,6 +60,15 @@ run_require_checks() { echo "WARNING: nvimSkipModule got renamed to nvimSkipModules, please update package $name" fi + # Some modules rely on things like globals or user commands being initialised by plugin/ scripts. + # So this hook sets up a dummy packpath containing only the plugin to be tested + # and adds it with packadd before requiring each module. + nvimDataDir=$(nvim -u NONE -i NONE --headless --cmd "lua io.write(vim.fn.stdpath('data'))" +q) + packPathDir="$nvimDataDir/site" + packdir="$nvimDataDir/site/pack/nvimRequireCheckHook/opt" + mkdir -p "$packdir" + ln -s "$out" "$packdir/testPlugin" + for name in "${nvimRequireCheck[@]}"; do local skip=false for module in "${nvimSkipModules[@]}"; do @@ -76,6 +85,8 @@ run_require_checks() { --cmd "set rtp+=$out,${deps// /,}" \ --cmd "set rtp+=$out,${nativeCheckInputs// /,}" \ --cmd "set rtp+=$out,${checkInputs// /,}" \ + --cmd "set packpath^=$packPathDir" \ + --cmd "packadd testPlugin" \ --cmd "lua require('$name')"; then check_passed=true successful_modules+=("$name") diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index d2c94557c544..e2d9bfdb2009 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -33,6 +33,7 @@ libgit2, llvmPackages, neovim-unwrapped, + nix, nodejs, openscad, openssh, @@ -664,6 +665,14 @@ assertNoAdditions { checkInputs = [ self.nvim-cmp ]; }; + cmp-buffer = super.cmp-buffer.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + + cmp-calc = super.cmp-calc.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + cmp-clippy = super.cmp-clippy.overrideAttrs { checkInputs = [ self.nvim-cmp ]; dependencies = with self; [ @@ -675,6 +684,10 @@ assertNoAdditions { checkInputs = [ self.nvim-cmp ]; }; + cmp-cmdline-history = super.cmp-cmdline-history.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + cmp-conjure = super.cmp-conjure.overrideAttrs { checkInputs = [ self.nvim-cmp ]; dependencies = [ self.conjure ]; @@ -713,6 +726,10 @@ assertNoAdditions { checkInputs = [ self.nvim-cmp ]; }; + cmp-emoji = super.cmp-emoji.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + cmp-fish = super.cmp-fish.overrideAttrs { checkInputs = [ self.nvim-cmp ]; }; @@ -736,6 +753,10 @@ assertNoAdditions { checkInputs = [ self.nvim-cmp ]; }; + cmp-latex-symbols = super.cmp-look.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + cmp-look = super.cmp-look.overrideAttrs { checkInputs = [ self.nvim-cmp ]; }; @@ -746,6 +767,7 @@ assertNoAdditions { }; cmp-nixpkgs-maintainers = super.cmp-nixpkgs-maintainers.overrideAttrs { + nativeCheckInputs = [ nix ]; checkInputs = [ self.nvim-cmp ]; }; @@ -754,6 +776,10 @@ assertNoAdditions { dependencies = [ self.plenary-nvim ]; }; + cmp-nvim-lsp-document-symbol = super.cmp-nvim-lsp-document-symbol.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + cmp-nvim-lsp-signature-help = super.cmp-nvim-lsp-signature-help.overrideAttrs { checkInputs = [ self.nvim-cmp ]; }; @@ -770,6 +796,10 @@ assertNoAdditions { checkInputs = [ self.nvim-cmp ]; }; + cmp-omni = super.cmp-omni.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + cmp-pandoc-nvim = super.cmp-pandoc-nvim.overrideAttrs { checkInputs = [ self.nvim-cmp ]; dependencies = [ self.plenary-nvim ]; @@ -792,6 +822,10 @@ assertNoAdditions { dependencies = [ self.nvim-snippy ]; }; + cmp-spell = super.cmp-spell.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + cmp-tabby = super.cmp-tabby.overrideAttrs { checkInputs = [ self.nvim-cmp ]; }; @@ -811,6 +845,10 @@ assertNoAdditions { dependencies = [ tmux ]; }; + cmp-treesitter = super.cmp-treesitter.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + cmp-vim-lsp = super.cmp-vim-lsp.overrideAttrs { checkInputs = [ self.nvim-cmp ]; dependencies = [ self.vim-lsp ]; @@ -839,6 +877,10 @@ assertNoAdditions { dependencies = [ self.luasnip ]; }; + cmp_yanky = super.cmp_yanky.overrideAttrs { + checkInputs = [ self.nvim-cmp ]; + }; + cobalt2-nvim = super.cobalt2-nvim.overrideAttrs { dependencies = with self; [ colorbuddy-nvim ]; # Few broken themes