-
Notifications
You must be signed in to change notification settings - Fork 195
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
Intellisense stop working with CVA with a lot of variants (searchRange too small) #1032
Comments
Looks like there is ongoing discussion about this on But both of those tickets are closed so not sure if the conversation is surfacing. Could we expand the |
If there's some editor performance issues with making the searchRange unlimited, being able to configure it for your certain use case is also fine. Just would really appreciate a solution because tailwind without the intellisense is totally different and degraded DX |
I’m interested in configuring the |
import { cva, cx } from "class-variance-authority";
const variants = {
variant: {
"blue": cx("bg-blue-500"),
"red": cx("bg-red-500"),
// ...
"yellow": cx("bg-yellow-500"),
"green": cx("bg-green-500"),
}
}
const button = cva(null, {
variants,
}); This seems to be working as a workaround, although maybe not the best for performance. |
What version of VS Code are you using?
1.92
What version of Tailwind CSS IntelliSense are you using?
v0.12.6
What version of Tailwind CSS are you using?
3.4.7
What package manager are you using?
npm
What operating system are you using?
macOs
Describe your issue
I'm building a design system with tailwindcss and class variance authority (CVA) where some components have many different variants. We are also using design tokens with long names.
When the tailwind variants object and classes gets too big, tailwind intellisense, hovering and autocomplete stop working.
This apparently has something do with the searchRange (See #837)
I understand this was increased but it still doesn't work for many options.
Is this configureable? Is there anything that can be done to fix it?
Code example that fails
The text was updated successfully, but these errors were encountered: