Replies: 9 comments
-
I'll have to take a look. I'm not sure if this is Tailwind's fault or the extensions. We weren't using Oxide (Tailwind's content scanning engine) properly in prior releases which I fixed in v0.14.12. We've got some changes coming in v4.1 that's going to make the rules around content scanning simpler but I don't know for sure if it'll fix this. @david-pw Any chance you can provide a reproduction repo I can quickly test with tomorrow? (or just some instructions on how to create one?) |
Beta Was this translation helpful? Give feedback.
-
@thecrypticace sure - here you go: https://github.com/david-pw/tw-intellisense-issue-1290 |
Beta Was this translation helpful? Give feedback.
-
@david-pw Is |
Beta Was this translation helpful? Give feedback.
-
@thecrypticace yes it is, I've just pushed some new changes to better reflect my repo's setup |
Beta Was this translation helpful? Give feedback.
-
Okay, if I understand what the problem is that you're having. This didn't "break" in a recent release — it's been this way. (I'm not testing on Windows at the moment but the behavior is supposed to be identical). The problem here is during what I call "project discovery" where a workspace is scanned for potential stylesheets that represent a project. In this case we discard things using I think this is something we should let user's configure in settings (like VSCode does for search, explorer, etc…) |
Beta Was this translation helpful? Give feedback.
-
A workaround right now would be to change your project settings to something like this: {
"tailwindCSS.experimental.classRegex": [["tv\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]],
"tailwindCSS.files.exclude": [
// Defaults
"**/.git/**", "**/node_modules/**", "**/.hg/**", "**/.svn/**",
// Custom for this project
"**/dist/**"
]
} Aside: you should be able to drop your {
"tailwindCSS.classFunctions": ["tv"],
"tailwindCSS.files.exclude": [
// Defaults
"**/.git/**", "**/node_modules/**", "**/.hg/**", "**/.svn/**",
// Custom for this project
"**/dist/**"
]
} If you do lemme know if you happen to run into any problems with it |
Beta Was this translation helpful? Give feedback.
-
Yes, you're right - I just downgraded to v0.14.0 and the issue still persists. I tried your vscode settings suggestion and I'm happy with that solution. Thanks for your help 🙂! |
Beta Was this translation helpful? Give feedback.
-
Gonna add this to my todo list to figure out how to make it work because this seems pretty reasonable but I'll put it behind an option (likely defaulted to on). Note to self: VSCode's ignore file parsing / handling is found here: https://github.com/microsoft/vscode/blob/966a672107ce33bcc65a413f984254bab492a70e/src/vs/workbench/services/search/common/ignoreFile.ts Probably should base whatever we do off of that so it's consistent. |
Beta Was this translation helpful? Give feedback.
-
If you can write some simple specification then I can take a look, I've worked on something similar at my company so already familiar with this concept. From what I understand, for this to work correctly we need the following:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of VS Code are you using?
1.98.2
What version of Tailwind CSS IntelliSense are you using?
0.14.12 (pre-release)
What version of Tailwind CSS are you using?
^4.0.17
What package manager are you using?
npm
What operating system are you using?
Windows 11
Tailwind config
VS Code settings
Reproduction URL
N/A
Describe your issue
Just raising to your attention that the latest release of the content detection scans folders that are git-ignored, which can result in intellisense breaking for the entire project.
The error I'm receiving is:
My actual tailwind css file is located in
D:/my-project/src/styles/tailwind.css
, and will resolve the imports correctly.I'm wondering if the error is handled, potentially the extension could try and find another tailwind file? that way you don't have to consider a gitignore? not sure.
Thanks for your hard work on this extension btw - love it.
Beta Was this translation helpful? Give feedback.
All reactions