Skip to content

[Bug] Incorrect syntax highlighting of Perl regex string #4165

Open

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?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.41.0#XQAAAAJGAQAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscwzPYGRgmSaumWUF-TBOsVJ4S4FwfCDQb5-2uUHXTVAefbVSd9IzaZ_vv9VR9KugtAtrZZl00gBtQ18GrD0DOEiukzBVguDDmDX0oDR0pbCK0JNW3wlzPpgDoOYFvE5HbmEwFq8ZBVlbrwj5M3U91pgpasFYsomPXmsFfzUy1pUsnf-Jdmt1Jb68B9zkz7gfrevYd8HIa_II2BKE8V-dbXVHIGNLgqWBXGR7HOoE5TEEm0SgAMw0TWrgXRI0mnJxrMF3yP_bgKxNkSIVTpsM6D7fuwaus

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:
image

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:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitieslanguages-basic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions