rust-lang / rust-lang/rust-analyzer
Highlighted errors don't move with text when file is edited
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
When I modify a file in VS Code containing errors from cargo check, the red squiggly lines often don't move with the text. Instead they remain in the very row and column where they were when the file was last saved.

After pressing Enter:

The behavior is somewhat unpredictable. For instance, if I open a project where a file is already opened from the previous session, this bug does not appear in this file, until it is closed and re-opened again.
P.S. I use VSCodium on Manjaro/KDE.
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 issue in VSCodium with a Rust project and cargo check, then compare diagnostic positions after inserting text and reopening the file. Done means the red squiggly lines remain aligned with the corresponding text after edits; the issue names no source file or test to inspect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100