Файли
openidea/crates/ide-sdk
Deng Liuтаdengliu 7ba1acc0cf perf(sdk): cache library probes with watcher-driven invalidation (#8142)
Refreshing External Libraries on multi-repository workspaces kept re-running the same probes: `cargo locate-project --workspace` and failing offline `cargo metadata` for every crate, and an uncancellable `has_java_sources` walk through non-ignored dependency trees.

- `cargo locate-project` results are cached per (dir, cargo), validated against the cargo binary and every ancestor Cargo.toml.
- Failed offline `cargo metadata` and `has_java_sources` results are cached only for paths under a project root with a healthy watcher. Watcher batches drop them on `.java` changes, new directories, removals, Cargo manifest or `.cargo/config` changes, and ignore/exclude changes, before the scan epoch is bumped; hitting the watch limit clears them. Timeouts and cancellations are never cached, and nothing expires by time.
- `has_java_sources` honours cancellation and skips dependency/build directories, and still checks the project's source roots for every root, so results are unchanged. `python_groups` honours cancellation.

Co-authored-by: dengliu <[email protected]>
2026-12-05 14:40:15 +08:00
..