Skip to content

Commit 8b584b3

Browse files
More logging
1 parent 062f94e commit 8b584b3

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

server/src/server.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ let compilerLogsWatcher = chokidar
216216
stabilityThreshold: 1,
217217
},
218218
})
219-
.on("all", (_e, changedPath) => {
220-
console.log("changes in path: ", changedPath);
219+
.on("all", (eventName, changedPath, stats) => {
220+
console.log(eventName, changedPath, stats);
221221
if (changedPath.includes("build.ninja")) {
222222
if (config.extensionConfiguration.cache?.projectConfig?.enable === true) {
223223
console.log("Changed path includes build ninja");
@@ -227,10 +227,32 @@ let compilerLogsWatcher = chokidar
227227
syncProjectConfigCache(projectRoot);
228228
}
229229
}
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+
}
230251
} else {
231252
try {
232253
console.log("Send updated diagnostics");
233254
sendUpdatedDiagnostics();
255+
console.log("Send compilation finished message");
234256
sendCompilationFinishedMessage();
235257
if (config.extensionConfiguration.inlayHints?.enable === true) {
236258
sendInlayHintsRefresh();

0 commit comments

Comments
 (0)