From 6fe1fd542191f08e7890ca1414f6b22cfb404664 Mon Sep 17 00:00:00 2001 From: "Matthieu C." <886074+teto@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:11:28 +0200 Subject: [PATCH] neovim.tests: test lua transitive deps are available As reported in several issues, lua plugin dependencies are not visible from neovim. This adds a test to make sure nvim can see jsregexp when luasnip is part of the wrapper see https://github.com/NixOS/nixpkgs/issues/306367 or https://github.com/NixOS/nixpkgs/issues/318925 for details --- .../editors/neovim/tests/default.nix | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkgs/applications/editors/neovim/tests/default.nix b/pkgs/applications/editors/neovim/tests/default.nix index b07f517ea474..c2e6b565de28 100644 --- a/pkgs/applications/editors/neovim/tests/default.nix +++ b/pkgs/applications/editors/neovim/tests/default.nix @@ -43,6 +43,14 @@ let ''; }; + nvim-with-luasnip = wrapNeovim2 "-with-lua-packages" (makeNeovimConfig { + plugins = [ { + plugin = vimPlugins.luasnip; + + } + ]; + }); + nvimAutoDisableWrap = makeNeovimConfig { }; wrapNeovim2 = suffix: config: @@ -281,4 +289,16 @@ rec { export HOME=$TMPDIR ${nvim_with_opt_plugin}/bin/nvim -i NONE +quit! -e ''; + + inherit nvim-with-luasnip; + + # check that bringing in one plugin with lua deps makes those deps visible from wrapper + # for instance luasnip has a dependency on jsregexp + can_require_transitive_deps = + runTest nvim-with-luasnip '' + export HOME=$TMPDIR + cat ${nvim-with-luasnip}/bin/nvim + ${nvim-with-luasnip}/bin/nvim -i NONE --cmd "lua require'jsregexp'" -e + ''; + })