microsoft / microsoft/TypeScript
Report candidates on closing list terminators
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
From @robpalme: https://twitter.com/robpalmer2/status/1190383568612184064
function base_init() {
{
}
function me() {
}
Motivation
When an ending curly brace (or similar) is missing, we can give some better hints to the user.
In some cases, this might be because a stray } throws parsing off.
Suggestion
It would be very cool to explain a possible reason that the user is getting a '}' expected error:
} ~ This '}' occurs at the same indentation level, but corresponds to a different brace.
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 by reproducing the example in the linked TypeScript Playground and inspect the resulting '}' expected diagnostic. Determine how closing-list terminators are identified and how an indentation-level mismatch could be reported. Done means the example produces the suggested hint without degrading other brace-parsing diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100