microsoft / microsoft/monaco-editor
[Bug] Rust raw strings with `br` or `cr` prefix are not treated as raw strings
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Monaco Editor Playground and its Rust example to reproduce the behavior for br"..." and cr"..." strings. Trace the Rust language support responsible for string recognition, then verify that both prefixes are treated as raw strings rather than interpreting escapes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100