-
Notifications
You must be signed in to change notification settings - Fork 211
Project discovery should honor .gitignore files #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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?) |
@thecrypticace sure - here you go: https://github.com/david-pw/tw-intellisense-issue-1290 |
@david-pw Is |
@thecrypticace yes it is, I've just pushed some new changes to better reflect my repo's setup |
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…) |
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 |
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 🙂! |
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. |
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.
The text was updated successfully, but these errors were encountered: