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

Add Semantic Tokens for Template Literal Strings #901

Open
benrbray opened this issue Jun 9, 2024 · 1 comment
Open

Add Semantic Tokens for Template Literal Strings #901

benrbray opened this issue Jun 9, 2024 · 1 comment

Comments

@benrbray
Copy link

benrbray commented Jun 9, 2024

Problem

In VS Code, semantic token theme colors override textmate token colors (even when they are user defined). This usually makes sense, as the semantic tokens are intended to provide more specific information about tokens than what is available from syntax alone.

However, based on the output of VS Code's Developer: Inspect Editor Tokens and Scopes command, it appears that typescript-language-server labels all template strings with the generic string scope. As a result, template strings will not receive syntax highlighting when semantic tokens are enabled.

As you can see from the image below, the textmate grammar knows that animal is a variable inside of a template string, but the semantic token string is taking precedence.

image

@rchl
Copy link
Member

rchl commented Jun 10, 2024

In VSCode you are not using this server but VSCode's built-in code (which this server is based on). So you should report your issue in VSCode repo and if it's deemed a bug, the fix might potentially trickle down to this server.

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