Skip to content

Commit 17e7f0c

Browse files
authored
Merge pull request #21709 from Wilfred/race_condition_flycheck_workspaces
fix: Incorrect flychecks with multiple workspaces
2 parents 29a0c1e + 2b438d7 commit 17e7f0c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

crates/rust-analyzer/src/flycheck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ impl JsonLinesParser<CheckMessage> for CheckParser {
10211021
}
10221022
}
10231023

1024-
#[derive(Deserialize)]
1024+
#[derive(Deserialize, Debug)]
10251025
#[serde(untagged)]
10261026
enum JsonMessage {
10271027
Cargo(cargo_metadata::Message),

crates/rust-analyzer/src/handlers/notification.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,9 @@ pub(crate) fn handle_did_change_watched_files(
295295
for change in params.changes.iter().unique_by(|&it| &it.uri) {
296296
if let Ok(path) = from_proto::abs_path(&change.uri) {
297297
if !trigger_flycheck {
298+
// Trigger if no workspaces contain this file.
298299
trigger_flycheck =
299-
state.config.workspace_roots().iter().any(|root| !path.starts_with(root));
300+
state.config.workspace_roots().iter().all(|root| !path.starts_with(root));
300301
}
301302
state.loader.handle.invalidate(path);
302303
}

0 commit comments

Comments
 (0)