Skip to content

[Bug] Rust raw strings with br or cr prefix are not treated as raw strings #4856

@ChrisDenton

Description

@ChrisDenton

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

monaco editor playground

Monaco Editor Playground Code

const value = /* set from `myEditor.getModel()`: */ `fn main() {
    let a = r#"abc\\"#;
    let b = br"abc\\";
    let c = cr"abc\\";
}`;

// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
	value,
	language: "rust",
	automaticLayout: true,
});

Reproduction Steps

Create and editor which includes rust code that uses br"\" or cr"\" raw strings.

Actual (Problematic) Behavior

The br and cr strings are treated as normal strings with escapes.

Expected Behavior

The br and cr strings should be treated as raw strings.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions