@@ -15,6 +15,7 @@ use dt_core::{
1515 route:: { collect_route_dependency, Route , SymbolToRoutes } ,
1616 scheduler:: ParserCandidateScheduler ,
1717} ;
18+ use indicatif:: { ProgressBar , ProgressStyle } ;
1819use std:: {
1920 collections:: { HashMap , HashSet } ,
2021 fs:: File ,
@@ -156,6 +157,13 @@ fn parse_and_export_project_to_database(
156157 . context ( "add translation to project" ) ?;
157158
158159 let mut scheduler = ParserCandidateScheduler :: new ( & project_root) ;
160+ let bar = ProgressBar :: new ( scheduler. get_total_remaining_candidate_count ( ) as u64 ) ;
161+ bar. set_style (
162+ ProgressStyle :: with_template (
163+ "[{elapsed_precise}] {bar:40.cyan/blue} {pos:>7}/{len:7} {msg}" ,
164+ ) ?
165+ . progress_chars ( "##-" ) ,
166+ ) ;
159167 loop {
160168 match scheduler. get_one_candidate ( ) {
161169 Some ( c) => {
@@ -198,11 +206,12 @@ fn parse_and_export_project_to_database(
198206 ) ) ?;
199207
200208 scheduler. mark_candidate_as_parsed ( c) ;
209+ bar. inc ( 1 ) ;
201210 }
202211 None => break ,
203212 }
204213 }
205-
214+ bar . finish_with_message ( "all modules parsed 🌲" ) ;
206215 Ok ( ( ) )
207216}
208217
@@ -562,7 +571,8 @@ impl Project {
562571 ) ) ?;
563572 }
564573 Err ( _) => {
565- println ! ( "try to add translation for symbol {}, but translation {} doesn't exist" , symbol_name, key) ;
574+ // you can uncomment this to debug
575+ // println!("try to add translation for symbol {}, but translation {} doesn't exist", symbol_name, key);
566576 }
567577 }
568578 }
0 commit comments