diff options
Diffstat (limited to 'clang-tools-extra/clangd/ClangdServer.cpp')
-rw-r--r-- | clang-tools-extra/clangd/ClangdServer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp index 142c62c9b28..10949ef001c 100644 --- a/clang-tools-extra/clangd/ClangdServer.cpp +++ b/clang-tools-extra/clangd/ClangdServer.cpp @@ -151,7 +151,10 @@ void ClangdServer::addDocument(PathRef File, llvm::StringRef Contents, Inputs.Contents = Contents; Inputs.Opts = std::move(Opts); Inputs.Index = Index; - WorkScheduler.update(File, Inputs, WantDiags); + bool NewFile = WorkScheduler.update(File, Inputs, WantDiags); + // If we loaded Foo.h, we want to make sure Foo.cpp is indexed. + if (NewFile && BackgroundIdx) + BackgroundIdx->boostRelated(File); } void ClangdServer::removeDocument(PathRef File) { WorkScheduler.remove(File); } |