Replies: 3 comments 1 reply
-
Let's consider if you really wanted every single class possible, you would need to generate every possible combination of the variants, (like Now if we consider autocompletion, we have a starting string that we can use to narrow-down the candidate set, plus we don't generate all the variant permutations – we consider only variants that match. Take Disclaimer: this is just my own thinking and I haven't looked at the intellisense code. Footnotes
|
Beta Was this translation helpful? Give feedback.
-
The short of it is we have APIs directly in Tailwind optimized for getting just the class names very quickly and we expose that to the IntelliSense plugin. Here's an example: https://github.com/tailwindlabs/tailwindcss/blob/master/src/lib/setupContextUtils.js#L847-L869 I might be getting some of the details wrong but if I remember right, IntelliSense calls other APIs in Tailwind passing through the class name to get the corresponding CSS for each class on demand, whenever it needs to actually display the CSS to the user. |
Beta Was this translation helpful? Give feedback.
-
Thanks both for taking time to explain it. 🙏🏾 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
This topic has been discussed in detail (generating all classes like in v2) and there are already different solution options.
But, I would like to get my head around this - If generating all possible classes is not viable (except by throttling with safelist like here - #6347 (comment)), how is IDE auto-completion possible & works in V3? Wouldn't the language-server had to generate all the possible classes given a config to enable auto-completion, isn't it?
Hope I'm not missing something too obvious. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions