microsoft / microsoft/monaco-editor
TS regex missed by Monarch grammar
Open
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:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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