Skip to content

modules/lsp: add inotify-tools package when any lsp server is enabled#4150

Open
wvffle wants to merge 1 commit into
nix-community:mainfrom
wvffle:fix/inotify-warning
Open

modules/lsp: add inotify-tools package when any lsp server is enabled#4150
wvffle wants to merge 1 commit into
nix-community:mainfrom
wvffle:fix/inotify-warning

Conversation

@wvffle
Copy link
Copy Markdown
Member

@wvffle wvffle commented Jan 12, 2026

Before this change :LspInfo complains about vim.lsp using libuv-watchdirs for file watcher:

vim.lsp: File Watcher ~
- File watch backend: libuv-watchdirs
- ⚠️ WARNING libuv-watchdirs has known performance issues. Consider installing inotify-tools.

This PR adds inotify-tools as extra package when any of the lsp servers is enabled via lsp.servers.*.enable option, so the warning goes away.

@wvffle wvffle force-pushed the fix/inotify-warning branch 3 times, most recently from f876170 to de0d3db Compare January 13, 2026 09:01
@HeitorAugustoLN
Copy link
Copy Markdown
Member

HeitorAugustoLN commented Jan 13, 2026

Not sure about enabling it for any LSP, I don't have any LSP enabled that uses file watching. I think we can add inotify-tools in dependencies, and let each user enable it if they want

@MattSturgeon
Copy link
Copy Markdown
Member

MattSturgeon commented Jan 13, 2026

Not sure about enabling it for any LSP, I don't have any LSP enabled that uses file watching. I think we can add inotify-tools in dependencies, and let each user enable it if they want

My instinct is that LSPs that benefit from it should enable the dependency.

Maybe we can implement a test that greps through Checkhealth and/or LspInfo output, to validate each LSP gets the right dependencies?

I could be convinced that any LSP being installed should enable it if that is impractical to maintain that, though. Assuming installing it by default is relatively harmless & uncontroversial.

Before this change `:LspInfo` complains about `vim.lsp` using `libuv-watchdirs` for file watcher:

```
vim.lsp: File Watcher ~
- File watch backend: libuv-watchdirs
- ⚠️ WARNING libuv-watchdirs has known performance issues. Consider installing inotify-tools.
```

This commit adds `inotify-tools` as extra package when any of the lsp servers is enabled via `lsp.servers.*.enable` option, so the warning goes away.
@wvffle wvffle force-pushed the fix/inotify-warning branch from de0d3db to 1487b11 Compare January 15, 2026 20:38
Comment on lines +154 to +156
dependencies.inotify-tools = lib.mkIf (enabledServers != [ ] && pkgs.stdenv.hostPlatform.isLinux) {
enable = true;
};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. As per plugins/lsp/language-servers/nixd: use dependencies.nixpkgs-fmt #4075 (comment) I'm unsure about continuing to spread usage of dependencies until we've ironed out how to advertise to users that a particular option/module enables a particular dependency.

  2. As per modules/lsp: add inotify-tools package when any lsp server is enabled #4150 (comment) and modules/lsp: add inotify-tools package when any lsp server is enabled #4150 (comment), I'd ideally prefer to see a way of us maintaining this on a per-LSP-server basis, too.

I'm willing to overlook pt.1 if this is considered an important enough dependency that we need a solution now, before solving the wider dependencies questions.

Currently, I suspect pt.2 would be too high a maintenance burden. In the future if we had a way to assert specific :LspInfo output with nixvim's test module, this could become easier.

Perhaps we can address pt.2 by adding a TODO comment, along the lines of:

Ideally this dependency should be enabled by the servers that depend on inotify-tools, instead of globally for all servers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants