rust-lang / rust-lang/rust-analyzer

Highlighted errors don't move with text when file is edited

Open
#4,056 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-vscode C-bug S-unactionable
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.

Screenshot_20200420_145352
After pressing Enter:
Screenshot_20200420_145424

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

Open the contributing guide

First steps

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.