Skip to content

Commit 5ffcb80

Browse files
committed
move call to get fallback time
1 parent 3ea8009 commit 5ffcb80

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Extension/src/LanguageServer/configurations.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,6 @@ export class CppProperties {
23302330
return;
23312331
}
23322332
const compileCommandsFile: string | undefined = this.resolvePath(compileCommands);
2333-
const compileCommandsLastChanged: Date | undefined = this.compileCommandsFileWatcherFallbackTime.get(compileCommandsFile);
23342333
fs.stat(compileCommandsFile, (err, stats) => {
23352334
if (err) {
23362335
if (err.code === "ENOENT" && this.compileCommandsFile) {
@@ -2339,10 +2338,13 @@ export class CppProperties {
23392338
this.onCompileCommandsChanged(compileCommandsFile);
23402339
this.compileCommandsFile = null; // File deleted
23412340
}
2342-
} else if (compileCommandsLastChanged !== undefined && stats.mtime > compileCommandsLastChanged) {
2343-
this.compileCommandsFileWatcherFallbackTime.set(compileCommandsFile, new Date());
2344-
this.onCompileCommandsChanged(compileCommandsFile);
2345-
this.compileCommandsFile = vscode.Uri.file(compileCommandsFile); // File created.
2341+
} else {
2342+
const compileCommandsLastChanged: Date | undefined = this.compileCommandsFileWatcherFallbackTime.get(compileCommandsFile);
2343+
if (compileCommandsLastChanged !== undefined && stats.mtime > compileCommandsLastChanged) {
2344+
this.compileCommandsFileWatcherFallbackTime.set(compileCommandsFile, new Date());
2345+
this.onCompileCommandsChanged(compileCommandsFile);
2346+
this.compileCommandsFile = vscode.Uri.file(compileCommandsFile); // File created.
2347+
}
23462348
}
23472349
});
23482350
}

0 commit comments

Comments
 (0)