-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Incorrect string syntax highlighting in attributes in VS Code #6042
Comments
Does this also happen when the rust-analyzee extension is disabled? If so then this issue is likely caused by an incorrect regex in the language definition of vscode. |
I think there's another issue about the same thing. But is the built-in grammar still used if semantic highlighting is enabled? |
The rust-analyzer extension ships with a grammar that is I believe adapted from the built-in grammar of vscode. I think it only has some tweaks to better make it match what semantic highlighting would output. (#4397) I am not sure if semantic highlighting enhances or replaces the output of the vscode grammar. |
Hi all! I'm not sure if this problem is necessarily caused by rust-analyzer, but it seems like maybe rust-analyzer could fix it? VS Code ships with a rust grammar that is pulled from atom which incorrectly excludes raw string literals from attributes. I have opened a PR here, but as far as I can tell it hasn't been noticed or picked up. I'm using a local version of this change to make my own syntax highlighting work properly. Perhaps this could be implemented in rust-analyzer with semantic highlighting? |
Yeah, seems like the project is looking for maintainers? zargony/atom-language-rust#144 |
@dustypomerleau is this fixed by the new grammar? |
@matklad Nearly. Cases 2 and 3 are ok: Case 1 still needs a little work: The way that strings and chars are included in attributes is allowing them to gobble up the closing |
When using logos, I get the following broken syntax highlighting:
Original source for replication purposes:
A workaround (suggested by @Kixiron and seen in the wild in Crunch) is to add
// workaround highlighting: "
to the offending lines:The text was updated successfully, but these errors were encountered: