Skip to content

Commit c601adf

Browse files
committed
Rust: add ExtractionStep::CrateGraph
1 parent 98a4096 commit c601adf

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

rust/extractor/src/diagnostics.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ pub enum ExtractionStepKind {
8383
LoadSource,
8484
Parse,
8585
Extract,
86+
CrateGraph,
8687
}
8788

8889
#[derive(Debug, Clone, Serialize)]
@@ -128,6 +129,10 @@ impl ExtractionStep {
128129
)
129130
}
130131

132+
pub fn crate_graph(start: Instant) -> Self {
133+
Self::new(start, ExtractionStepKind::CrateGraph, None)
134+
}
135+
131136
pub fn load_source(start: Instant, target: &Path) -> Self {
132137
Self::new(
133138
start,

rust/extractor/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,11 @@ fn main() -> anyhow::Result<()> {
244244
if let Some((ref db, ref vfs)) =
245245
extractor.load_manifest(manifest, &cargo_config, &load_cargo_config)
246246
{
247+
let before_crate_graph = Instant::now();
247248
crate_graph::extract_crate_graph(extractor.traps, db, vfs);
249+
extractor
250+
.steps
251+
.push(ExtractionStep::crate_graph(before_crate_graph));
248252
let semantics = Semantics::new(db);
249253
for file in files {
250254
match extractor.load_source(file, &semantics, vfs) {

rust/ql/test/query-tests/diagnostics/SummaryStats.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| Elements extracted | 405 |
1+
| Elements extracted | 406 |
22
| Elements unextracted | 0 |
33
| Extraction errors | 0 |
44
| Extraction warnings | 7 |

0 commit comments

Comments
 (0)