Skip to content

ECMAScript syntax: Comment affecting semantics of RegExp #750

Closed
@SMotaal

Description

@SMotaal
  • VSCode Version: Version 1.33.1 (1.33.1)
  • OS Version: macOS 10.14.4 (18E226)

Steps to Reproduce:

The following is contrived to show this particular case.

/* prettier-ignore */
const dummy  = (div, g) => {
  ( []              /([(div)])/g / [] );
  ( ([])            /([(div)])/g / [] );
  ( [] /* */        /([(div)])/g / [] );
};
  1. Paste this code into a new javascript file
  2. Ignore any type-specific errors (because it is still valid ES syntax)
  3. Note the last statement highlights as RegExp but still tokenizes correctly by tsserver.

Does this issue occur when all extensions are disabled?: Not tested

Metadata

Metadata

Assignees

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