This revision was automatically updated to reflect the committed changes. Closed by commit rL322199: [clangd] Pass Context to onDiagnosticsReady callback (authored by ibiryukov, committed by ). Herald added a subscriber: llvm-commits.
Repository: rL LLVM https://reviews.llvm.org/D41907 Files: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp clang-tools-extra/trunk/clangd/ClangdLSPServer.h clang-tools-extra/trunk/clangd/ClangdServer.cpp clang-tools-extra/trunk/clangd/ClangdServer.h clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp
Index: clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp +++ clang-tools-extra/trunk/unittests/clangd/ClangdTests.cpp @@ -49,7 +49,7 @@ class ErrorCheckingDiagConsumer : public DiagnosticsConsumer { public: void - onDiagnosticsReady(PathRef File, + onDiagnosticsReady(const Context &Ctx, PathRef File, Tagged<std::vector<DiagWithFixIts>> Diagnostics) override { bool HadError = diagsContainErrors(Diagnostics.Value); @@ -470,7 +470,7 @@ TestDiagConsumer() : Stats(FilesCount, FileStat()) {} void onDiagnosticsReady( - PathRef File, + const Context &Ctx, PathRef File, Tagged<std::vector<DiagWithFixIts>> Diagnostics) override { StringRef FileIndexStr = llvm::sys::path::stem(File); ASSERT_TRUE(FileIndexStr.consume_front("Foo")); @@ -758,7 +758,7 @@ : StartSecondReparse(std::move(StartSecondReparse)) {} void onDiagnosticsReady( - PathRef File, + const Context &Ctx, PathRef File, Tagged<std::vector<DiagWithFixIts>> Diagnostics) override { std::unique_lock<std::mutex> Lock(Mutex, std::try_to_lock_t()); Index: clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp =================================================================== --- clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp +++ clang-tools-extra/trunk/unittests/clangd/CodeCompleteTests.cpp @@ -59,8 +59,10 @@ using ::testing::Not; class IgnoreDiagnostics : public DiagnosticsConsumer { - void onDiagnosticsReady( - PathRef File, Tagged<std::vector<DiagWithFixIts>> Diagnostics) override {} + void + onDiagnosticsReady(const Context &Ctx, PathRef File, + Tagged<std::vector<DiagWithFixIts>> Diagnostics) override { + } }; // GMock helpers for matching completion items. Index: clang-tools-extra/trunk/clangd/ClangdLSPServer.h =================================================================== --- clang-tools-extra/trunk/clangd/ClangdLSPServer.h +++ clang-tools-extra/trunk/clangd/ClangdLSPServer.h @@ -50,7 +50,7 @@ private: // Implement DiagnosticsConsumer. virtual void - onDiagnosticsReady(PathRef File, + onDiagnosticsReady(const Context &Ctx, PathRef File, Tagged<std::vector<DiagWithFixIts>> Diagnostics) override; // Implement ProtocolCallbacks. Index: clang-tools-extra/trunk/clangd/ClangdServer.h =================================================================== --- clang-tools-extra/trunk/clangd/ClangdServer.h +++ clang-tools-extra/trunk/clangd/ClangdServer.h @@ -72,7 +72,7 @@ /// Called by ClangdServer when \p Diagnostics for \p File are ready. virtual void - onDiagnosticsReady(PathRef File, + onDiagnosticsReady(const Context &Ctx, PathRef File, Tagged<std::vector<DiagWithFixIts>> Diagnostics) = 0; }; Index: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp =================================================================== --- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp +++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp @@ -325,7 +325,8 @@ } void ClangdLSPServer::onDiagnosticsReady( - PathRef File, Tagged<std::vector<DiagWithFixIts>> Diagnostics) { + const Context &Ctx, PathRef File, + Tagged<std::vector<DiagWithFixIts>> Diagnostics) { json::ary DiagnosticsJSON; DiagnosticToReplacementMap LocalFixIts; // Temporary storage Index: clang-tools-extra/trunk/clangd/ClangdServer.cpp =================================================================== --- clang-tools-extra/trunk/clangd/ClangdServer.cpp +++ clang-tools-extra/trunk/clangd/ClangdServer.cpp @@ -586,7 +586,7 @@ return; LastReportedDiagsVersion = Version; - DiagConsumer.onDiagnosticsReady(FileStr, + DiagConsumer.onDiagnosticsReady(Ctx, FileStr, make_tagged(std::move(*Diags), Tag)); };
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits