Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions crates/rust-analyzer/src/handlers/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,21 @@ fn run_flycheck(state: &mut GlobalState, vfs_path: VfsPath) -> bool {
} => false,
});
if let Some(idx) = package_workspace_idx {
let workspace_deps =
world.all_workspace_dependencies_for_package(&package);
world.flycheck[idx].restart_for_package(
package,
target,
workspace_deps,
saved_file.clone(),
);
// flycheck handles are indexed by their ID (which is the workspace index),
// but not all workspaces have flycheck enabled (e.g., JSON projects without
// a flycheck template). Find the flycheck handle by its ID.
if let Some(flycheck) =
world.flycheck.iter().find(|fc| fc.id() == idx)
{
let workspace_deps =
world.all_workspace_dependencies_for_package(&package);
flycheck.restart_for_package(
package,
target,
workspace_deps,
saved_file.clone(),
);
}
}
}
}
Expand Down