Skip to content

Commit d04d53e

Browse files
authored
Detect compile_commands.json after containing folder deleted and recreated on Windows (#13032)
* fix issue #7030 * check for the undefined case (on first load)
1 parent fa80d44 commit d04d53e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Extension/src/LanguageServer/configurations.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2340,7 +2340,9 @@ export class CppProperties {
23402340
}
23412341
} else {
23422342
const compileCommandsLastChanged: Date | undefined = this.compileCommandsFileWatcherFallbackTime.get(compileCommandsFile);
2343-
if (compileCommandsLastChanged !== undefined && stats.mtime > compileCommandsLastChanged) {
2343+
if ((this.compileCommandsFile === undefined) ||
2344+
(this.compileCommandsFile === null) ||
2345+
(compileCommandsLastChanged !== undefined && stats.mtime > compileCommandsLastChanged)) {
23442346
this.compileCommandsFileWatcherFallbackTime.set(compileCommandsFile, new Date());
23452347
this.onCompileCommandsChanged(compileCommandsFile);
23462348
this.compileCommandsFile = vscode.Uri.file(compileCommandsFile); // File created.

0 commit comments

Comments
 (0)