File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
crates/emmylua_ls/src/handlers/initialized Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -150,18 +150,18 @@ pub async fn init_analysis(
150150 ) ;
151151
152152 // load files
153- let files = collect_files ( & workspace_folders, & emmyrc) ;
154- let files : Vec < ( PathBuf , Option < String > ) > =
155- files . into_iter ( ) . map ( |file| file . into_tuple ( ) ) . collect ( ) ;
156- let file_count = files. len ( ) ;
157- if file_count != 0 {
158- status_bar. update_progress_task (
159- ProgressTask :: LoadWorkspace ,
160- None ,
161- Some ( format ! ( "Indexing {} files" , file_count) ) ,
162- ) ;
163-
164- mut_analysis . update_files_by_path ( files ) ;
153+ let files: Vec < emmylua_code_analysis :: LuaFileInfo > = collect_files ( & workspace_folders, & emmyrc) ;
154+ let file_count = files . len ( ) as u32 ;
155+ if file_count > 0 {
156+ files. into_iter ( ) . enumerate ( ) . for_each ( | ( index , file ) | {
157+ let ( path , text ) = file . into_tuple ( ) ;
158+ status_bar. update_progress_task (
159+ ProgressTask :: LoadWorkspace ,
160+ Some ( ( index as u32 ) * 100 / file_count ) ,
161+ Some ( format ! ( "Indexing {} files" , file_count) ) ,
162+ ) ;
163+ mut_analysis . update_file_by_path ( & path , text ) ;
164+ } ) ;
165165 }
166166
167167 status_bar. update_progress_task (
You can’t perform that action at this time.
0 commit comments