tailwindlabs / tailwindcss-intellisense

Intelligent Tailwind CSS tooling for Visual Studio Code
2.75k stars 183 forks source link

Doesn't work when `tailwind.config.js` is in VSCode's `files.exclude` setting #902

Closed SrBrahma closed 5 months ago

SrBrahma commented 5 months ago

What version of VS Code are you using?

v1.85.2

What version of Tailwind CSS IntelliSense are you using?

v0.11.39 Pre-release. Also happens on Release.

What version of Tailwind CSS are you using?

v3.4.1

What package manager are you using?

bun

What operating system are you using?

WSL Ubuntu; using WSL extension for VSCode

Tailwind config

Irrelevant

VS Code settings

"files.exclude": {
  "**/*.config.*": true,
}

Reproduction URL

Describe your issue

I use the extension Peek Hidden Files. It helps me to declutter all the garbage in the files tree so I can have a better view of the more useful files. You don't need this extension to try this issue; just add the json prop above to the settings.json.

I tracked down the issue of the Tailwind CSS IntelliSense extension not working when I activated the Peek Hidden Files extension (changes all the false to true or false in the files.exclude, to hide or show them). And, I found out that if I comment the line on the settings.json that would hide the tailwind.config.js, the extension would properly work (after a reload).

It makes me believe that the Tailwind extension may check for the tailwind.config.js existence by using the Files Tree API, while to avoid this issue, it could use an approach like Glob in the project cwd.

thecrypticace commented 5 months ago

The reason this is happening is we explicitly disable all intellisense features for any excluded files. This includes project discovery (e.g. finding config files, figuring out the tailwind version, registering handlers for each project, etc…). This is, at least for now, an intentional decision that we're not likely to change.