Skip to content

Regex on new line breaks js/ts highlighter #1024

@moritztim

Description

@moritztim

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version:
1.85.2
c8a36a69377856369f139f39ee56dd3838130fbf
x64
  • OS Version: n/a

Putting a regular expression on a new line in JavaScript or TypeScript breaks the highlighter.
Steps to Reproduce:

  1. paste this:
1
	/ f(/u/g)
function f(_: RegExp) {
	return 1;
}
  1. make sure the language mode is set to TypeScript
    Expected:
    Same highlighting as this:
    u replaced with e

Actual:
Highlighting is wrong after the first line.

Theme: @id:vscode.theme-defaults: Dark +

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