diff --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp --- a/clang-tools-extra/clangd/TUScheduler.cpp +++ b/clang-tools-extra/clangd/TUScheduler.cpp @@ -795,7 +795,7 @@ // FIXME: It might be better to not reuse this AST. That way queued AST builds // won't be required for diags. llvm::Optional> AST = IdleASTs.take(this); - if (!AST) { + if (!AST || !InputsAreLatest) { auto RebuildStartTime = DebouncePolicy::clock::now(); llvm::Optional NewAST = buildAST( FileName, std::move(Invocation), CIDiags, Inputs, LatestPreamble);