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

Missing lua dependency of the LuaSnip nvim plugin #306367

Open
pierrot-lc opened this issue Apr 23, 2024 · 6 comments
Open

Missing lua dependency of the LuaSnip nvim plugin #306367

pierrot-lc opened this issue Apr 23, 2024 · 6 comments

Comments

@pierrot-lc
Copy link

Describe the bug

I installed vimPlugins.luasnip. When running :checkhealth, luasnip says that the dependency jsregexp is not found.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install neovim with the plugin vimPlugins.luasnip
  2. Run :checkhealth command

For example, using home-manager:

{
  programs.neovim = {
    enable = true;
    plugins = [ pkgs.vimPlugins.luasnip ];
  };
}

Expected behavior

When installing the plugin, the lua package of the plugin is used instead (see here). That luasnip package should come with jsregexp as described in its nix expression.

Screenshots

Screenshot from 2024-04-23 21-51-56

Additional context

I noticed that the lua jsregexp package is indeed built by nix, along with the lua luasnip package. So the error may come from the package not being added to the neovim lua runtime path.

The error disappear when adding jsregexp in extraLuaPackages like so:

{
  programs.neovim = {
    enable = true;
    plugins = [ pkgs.vimPlugins.luasnip ];
    extraLuaPackages = ps: [ ps.jsregexp ];
  };
}

I managed to reproduce the error using kickstart-nvim.nix and nixvim as well.

Notify maintainers

@teto @GaetanLepage @mrcjkb

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.8.7, NixOS, 24.05 (Uakari), 24.05.20240419.5c24cf2`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/v4pcs3nzx54m5bmxd39win0rgl2d2hbx-source`

Add a 👍 reaction to issues you find important.

@teto
Copy link
Member

teto commented Apr 23, 2024

Indeed I know about the issue. I have it working locally and I am upstreaming the fixes hopefully before 24.05. I will keep you informed.

@julienTraversier
Copy link

With nixvim the workarround doesn't seems to work.

@GaetanLepage
Copy link
Contributor

Should be fixed by #309762

@GaetanLepage
Copy link
Contributor

The PR has been merged. @pierrot-lc feel free to test :)

@pierrot-lc
Copy link
Author

The PR has been merged. @pierrot-lc feel free to test :)

Sadly it does not seem to be fixed. The warning is still raised. I think the issue is related to the way luasnip is installed by nix. The dependency jsregexp seems to be used here but it is still not found in the lua environment of nvim. I do not fully understand the way lua packages are built, so maybe there's something that I miss somewhere.

@mrcjkb
Copy link
Member

mrcjkb commented May 10, 2024

We might need to wait for @teto's fix to get into master and/or unstable.

teto added a commit to teto/nixpkgs that referenced this issue Jun 12, 2024
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 NixOS#306367 or NixOS#318925
for details
teto added a commit to teto/nixpkgs that referenced this issue Jun 13, 2024
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 NixOS#306367 or NixOS#318925
for details
teto added a commit to teto/nixpkgs that referenced this issue Jun 14, 2024
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 NixOS#306367 or NixOS#318925
for details
teto added a commit to teto/nixpkgs that referenced this issue Jun 19, 2024
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 NixOS#306367 or NixOS#318925
for details
teto added a commit to teto/nixpkgs that referenced this issue Jun 21, 2024
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 NixOS#306367 or NixOS#318925
for details
teto added a commit to teto/nixpkgs that referenced this issue Jun 24, 2024
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 NixOS#306367 or NixOS#318925
for details
teto added a commit to teto/nixpkgs that referenced this issue Jun 26, 2024
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 NixOS#306367 or NixOS#318925
for details
teto added a commit to teto/nixpkgs that referenced this issue Jun 29, 2024
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 NixOS#306367 or NixOS#318925
for details
teto added a commit to teto/nixpkgs that referenced this issue Jul 3, 2024
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 NixOS#306367 or NixOS#318925
for details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants