@@ -15,7 +15,9 @@ use ra_ap_project_model::{CargoConfig, ProjectManifest};
1515use ra_ap_vfs:: Vfs ;
1616use rust_analyzer:: { ParseResult , RustAnalyzer } ;
1717use std:: collections:: HashSet ;
18+ use std:: fs:: File ;
1819use std:: hash:: RandomState ;
20+ use std:: io:: { self , BufRead , BufReader } ;
1921use std:: time:: Instant ;
2022use std:: {
2123 collections:: HashMap ,
@@ -212,10 +214,20 @@ fn cwd() -> anyhow::Result<AbsPathBuf> {
212214}
213215
214216fn main ( ) -> anyhow:: Result < ( ) > {
215- let mut cfg = config:: Config :: extract ( ) . context ( "failed to load configuration" ) ?;
216- if cfg. qltest {
217- qltest:: prepare ( & mut cfg) ?;
218- }
217+ let cfg = config:: Config :: extract ( ) . context ( "failed to load configuration" ) ?;
218+ let inputs = if cfg. qltest {
219+ qltest:: prepare ( & cfg) ?
220+ } else if let Some ( path) = & cfg. file_list {
221+ let file =
222+ File :: open ( path) . with_context ( || format ! ( "opening file list {}" , path. display( ) ) ) ?;
223+ BufReader :: new ( file)
224+ . lines ( )
225+ . map ( |line| line. map ( PathBuf :: from) )
226+ . collect :: < io:: Result < Vec < _ > > > ( )
227+ . with_context ( || format ! ( "reading file list {}" , path. display( ) ) ) ?
228+ } else {
229+ Vec :: new ( )
230+ } ;
219231 let start = Instant :: now ( ) ;
220232 let ( flame_layer, _flush_guard) = if let Some ( path) = & cfg. logging_flamegraph {
221233 tracing_flame:: FlameLayer :: with_file ( path)
@@ -240,8 +252,7 @@ fn main() -> anyhow::Result<()> {
240252 root : cfg. source_archive_dir . clone ( ) ,
241253 } ;
242254 let mut extractor = Extractor :: new ( & archiver, & traps) ;
243- let files: Vec < PathBuf > = cfg
244- . inputs
255+ let files: Vec < PathBuf > = inputs
245256 . iter ( )
246257 . map ( |file| {
247258 let file = std:: path:: absolute ( file) . unwrap_or ( file. to_path_buf ( ) ) ;
0 commit comments