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

VSCode extension doesn't highlight variant group classes #1462

Closed
itpropro opened this issue Aug 24, 2022 · 4 comments
Closed

VSCode extension doesn't highlight variant group classes #1462

itpropro opened this issue Aug 24, 2022 · 4 comments
Labels

Comments

@itpropro
Copy link
Contributor

If you are using variant groups, the first and (often) the last class in a variant group doesn't get parsed/detected by the vscode extensions.

image

image

Here is another example to test:

before:(scale-0 transition ease-in-out duration-100 content-empty h-3 w-3 rounded-50% duration-100 bg-blue-500)

@antfu
Copy link
Member

antfu commented Aug 25, 2022

Yes, it's not yet supported. PR welcome if anyone want to work on it.

@antfu antfu added enhancement New feature or request pr welcome vscode labels Aug 25, 2022
@itpropro
Copy link
Contributor Author

I would love to create a PR for that, where can I find some documentation on the vscode extension and which shared libraries/unocss imports it uses and how to debug that besides the normal MS documentation @antfu ?

@antfu
Copy link
Member

antfu commented Aug 25, 2022

export function getMatchedPositions(code: string, matched: string[]) {

You can test it with the playground/, they are using the same function to highlight utils.

@itpropro
Copy link
Contributor Author

Thanks for the hint @antfu, I never worked with vscode extensions before. UnoCSS didn't compile in Windows (at least on my clean Win 11 node 16 VM), so I had to switch to WSL, but everything seems to work there. I have created PR #1468 that adds highlighting for the classes inside of the variant group. I hope, I find some time the next days to take a look at how to fix highlighting for the variant itself and maybe the annotation to include the variant.

@antfu antfu closed this as completed Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants