|
8 | 8 | use clap::Args;
|
9 | 9 | use clap::ValueHint;
|
10 | 10 | use stack_graphs::serde::NoFilter;
|
| 11 | +use stack_graphs::stitching::Database; |
11 | 12 | use stack_graphs::storage::SQLiteReader;
|
| 13 | +use stack_graphs::NoCancellation; |
12 | 14 | use std::path::Path;
|
13 | 15 | use std::path::PathBuf;
|
14 | 16 |
|
@@ -41,8 +43,18 @@ impl VisualizeArgs {
|
41 | 43 | let source_path = source_path.canonicalize()?;
|
42 | 44 | db.load_graph_for_file_or_directory(&source_path)?;
|
43 | 45 | }
|
44 |
| - let (graph, partials, db) = db.get(); |
45 |
| - let html = graph.to_html_string("stack-graph", partials, db, &NoFilter)?; |
| 46 | + let (graph, _, _) = db.get(); |
| 47 | + let starting_nodes = graph |
| 48 | + .iter_nodes() |
| 49 | + .filter(|n| graph[*n].is_reference()) |
| 50 | + .collect::<Vec<_>>(); |
| 51 | + let mut complete_paths_db = Database::new(); |
| 52 | + db.find_all_complete_partial_paths(starting_nodes, &NoCancellation, |g, ps, p| { |
| 53 | + complete_paths_db.add_partial_path(g, ps, p.clone()); |
| 54 | + })?; |
| 55 | + let (graph, partials, _) = db.get(); |
| 56 | + let html = |
| 57 | + graph.to_html_string("stack-graph", partials, &mut complete_paths_db, &NoFilter)?; |
46 | 58 | if let Some(dir) = self.output.parent() {
|
47 | 59 | std::fs::create_dir_all(dir)?;
|
48 | 60 | }
|
|
0 commit comments