Skip to content

v4: IntelliSense stops working for a file after a case-only rename on Windows #1613

Description

@yusifaliyevpro

What version of VS Code are you using?

v1.135.0

What version of Tailwind CSS IntelliSense are you using?

v0.16.0

What version of Tailwind CSS are you using?

v4.3.3

What package manager are you using?

pnpm

What operating system are you using?

Windows 11

Tailwind CSS Stylesheet (v4) or config file (v3)

/* src/app/globals.css */
@import "tailwindcss";

VS Code settings

{
  "editor.formatOnSave": true
}

Reproduction URL

A repo would not show this bug. The problem is stateful and comes from a cached file list, not from the files themselves. If you clone any repo and open it for the first time, the server scans the folder and reads the current lowercase names, so IntelliSense just works. The bug only appears when the case rename happens on a machine that already has the old case cached. So please follow the steps below instead of opening a finished repo.

Steps to reproduce:

  1. On Windows (case insensitive filesystem, git core.ignorecase=true), create a new project with Tailwind v4 and IntelliSense working.
  2. Add a component file with a capital letter in the name, for example src/components/Search.tsx, and open it. IntelliSense works.
  3. Rename the file to lowercase: git mv src/components/Search.tsx src/components/search.tsx. Because the filesystem is case insensitive, the file on disk is now search.tsx and git tracks it as search.tsx.
  4. Open search.tsx again.

Describe your issue

After I rename a file so that only the letter case changes (for example Search.tsx to search.tsx, or FormSubmit.tsx to form-submit.tsx), IntelliSense stops working for that file. There are no completions, no hover, and no linting on the class names. Every other file in the same folder still works fine.

The language server log shows this for the renamed files:

[Info] [GLOBAL] No matching project for document {
  fsPath: 'C:\\...\\src\\components\\search.tsx',
  normalPath: '/c:/.../src/components/search.tsx'
}

It looks like the server scans the folder once and caches the source file list with the old case (Search.tsx). When I open the file, VS Code sends the current lowercase path (search.tsx). The server compares the two paths in a case sensitive way, does not find a match, and decides the document does not belong to any project. So the file gets no IntelliSense.

The filesystem and git already agree on the lowercase name, so this is not a git or filesystem problem. On a case insensitive OS the two names point to the same file, and I would expect the server to treat them as the same file too.

What did not help: restarting VS Code does not fix it. Uninstalling and reinstalling the extension does not fix it either. The file keeps getting no IntelliSense. So the wrong cased name seems to be cached somewhere that survives a full restart and a reinstall, not just in the running server memory.

Expected behavior: on a case insensitive filesystem, path matching between the cached source list and the opened document should be case insensitive, or the server should revalidate its file list when a file case changes. Either way IntelliSense should keep working after a case only rename, and a normal restart of the editor should be enough to recover if something goes wrong.

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