Closed asnaseer closed 6 months ago
I'm guessing you're using a class regex to detect the tailwind
function so intellisense works. Use this one and the problem should go away:
{
"tailwindCSS.experimental.classRegex": [
["tailwind\\(([^)]+)\\)", "\"([^\"]*)\""],
]
}
I tested with your code snippet locally and seems to work fine on single and multiple lines.
Why is this marked as closed? Will the suggestion by @thecrypticace be implemented in this library?
@thecrypticace I see that you are an active maintainer of this library and just wanted to understand your comment above - are you indicating that I need to do something within VSCode to get intellisense to work correctly or that something within this library needs to be changed to fix the issue that I reported?
@thecrypticace I see that you are an active maintainer of this library and just wanted to understand your comment above - are you indicating that I need to do something within VSCode to get intellisense to work correctly or that something within this library needs to be changed to fix the issue that I reported?
Hi
@iMuhammadMustafa Thank you for clarifying this. I just tried it and it works just fine - much appreciated!
In fact, I found this regex works even better: "tailwind\\([\\n\\s]*\\\"([^\"]+)\\\"[\\n\\s]*\\)"
What version of VS Code are you using? v1.86.1
What version of Tailwind CSS IntelliSense are you using? v0.10.5
What version of Tailwind CSS are you using? v2.0.2
What package manager are you using? yarn
What operating system are you using? macOS
Tailwind config
VS Code settings I will omit this as I am concerned that there may be some sensitive data within it - please let me know if there are any specific settings that you wanted to look at.
Reproduction URL I don't believe you need a reproduction URL as the issue is very simple to produce.
Describe your issue We use tailwind in a react native app as follows:
As you can see, we have two styles defined
s1
ands2
.s1
has the tailwind string on the next line following the call totailwind
where ass2
has the tailwind string on the same line as the call totailwind
.When hovering over the tailwind string for
s1
we see no intellisense at all, where as hovering over the tailwind string fors2
correctly pops up the intellisense for the various tailwind classes.If we move the string to the same line as follows:
then intellisense starts working again for
s1
.We use Prettier to enforce a max line length which is why some of our tailwind strings gets pushed onto the next line.