Skip to content

Flycheck diagnostics should be triggered by changes to the project files that were not triggered by the client #22359

@osiewicz

Description

@osiewicz

Rust Analyzer does not seem to trigger flycheck without user saving (even if the state of the files on disk did change), which leads to stale rustc diagnostics.

rust-analyzer version:

rust-analyzer version: 0.3.2896-standalone (e266f5cab8 2026-05-10) [/Users/hiro/.vscode/extensions/rust-lang.rust-analyzer-0.3.2896-darwin-arm64/server/rust-analyzer]

rustc version: rustc 1.95.0 (59807616e 2026-04-14)

editor or extension: VSC and Zed (I don't believe version is relevant here)

relevant settings: N/A

code snippet to reproduce:
Start with following code in git repo (committed):

fn food() {}
fn main() {
  food();
}

Introduce an error and save (without committing):

fn food() {}
fn main() {
  food(1);
}

Result: 2 diagnostics ✅
Now, run a git restore .:

fn food() {}
fn main() {
  food();
}

Result: 1 outstanding rustc diagnostic ❌
Expected result: No diagnostics

In this scenario, RA does not witness any didSaves after git restore which means that flycheck is never triggered. However, it could trigger it after a brief debounce or what have you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions