Skip to content

tailwindcss-language-server starting on any postcss.config.* #1594

Description

@diced

I have confirmed that this is a bug related to nvf

  • This is a bug, and not an user error or a support request. I understand that my issue will be closed if it is not a bug in nvf.
  • I have checked the issues tab and confirmed that my issue has not yet been reported. I understand that my issue will be closed if it is a duplicate.

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

  1. enable the tailwindcss-language-server, vim.lsp.presets.tailwindcss-language-server.enable = true;
  2. 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.
  3. 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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions