diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index 6f23eb347..028cc7235 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -2340,7 +2340,9 @@ export class CppProperties { } } else { const compileCommandsLastChanged: Date | undefined = this.compileCommandsFileWatcherFallbackTime.get(compileCommandsFile); - if (compileCommandsLastChanged !== undefined && stats.mtime > compileCommandsLastChanged) { + if ((this.compileCommandsFile === undefined) || + (this.compileCommandsFile === null) || + (compileCommandsLastChanged !== undefined && stats.mtime > compileCommandsLastChanged)) { this.compileCommandsFileWatcherFallbackTime.set(compileCommandsFile, new Date()); this.onCompileCommandsChanged(compileCommandsFile); this.compileCommandsFile = vscode.Uri.file(compileCommandsFile); // File created.