Microsoft/monaco-editor
View on GitHub[Bug] Incorrect syntax highlighting of Perl regex string
Open
#4165 opened on Sep 8, 2023
bughelp wantedlanguages-basic
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()`: */ `my \$regex = qr{\\W{1,10}}`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "perl",
automaticLayout: true,
});
Reproduction Steps
Put the editor in Perl mode, type in my $regex = qr{\\W{1,10}}
Actual (Problematic) Behavior
The regular expression was interpreted as being closed by the first instance of } resulting in the second instance being highlighted red. See below:
Expected Behavior
The regular expression string should continue to be highlighted up to and including the second } as show in the vscode.dev screenshot below.
Additional Context
Correct syntax highlighting on vscode.dev: