Skip to content
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

Update from latest tailwindcss-intellisense to allow regex #6

Closed
anark opened this issue Dec 16, 2020 · 6 comments
Closed

Update from latest tailwindcss-intellisense to allow regex #6

anark opened this issue Dec 16, 2020 · 6 comments

Comments

@anark
Copy link

anark commented Dec 16, 2020

The latest tailwindcss-intellisense allows for setting your own regex so you can use things like twin.macro.

Would it be possible to bring those updates into this COC version?

@rodrigore
Copy link
Owner

Hi!
Can you provided me some example in order to test this new feature?

@anark
Copy link
Author

anark commented Dec 16, 2020

Yes,
For example, if you are using the new version of tailwindcss-intellisense and you add the following config

"tailwindCSS.colorDecorators": "on",
"tailwindCSS.experimental.classRegex": [
  "tw`([^`]*)", // tw`...`
  "tw=\"([^\"]*)", // <div tw="..." />
  "tw={\"([^\"}]*)", // <div tw={"..."} />
  "tw\\.\\w+`([^`]*)" // tw.xxx`...`
],
"tailwindCSS.includeLanguages": {
  "typescript": "javascript",
  "typescriptreact": "javascript"
}

You should get autocompletion on the ... props labelled tw="..." and on template strings tw`...`

@rodrigore
Copy link
Owner

Great, thank you for the snippet.

I'm going to update the server and I will let you know. I just noticed that the creator of the tailwind server change a lot since version 0.4.3, so not sure when I will finish the migration to the last version.

@anark
Copy link
Author

anark commented Dec 16, 2020

Sounds good. The changes are probably due to tailwind 2.0 being released.

@rodrigore
Copy link
Owner

Hey @anark I just updated the server and it seems that the experimental classRegex works fine.
I only update the server implementation, but let me know if something is not working please.

image

image

@anark
Copy link
Author

anark commented Dec 29, 2020

Seems to be working fro me! Thanks so much.

@anark anark closed this as completed Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants