@@ -13,7 +13,7 @@ use crate::{
1313} ;
1414use client_config:: get_client_config;
1515pub use client_config:: ClientConfig ;
16- use code_analysis:: { uri_to_file_path, EmmyLuaAnalysis , Emmyrc , FileId } ;
16+ use code_analysis:: { uri_to_file_path, EmmyLuaAnalysis , Emmyrc , FileId , Profile } ;
1717use codestyle:: load_editorconfig;
1818use collect_files:: collect_files;
1919use log:: info;
@@ -147,17 +147,21 @@ pub async fn init_analysis(
147147 }
148148
149149 let mut count = 0 ;
150- while let Some ( _) = rx. recv ( ) . await {
151- count += 1 ;
152-
153- if client_id. is_vscode ( ) {
154- status_bar. report_progress (
155- format ! ( "diagnostic {}/{}" , count, file_count) . as_str ( ) ,
156- 0.75 ,
157- ) ;
158- }
159- if count == file_count {
160- break ;
150+ if file_count != 0 {
151+ let text= format ! ( "diagnose {} files" , file_count) ;
152+ let _p = Profile :: new ( text. as_str ( ) ) ;
153+ while let Some ( _) = rx. recv ( ) . await {
154+ count += 1 ;
155+
156+ if client_id. is_vscode ( ) {
157+ status_bar. report_progress (
158+ format ! ( "diagnostic {}/{}" , count, file_count) . as_str ( ) ,
159+ 0.75 ,
160+ ) ;
161+ }
162+ if count == file_count {
163+ break ;
164+ }
161165 }
162166 }
163167
0 commit comments