@@ -216,8 +216,8 @@ let compilerLogsWatcher = chokidar
216
216
stabilityThreshold : 1 ,
217
217
} ,
218
218
} )
219
- . on ( "all" , ( _e , changedPath ) => {
220
- console . log ( "changes in path: " , changedPath ) ;
219
+ . on ( "all" , ( eventName , changedPath , stats ) => {
220
+ console . log ( eventName , changedPath , stats ) ;
221
221
if ( changedPath . includes ( "build.ninja" ) ) {
222
222
if ( config . extensionConfiguration . cache ?. projectConfig ?. enable === true ) {
223
223
console . log ( "Changed path includes build ninja" ) ;
@@ -227,10 +227,32 @@ let compilerLogsWatcher = chokidar
227
227
syncProjectConfigCache ( projectRoot ) ;
228
228
}
229
229
}
230
+ } else if (
231
+ eventName === "unlink" &&
232
+ changedPath . includes ( ".compiler.log" )
233
+ ) {
234
+ console . log ( compilerLogsWatcher . getWatched ( ) ) ;
235
+ console . log ( ".compiler.log has been deleted" ) ;
236
+
237
+ let projectRoot = utils . findProjectRootOfFile ( changedPath ) ;
238
+ if ( projectRoot != null ) {
239
+ compilerLogsWatcher . add (
240
+ path . join ( projectRoot , c . compilerLogPartialPath )
241
+ ) ;
242
+ if (
243
+ config . extensionConfiguration . cache ?. projectConfig ?. enable === true
244
+ ) {
245
+ compilerLogsWatcher . add (
246
+ path . join ( projectRoot , c . buildNinjaPartialPath )
247
+ ) ;
248
+ syncProjectConfigCache ( projectRoot ) ;
249
+ }
250
+ }
230
251
} else {
231
252
try {
232
253
console . log ( "Send updated diagnostics" ) ;
233
254
sendUpdatedDiagnostics ( ) ;
255
+ console . log ( "Send compilation finished message" ) ;
234
256
sendCompilationFinishedMessage ( ) ;
235
257
if ( config . extensionConfiguration . inlayHints ?. enable === true ) {
236
258
sendInlayHintsRefresh ( ) ;
0 commit comments