microsoft / microsoft/monaco-editor

TS regex missed by Monarch grammar

Open
#2,512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug grammars help wanted typescript
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Extracted from https://github.com/microsoft/TypeScript-Website/issues/1870

const x = true ? /^([^"]*)"/ : /^([^']*)'/

/^([^"]*)"/ is not identified as a regex by the TS Monarch grammar, which breaks bracket matching:

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/typescript/typescript.ts at the Monarch grammar location linked near line 76, then reproduce the conditional-expression example from the issue in Monaco. Trace why the double-quoted regex is not recognized and verify that both regex branches are identified correctly and bracket matching works afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.