I have confirmed that this is a bug related to nvf
Description
The tailwindcss-language-server (enabled by vim.lsp.presets.tailwindcss-language-server.enable = true;) starts for any directory with a postcss config file.
https://github.com/NotAShelf/nvf/blob/main/modules/plugins/lsp/presets/tailwindcss-language-server.nix#L111-L135
Installation Method
Other
Installation Method (Other)
installed as a flake output
see https://github.com/diced/dotfiles/blob/72716ba999464c8e33fcb4e75c24569edf738b94/flake.nix#L72-L82
nix run github:diced/dotfiles#neovim
nvf Version
master, 8b00023
Reproduction steps
- enable the tailwindcss-language-server,
vim.lsp.presets.tailwindcss-language-server.enable = true;
- start neovim within a directory that has a
postcss.config.cjs but doesn't use tailwindcss, like not having it in your package.json for example.
- observe that the tailwindcss-language-server started, you can check in
:checkhealth under vim.lsp
Expected behavior
It shouldn't start tailwindcss-language-server if there is no need to.
I guess this is a bit difficult now with tailwind v4 no longer using a root configuration file that's called tailwind.config.ts, but I think a better way is to somehow read the package.json at startup and then check if the dependencies/devDependencies has the tailwindcss or any other @tailwindcss/* package installed.
Actual Behavior
taliwindcss-language-server starts
System Information
- system: `"aarch64-darwin"`
- host os: `Darwin 25.4.0, macOS 26.4.1`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 2.31.5`
- nixpkgs: `/nix/store/43jk2n1njqk5hqb043r6rhjriav6fyb2-source`
Relevant log output
in checkhealth:
- tailwindcss-language-server (id: 2)
- Version: ? (no serverInfo.version response)
- Root directory: ~/Projects/zipline
- Command: { "/nix/store/3pavr0lcs1amvdq3p97r14pxssqmksgm-tailwindcss-language-server-0.14.28/bin/tailwindcss-language-server", "--stdio" }
- Settings: {
editor = {
tabSize = 2
},
tailwindCSS = {
classAttributes = { "class", "className", "class:list", "classList", "ngClass" },
includeLanguages = {
eelixir = "html-eex",
elixir = "phoenix-heex",
eruby = "erb",
heex = "phoenix-heex",
htmlangular = "html",
templ = "html"
},
lint = {
cssConflict = "warning",
invalidApply = "error",
invalidConfigPath = "error",
invalidScreen = "error",
invalidTailwindDirective = "error",
invalidVariant = "error",
recommendedVariantOrder = "warning"
},
validate = true
}
}
- Attached buffers: 113
I have confirmed that this is a bug related to nvf
Description
The tailwindcss-language-server (enabled by
vim.lsp.presets.tailwindcss-language-server.enable = true;) starts for any directory with a postcss config file.https://github.com/NotAShelf/nvf/blob/main/modules/plugins/lsp/presets/tailwindcss-language-server.nix#L111-L135
Installation Method
Other
Installation Method (Other)
installed as a flake output
see https://github.com/diced/dotfiles/blob/72716ba999464c8e33fcb4e75c24569edf738b94/flake.nix#L72-L82
nix run github:diced/dotfiles#neovimnvf Version
master, 8b00023
Reproduction steps
vim.lsp.presets.tailwindcss-language-server.enable = true;postcss.config.cjsbut doesn't use tailwindcss, like not having it in your package.json for example.:checkhealthundervim.lspExpected behavior
It shouldn't start tailwindcss-language-server if there is no need to.
I guess this is a bit difficult now with tailwind v4 no longer using a root configuration file that's called
tailwind.config.ts, but I think a better way is to somehow read the package.json at startup and then check if the dependencies/devDependencies has the tailwindcss or any other @tailwindcss/* package installed.Actual Behavior
taliwindcss-language-server starts
System Information
Relevant log output