-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Hello! We recently released Nova 6, and have received reports that doing so has caused the Rust extension to break its syntax highlighting. After some investigation, I found that this was due to a change in our parser we made to fix a bug.
It seems that Rust strings which contain an escape sequence for the closing quotes is not being properly parsed, which leads to the string ending early and a new string being started. One user provided this minimal code example:
my_string = String::from("an escaped quote mark\"")
println!("{}", my_string);Unfortunately, the bug in Nova's parser present in Nova 5.1 and before meant that this inner quote was was accidentally skipped by parsing entirely, so the escape "handled correct" accidentally as well.
You should be able to resolve the issue in the Rust extension by explicitly parsing this escape sequences, which will ensure the parser does not end the string early:
<scope name="rust.string">
<starts-with>
<expression>"</expression>
</starts-with>
<ends-with>
<expression>"</expression>
</ends-with>
<subscopes>
<scope name="rust.string.escape">
<expression>\\(?:\\|")</expression>
</scope>
</subscopes>
</scope>If you need any more information, please don't hesitate to let me know.