Skip to content

Windows: file path matching fails due to backslash vs forward-slash mismatch in anyMatches #1567

Description

@zeroarst

What version of VS Code are you using?

WebStorm 2026.1 (JetBrains IDE, not VS Code — the language server is the same bundled binary)

What version of Tailwind CSS IntelliSense are you using?

v0.14.29 (bundled in WebStorm Tailwind CSS plugin 261.22158.274)

What version of Tailwind CSS are you using?

v3.4.3

What package manager are you using?

pnpm

What operating system are you using?

Windows 10

Tailwind CSS config file (v3)

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

Reproduction URL

Reproducible in any project on Windows where document.uri paths use backslashes.

Describe your issue

On Windows, Tailwind CSS autocomplete does not appear in any file. The language server starts and builds successfully (state.enabled = true), but completions are never returned.

Root cause: The anyMatches helper (in the path matcher cache) uses picomatch to check whether a document's file path matches the configured content globs. On Windows, document URIs resolve to paths with backslashes (e.g. D:\Projects\foo\src\App.tsx), while picomatch patterns always use forward slashes (e.g. D:/Projects/foo/src/**). Picomatch does not normalize backslashes by default, so every path check returns false — meaning no document is ever considered "in scope" and completions are skipped for all files.

Relevant code (packages/tailwindcss-language-server/src/projects.ts, in the picomatch cache builder):

// Current (broken on Windows):
anyMatches: (t, n) => {
  let i = e.get(t)
  return n.some(a => i(a))   // `a` may contain backslashes on Windows
}

// Fix:
anyMatches: (t, n) => {
  let i = e.get(t)
  return n.some(a => i(a.replace(/\\/g, '/')))
}

Normalizing backslashes to forward slashes before calling picomatch restores correct matching on Windows. After this fix, completions work correctly.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions