Preserve opening-delimiter spans for unclosed syntax
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
Tracked by #346.
## Problem
Unclosed function blocks, parameter lists, grouped expressions, array literals, and struct literals commonly reach EOF and are reported at the start of the containing function. The diagnostic should retain the opening delimiter that needs a match.
## Scope
Start with one shared delimiter diagnostic path and cover at least:
- An unclosed function or nested block `{`.
- An unclosed parameter or call list `(`.
- An unclosed array literal `[`.
The diagnostic should identify the unmatched opening token and state which closing token was expected.
## Completion criteria
- [ ] The primary or related span identifies the unmatched opening delimiter.
- [ ] The expected closing delimiter is explicit.
- [ ] Nested delimiters report the innermost unmatched opening token.
- [ ] Human and JSON diagnostics remain consistent.
- [ ] Valid nested delimiters continue to parse.
Contributor guide
Research direction
Locate the shared delimiter diagnostic path and trace how it produces both human and JSON diagnostics. Exercise unclosed blocks, parameter or call lists, and array literals, including nesting; done means the innermost opening token and expected closer are reported consistently while valid nesting still parses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100