Closed dorshinar closed 1 year ago
Instead of using regex. Try this solution: https://www.jussivirtanen.fi/writing/using-tailwind-intellisense-within-strings
Just use a consistent naming system like: buttonVariants
".*Variants*"
I'm currently figuring out a way to make this work for .svelte
files. No progress yet.
Hey @dorshinar, this should be fixed in the latest release (v0.9.12
) 👍
What version of VS Code are you using?
For example: 1.80.2 (Universal)
What version of Tailwind CSS IntelliSense are you using?
For example: v0.9.11
What version of Tailwind CSS are you using?
For example: 3.3.2
What package manager are you using?
For example: yarn 1.22.19
What operating system are you using?
For example: macOS 13.4.1
Tailwind config
VS Code settings
Reproduction URL
A public GitHub repo that includes a minimal reproduction of the bug. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private/confidential, since we want a link to a separate, isolated reproduction anyways.
https://github.com/dorshinar/tailwind-intellisense-bug
Describe your issue
The tailwind intellisense is a little finicky when configured with a regex that matches all strings. The regex I'm using is
[["[\"'
]([^\"']*).*?[\"'
]"]]`, and it sometimes works and sometimes doesn't. The video attached shows it more clearly:https://github.com/tailwindlabs/tailwindcss-intellisense/assets/17943918/e89642e4-1cb7-4b72-824e-6a1dfc243026
Sometimes I can "nudge" the intellisense to work for some of the strings, for others it works every time, and for some never at all. I'm using the strings inside the
buttonVariants
variables in thepage.tsx
file.