Whether the Rust diagnostics build is "cold" — i.e. the private cargo target dir does not exist yet or is effectively empty. The first `cargo check` against a cold tree builds every dependency from scratch and can block for minutes on a large workspace; the MCP layer uses this to offer a non-blocking prewarm instead of freezing the agent. Returns `false` for projects without a `Cargo.toml` (nothi
(project_root: &Path)
| 105 | /// Returns `false` for projects without a `Cargo.toml` (nothing to warm) and |
| 106 | /// once the target dir has any build artifacts (subsequent checks are fast). |
| 107 | pub fn is_rust_diagnostics_cold(project_root: &Path) -> bool { |
| 108 | if !project_root.join("Cargo.toml").exists() { |
| 109 | return false; |
| 110 | } |
| 111 | let target_dir = rust::target_dir_for(project_root); |
| 112 | dir_is_missing_or_empty(&target_dir) |
| 113 | } |
| 114 | |
| 115 | /// True when `path` does not exist, is not a directory, or contains no |
| 116 | /// entries. Any read error is treated as "cold" so we err toward prewarming |
no test coverage detected