@@ -92,8 +92,9 @@ let getCurrentCompilerDiagnosticsForFile = (
92
92
93
93
return diagnostics ?? [ ] ;
94
94
} ;
95
- let sendUpdatedDiagnostics = ( ) => {
96
- projectsFiles . forEach ( ( projectFile , projectRootPath ) => {
95
+
96
+ let sendUpdatedDiagnostics = async ( ) => {
97
+ for ( const [ projectRootPath , projectFile ] of projectsFiles ) {
97
98
let { filesWithDiagnostics } = projectFile ;
98
99
let compilerLogPath = path . join ( projectRootPath , c . compilerLogPartialPath ) ;
99
100
let content = fs . readFileSync ( compilerLogPath , { encoding : "utf-8" } ) ;
@@ -154,8 +155,9 @@ let sendUpdatedDiagnostics = () => {
154
155
}
155
156
} ) ;
156
157
}
157
- } ) ;
158
+ }
158
159
} ;
160
+
159
161
let deleteProjectDiagnostics = ( projectRootPath : string ) => {
160
162
let root = projectsFiles . get ( projectRootPath ) ;
161
163
if ( root != null ) {
@@ -178,6 +180,7 @@ let deleteProjectDiagnostics = (projectRootPath: string) => {
178
180
}
179
181
}
180
182
} ;
183
+
181
184
let sendCompilationFinishedMessage = ( ) => {
182
185
let notification : p . NotificationMessage = {
183
186
jsonrpc : c . jsonrpcVersion ,
@@ -215,7 +218,7 @@ let compilerLogsWatcher = chokidar
215
218
stabilityThreshold : 1 ,
216
219
} ,
217
220
} )
218
- . on ( "all" , ( _e , changedPath ) => {
221
+ . on ( "all" , async ( _e , changedPath ) => {
219
222
if ( changedPath . includes ( "build.ninja" ) ) {
220
223
if ( config . extensionConfiguration . cache ?. projectConfig ?. enable === true ) {
221
224
let projectRoot = utils . findProjectRootOfFile ( changedPath ) ;
@@ -225,7 +228,7 @@ let compilerLogsWatcher = chokidar
225
228
}
226
229
} else {
227
230
try {
228
- sendUpdatedDiagnostics ( ) ;
231
+ await sendUpdatedDiagnostics ( ) ;
229
232
sendCompilationFinishedMessage ( ) ;
230
233
if ( config . extensionConfiguration . inlayHints ?. enable === true ) {
231
234
sendInlayHintsRefresh ( ) ;
0 commit comments