Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fhammerschmidt committed Oct 24, 2024
1 parent 5705458 commit f695999
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,21 @@ let compilerLogsWatcher = chokidar
},
})
.on("all", (_e, changedPath) => {
console.log("changes in path: ", changedPath);
if (changedPath.includes("build.ninja")) {
console.log("Changed path includes build ninja");
if (
config.extensionConfiguration.cache?.projectConfig?.enabled === true
) {
let projectRoot = utils.findProjectRootOfFile(changedPath);
if (projectRoot != null) {
console.log("Sync project config cache");
syncProjectConfigCache(projectRoot);
}
}
} else {
try {
console.log("Send updated diagnostics");
sendUpdatedDiagnostics();
sendCompilationFinishedMessage();
if (config.extensionConfiguration.inlayHints?.enable === true) {
Expand All @@ -236,12 +240,13 @@ let compilerLogsWatcher = chokidar
if (config.extensionConfiguration.codeLens === true) {
sendCodeLensRefresh();
}
} catch {
console.log("Error while sending updated diagnostics");
} catch (error) {
console.log("Error while sending updated diagnostics", error);
}
}
});
let stopWatchingCompilerLog = () => {
console.log("Stop watching compiler log");
// TODO: cleanup of compilerLogs?
compilerLogsWatcher.close();
};
Expand Down

0 comments on commit f695999

Please sign in to comment.