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

Syntax Highlighting not fully working in TypeScript files when Volar is enabled #469

Closed
mareszhar opened this issue Sep 8, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@mareszhar
Copy link

When I have Volar enabled, some variables in TypeScript lose their colors.

I used the Inspect Editor Tokens And Scopes command to see what was happening, and it seems Volar is causing TypeScript variables to lose their semantic token type. Instead, they are only keeping their more generic textmate scopes, which is causing the loss of nuance in syntax highlighting.

Here you can see how a .ts file looks when Volar is DISABLED:

volarDisabled

And here you can see the syntax highlighting issues when Volar is ENABLED:

volarEnabled


Notice that in the first screenshot, TypeScript knows that the variable userName is of semantic type parameter. But, in the second screenshot, it only knows the more generic textmate scopes. This problem is affecting all variables, so TypeScript can no longer distinguish the difference between variables defined with const, let, and arguments.

I have tried disabling Volar's TS Plugin, but it didn't make a difference.

I would be extremely grateful if you could look into this bug.

Thank you ✨!

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Sep 8, 2021
@mareszhar
Copy link
Author

Thank you for fixing it @johnsoncodehk ❤️!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants