rust-lang / rust-lang/rust-analyzer
syntax error spans underline lots of code
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Haven't spent time minimizing, but I imagine it wouldn't be too hard.
When confronted with a syntax error, e.g., when rebasing with conflict markers, I currently see my whole editor light up with underlines and suggestions:

While it's definitely true that this code has syntax errors, this isn't particularly helpful -- maybe we can do something to avoid this? At least detecting conflict markers and skipping those lines entirely as a heuristic for parsing seems like an excellent step (ideally with some kind of post-hoc recovery re-starting the parse from the right place, but that seems like a stretch).
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
Reproduce the issue in the editor with a Rust file containing merge-conflict markers and observe how syntax-error underlines and suggestions spread through the file. Investigate the parsing and diagnostic behavior around those markers; done means syntax errors no longer produce broadly misleading diagnostics while genuine errors remain reported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100