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

Remove semantic tokens for string literals (templates) #548

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

fwcd
Copy link
Owner

@fwcd fwcd commented Jan 16, 2024

Currently, the language server emits a single token for every string literal, which in clients like VSCode covers up interpolations:

Screenshot 2024-01-16 at 01 18 52

Ideally we should probably slice up the string literals to exclude child ranges (that's what SourceKit-LSP seems to do), but for now we are better off not including string literals, thereby deferring the highlighting to e.g. the TextMate grammar:

Screenshot 2024-01-16 at 01 19 08

These cover up string interpolations and thus generally produce a worse
highlighting than before.
@fwcd fwcd added the semantic tokens Related to semantic tokens/highlighting label Jan 16, 2024
@github-actions github-actions bot added the code quality Refactoring, tests etc. label Jan 16, 2024
@fwcd fwcd added this to the 1.3.10 milestone Jan 16, 2024
@fwcd fwcd merged commit 7b93dd6 into main Jan 16, 2024
8 checks passed
@fwcd fwcd deleted the remove-string-semantic-tokens branch January 16, 2024 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Refactoring, tests etc. semantic tokens Related to semantic tokens/highlighting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant