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