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

Rust: Broken highlighting of escape sequences in char literals #2481

Closed
mattgodbolt opened this issue May 15, 2021 · 1 comment · Fixed by microsoft/monaco-languages#167
Closed
Labels
bug Issue identified by VS Code Team member as probable bug grammars help wanted Issues identified as good community contribution opportunities

Comments

@mattgodbolt
Copy link
Contributor

mattgodbolt commented May 15, 2021

monaco-editor version: 0.24.0
Browser: Chrome
**OS:**Linux

Rust char literals containing an escape sequence such as '\n' don't get highlighted correctly and '"' even breaks highlighting of the following code:

pub fn foo() {
    let _works_in_str = "\n\"";
    let _x = '\n';
    let _y = '\"';
    // Now it thinks everything until the next
    // double quote is part of a string
}

pub fn bar() {
    let _unbreak_it = "\"\"";
    let _and_here_it_works_again = true;
}

Pasting this into https://microsoft.github.io/monaco-editor/ and selecting 'Rust' reproduces the issue.

See compiler-explorer/compiler-explorer#2665

@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug grammars labels May 18, 2021
@alexdima
Copy link
Member

We are more than welcoming a PR by the community!

@alexdima alexdima added the help wanted Issues identified as good community contribution opportunities label May 18, 2021
arlosi pushed a commit to arlosi/monaco-editor that referenced this issue Oct 29, 2021
arlosi pushed a commit to arlosi/monaco-editor that referenced this issue Oct 29, 2021
arlosi pushed a commit to arlosi/monaco-editor that referenced this issue Oct 29, 2021
arlosi added a commit to arlosi/monaco-editor that referenced this issue Oct 29, 2021
…apes.

Rust's raw strings were previously not supported, and chars did not correctly handle escapes.

Fixes microsoft#2552
Fixes microsoft#2481
arlosi added a commit to arlosi/monaco-editor that referenced this issue Oct 29, 2021
…apes.

Rust's raw strings were previously not supported, and chars did not correctly handle escapes.

Fixes microsoft#2552
Fixes microsoft#2481
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug grammars help wanted Issues identified as good community contribution opportunities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants