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 @@ -894,6 +894,14 @@ FileInputs = Inputs; } + if (isCancelled()) { + log("ASTWorker skipping update {0} for file {1}", Inputs.Version, + FileName); + // Don't even emplace a preamble, as we still want the first valid update + // to block any further reads. + return; + } + log("ASTWorker building file {0} version {1} with command {2}\n[{3}]\n{4}", FileName, Inputs.Version, Inputs.CompileCommand.Heuristic, Inputs.CompileCommand.Directory,