Rust: add ExtractionStep::CrateGraph

This commit is contained in:
Arthur Baars
2025-02-13 18:11:01 +01:00
parent 98a40967d2
commit c601adfc65
3 changed files with 10 additions and 1 deletions

View File

@@ -83,6 +83,7 @@ pub enum ExtractionStepKind {
LoadSource,
Parse,
Extract,
CrateGraph,
}
#[derive(Debug, Clone, Serialize)]
@@ -128,6 +129,10 @@ impl ExtractionStep {
)
}
pub fn crate_graph(start: Instant) -> Self {
Self::new(start, ExtractionStepKind::CrateGraph, None)
}
pub fn load_source(start: Instant, target: &Path) -> Self {
Self::new(
start,

View File

@@ -244,7 +244,11 @@ fn main() -> anyhow::Result<()> {
if let Some((ref db, ref vfs)) =
extractor.load_manifest(manifest, &cargo_config, &load_cargo_config)
{
let before_crate_graph = Instant::now();
crate_graph::extract_crate_graph(extractor.traps, db, vfs);
extractor
.steps
.push(ExtractionStep::crate_graph(before_crate_graph));
let semantics = Semantics::new(db);
for file in files {
match extractor.load_source(file, &semantics, vfs) {

View File

@@ -1,4 +1,4 @@
| Elements extracted | 405 |
| Elements extracted | 406 |
| Elements unextracted | 0 |
| Extraction errors | 0 |
| Extraction warnings | 7 |