rust-lang / rust-lang/rust-analyzer

Delay in synchronization between data sources after changes are made across buffers

Open
#22,288 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: rust-analyzer 1.94.0-nightly (e29fcf4 2026-01-04)

rustc version: rustc 1.94.0-nightly (e29fcf45e 2026-01-04)

editor or extension: neovim NVIM v0.12.0-dev-1574+g8d6963a6a0

relevant settings: N/A

repository link (if public, optional): N/A

code snippet to reproduce:

In any large codebase, I often run into an issue where one part of rust-analyzer seems to become quickly aware of changes I make while other parts (such as diagnostics and inlay hints) seem to lag behind considerably.

In this example, I updated the trait implementation for Dataset such that the operation in question would return id: i32 but diagnostics continues to show an error for some time (as in minutes, until more changes are made elsewhere, even after saving all files) and inlay hints continue to show the same stale data that is causing the incorrect diagnostics errors, but using the LSP hover action I can see that rust-analyzer is aware of the changes.

In the screenshot below you can see neovim lsp client's hover window displaying the correct updated return type of i32, but diagnostics errors and type inlays are both insisting that it's still the old i16 value:

Image

I'm not sure of the exact repro steps other than it happens fairly often and seems to persist indefinitely until sufficient changes are made to the codebase. For example, I left the editor open (after a :wa to save all changes to disk) while I composed this bug report and just checked back on it to find the stale information and incorrect diagnostics still present. Using :e to reload the buffer shows the correct information, so I am not entirely certain whether this is a neovim LSP implementation bug or a rust-analyzer bug, as I'm presuming RA is supposed to be able to update its state automatically without needing to reload the buffer for this to work.

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

There are no exact reproduction steps, named source files, or tests in the report. Start by reproducing the stale diagnostics and inlay hints in Neovim after saving, then compare them with hover results and a buffer reload to determine whether the stale state is in rust-analyzer or the LSP client. Done means changes propagate consistently without reloading the buffer, with a reliable regression case if one can be isolated.

Written by the indexing model from the issue text.

Assessment

Tech stack
neovim, rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.