Skip to content

[BUG] nvim-lspconfig default configuration missing for eslint #3224

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

Closed
IMax153 opened this issue Apr 26, 2025 · 5 comments · Fixed by IMax153/nixvim#1 or #3233
Closed

[BUG] nvim-lspconfig default configuration missing for eslint #3224

IMax153 opened this issue Apr 26, 2025 · 5 comments · Fixed by IMax153/nixvim#1 or #3233
Labels
bug Something isn't working

Comments

@IMax153
Copy link

IMax153 commented Apr 26, 2025

Description

For certain LSPs, the defaults from nvim-lspconfig seem to be missing, resulting in problems attaching the LSP to applicable buffers.

For example, setting plugins.lsp.servers.eslint.enable = true, I get an error in the LspLog related to a missing cmd:

[ERROR][2025-04-26 08:39:54] .../lua/vim/lsp.lua:455	"cannot start eslint due to config error: ...ovim-unwrapped-0.11.0/share/nvim/runtime/lua/vim/lsp.lua:444: cmd: expected expected function or table with executable command, got nil"

More detail on the issue can be found in the comments of #3217.

Additional Information

Output of :checkhealth vim.lsp

lsp-health.txt

Output of nixvim-print-init

init.lua.txt

Note - GitHub seemingly would not allow upload of a Lua file, so I had to append .txt to the filename.

Output of nix-repl

:p packages.aarch64-darwin.default.config.extraPlugins
nix-repl> :p packages.aarch64-darwin.default.config.extraPlugins
[
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/g1l9s0x3qm1i3sk8cwn7i7q7gs42hr50-vimplugin-nvim-lspconfig-2025-04-19.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/npd5bcynlh9c4pdcbzz4jf3ks7ny3ddx-vimplugin-catppuccin-nvim-2025-02-28.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/p71d9gy7mgk8qc96hk8p7sp93zqrjxfz-vimplugin-luajit2.1-nvim-web-devicons-0.100-1-unstable-0.100-1.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/247zzzx975xnzqri3jq3373pb1m2nylr-vimplugin-nvim-ts-autotag-2025-02-18.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/h82hqw1g8p6q4gkqngaj5s9050w0qzya-vimplugin-nvim-treesitter-2025-04-15.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/ib0z7hjzapkl9qr34dik31md8ppcrnfl-vimplugin-toggleterm.nvim-2025-03-09.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/0rj0gdsqdj0kfqrdjnz9j0iwpsanq811-vimplugin-tailwind-tools.nvim-2025-04-08.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/3qsqza63yadkmd1b11wjnsqvz03a0y37-vimplugin-snacks.nvim-2025-03-01.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/dlpiysv4hf6k1wraphjccnpbf6f40hcl-vimplugin-luajit2.1-oil.nvim-2.15.0-1-unstable-2.15.0-1.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/52awx56c756sy2hjvyf5lnk29sivlih0-vimplugin-nvim-autopairs-2025-04-13.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/z2pvdpgv6vb6f3iir4z0j35fa1ynwhlq-vimplugin-nix-develop.nvim-2023-07-23.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/qnawff2k6ivm8wck3ifvi6nsq0v54i17-vimplugin-vim-nix-2025-02-01.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/6sh71hrpxd18jkwnj54cknck9qi5vbk2-vimplugin-mini.nvim-2025-04-19.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/jnh5hmr2l398qf608f0m43cr7h6gcfd7-vimplugin-luajit2.1-luasnip-2.3.0-1-unstable-2.3.0-1.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/0xfjiv5z8dld49wz92w78ifrvmwz58zg-vimplugin-luajit2.1-lualine.nvim-scm-1-unstable-scm-1.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/1p5kp5swb79d6zwrcgfv7i3rgw3yiv7w-vimplugin-nvim-lint-2025-04-19.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/mig63a2qsgsw3rzncqxx3vanl0waamvf-vimplugin-luajit2.1-gitsigns.nvim-scm-1-unstable-scm-1.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/6vhnfwcmwn5m5p8gp4pk48mh8pjmw2ps-vimplugin-vim-fugitive-2025-02-19.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/g2spx98k1plx3hfg3jpqfwwqdh722qqq-vimplugin-conform.nvim-2025-04-20.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/1f00sg3y4jpals0cvx3zy6dgl8rw20wq-vimplugin-comment.nvim-2024-06-09.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/raxk1y1knkb05n5sj536x8d7ybw5h0gz-vimplugin-codecompanion.nvim-2025-04-20.drv»;
  }
  {
    config = "";
    optional = false;
    plugin = «derivation /nix/store/b5b7xx4ljy1rbf7n9fj7ik3f1gsviq0x-vimplugin-blink.cmp-1.1.1.drv»;
  }
  «derivation /nix/store/2wrqqr1km1liiiwc6k7zsv2lrc65yw45-vimplugin-nvim-ts-context-commentstring-2024-12-07.drv»
  «derivation /nix/store/xnl3jlcqd3zrzqz9m8dl1f49h3nxsds4-vimplugin-nvim-treesitter-textobjects-2025-04-15.drv»
  «derivation /nix/store/9vd9zys6w6szc7vszyril59xccwy3zby-nvim-config.drv»
]
:p packages.aarch64-darwin.default.config.performance.combinePlugins
nix-repl> :p packages.aarch64-darwin.default.config.performance.combinePlugins
{
  enable = false;
  pathsToLink = [
    "/autoload"
    "/colors"
    "/compiler"
    "/doc"
    "/ftplugin"
    "/indent"
    "/keymap"
    "/lang"
    "/lua"
    "/pack"
    "/parser"
    "/plugin"
    "/queries"
    "/rplugin"
    "/spell"
    "/syntax"
    "/tutor"
    "/after"
    "/ftdetect"
    "/data/plenary/filetypes"
    "/lsp"
  ];
  standalonePlugins = [
    «derivation /nix/store/g1l9s0x3qm1i3sk8cwn7i7q7gs42hr50-vimplugin-nvim-lspconfig-2025-04-19.drv»
    «derivation /nix/store/h82hqw1g8p6q4gkqngaj5s9050w0qzya-vimplugin-nvim-treesitter-2025-04-15.drv»
    «derivation /nix/store/9vd9zys6w6szc7vszyril59xccwy3zby-nvim-config.drv»
  ];
}
@IMax153 IMax153 added the bug Something isn't working label Apr 26, 2025
@IMax153 IMax153 changed the title [BUG] The nvim-lspconfig server config defaults are missing for some LSPs [BUG] The nvim-lspconfig default configuration missing for some LSPs Apr 26, 2025
@IMax153 IMax153 changed the title [BUG] The nvim-lspconfig default configuration missing for some LSPs [BUG] nvim-lspconfig default configuration missing for some LSPs Apr 26, 2025
@MattSturgeon
Copy link
Member

MattSturgeon commented Apr 26, 2025

I don't see any obvious issues in your init.lua, and looking in your checkhealth output all servers (other than eslint) have config from nvim-lspconfig.

I've cloned your config locally, it seems the nvim-lspconfig in your nixvim's nixpkgs doesn't have an lsp/eslint.lua which explains the issue:

Details

$ nix repl
Nix 2.28.2
Type :? for help.

nix-repl> :lf .
Added 21 variables.

nix-repl> inputs.nixvim.inputs.nixpkgs.legacyPackages.x86_64-linux.vimPlugins.nvim-lspconfig
«derivation /nix/store/xhgb9if6frgl8gp9ykk147yxd2bwiz2p-vimplugin-nvim-lspconfig-2025-04-19.drv»

nix-repl> "${inputs.nixvim.inputs.nixpkgs.legacyPackages.x86_64-linux.vimPlugins.nvim-lspconfig}"
"/nix/store/hmhhy2wah8l487cbx3d1hhpv2fqg466z-vimplugin-nvim-lspconfig-2025-04-19"


$ ls /nix/store/hmhhy2wah8l487cbx3d1hhpv2fqg466z-vimplugin-nvim-lspconfig-2025-04-19/lsp/eslint.lua
ls: cannot access '/nix/store/hmhhy2wah8l487cbx3d1hhpv2fqg466z-vimplugin-nvim-lspconfig-2025-04-19/lsp/eslint.lua': No such file or directory

Looking upstream at nvim-lspconfig, there is a lsp/eslint.lua file which was introduced 2025-04-21 (neovim/nvim-lspconfig#3731).

However, nixpkgs is still using nvim-lspconfig 32b6a644 from 2025-04-19 (even nixpkgs master is using that rev).

So you're running into neovim/nvim-lspconfig#3705 and either need to use a workaround, update vimPlugins.nvim-lspconfig yourself with an overlay, or wait for nixpkgs to update.

@MattSturgeon
Copy link
Member

MattSturgeon commented Apr 26, 2025

As a temporary solution, you can bump nvim-lspconfig yoursef using this overlay:

(pkgs: prevPkgs: {
  vimPlugins = prevPkgs.vimPlugins.extend (plugins: prevPlugins: {
    # Update nvim-lspconfig to fix https://github.com/nix-community/nixvim/issues/3224
    # TODO: remove once nixpkgs updates vimPlugins
    nvim-lspconfig = prevPlugins.nvim-lspconfig.overrideAttrs {
      src = pkgs.fetchFromGitHub {
        owner = "neovim";
        repo = "nvim-lspconfig";
        rev = "c48fac0936f24a5a2dbea9c8379ec9414a45eb8b";
        hash = "sha256-L/yz0egBCIJ9kIDoZzX/+9GHx2au2VtlOPkm+zZ+T7M=";
      };
    };
  });
})

PR submitted to your config: IMax153/nixvim#1

@MattSturgeon MattSturgeon changed the title [BUG] nvim-lspconfig default configuration missing for some LSPs [BUG] nvim-lspconfig default configuration missing for eslint Apr 26, 2025
@MattSturgeon
Copy link
Member

(Reopening until a fix makes it to nixvim's pinned nixpkgs)

@MattSturgeon MattSturgeon reopened this Apr 26, 2025
@IMax153
Copy link
Author

IMax153 commented Apr 26, 2025

@MattSturgeon - thank you so much for helping me to debug the issue, as well as to understand better how Nixvim / Neovim source configs for the LSPs! Also makes perfect sense why some LSPs were working and some were not!

I appreciate your patience 🙏

@MattSturgeon
Copy link
Member

FYI: @IMax153 you can remove the overlay next time you bump your nixvim input. We have reverted our migration from nvim-lspconfig's old API to the new API for now due to issues like this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants