summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/ClangdLSPServer.cpp3
-rw-r--r--clang-tools-extra/clangd/ClangdLSPServer.h2
-rw-r--r--clang-tools-extra/clangd/ClangdServer.cpp2
-rw-r--r--clang-tools-extra/clangd/ClangdServer.h2
-rw-r--r--clang-tools-extra/unittests/clangd/ClangdTests.cpp6
-rw-r--r--clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp6
6 files changed, 12 insertions, 9 deletions
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index fd3093999d1..28280eab686 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -325,7 +325,8 @@ std::vector<TextEdit> ClangdLSPServer::getFixIts(StringRef File,
}
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
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.h b/clang-tools-extra/clangd/ClangdLSPServer.h
index f814e64b148..b833073c63b 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.h
+++ b/clang-tools-extra/clangd/ClangdLSPServer.h
@@ -50,7 +50,7 @@ public:
private:
// Implement DiagnosticsConsumer.
virtual void
- onDiagnosticsReady(PathRef File,
+ onDiagnosticsReady(const Context &Ctx, PathRef File,
Tagged<std::vector<DiagWithFixIts>> Diagnostics) override;
// Implement ProtocolCallbacks.
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp
index 0bf1c6d66e1..7cfed091a95 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -586,7 +586,7 @@ std::future<Context> ClangdServer::scheduleReparseAndDiags(
return;
LastReportedDiagsVersion = Version;
- DiagConsumer.onDiagnosticsReady(FileStr,
+ DiagConsumer.onDiagnosticsReady(Ctx, FileStr,
make_tagged(std::move(*Diags), Tag));
};
diff --git a/clang-tools-extra/clangd/ClangdServer.h b/clang-tools-extra/clangd/ClangdServer.h
index cab7e3de492..481e414496f 100644
--- a/clang-tools-extra/clangd/ClangdServer.h
+++ b/clang-tools-extra/clangd/ClangdServer.h
@@ -72,7 +72,7 @@ public:
/// 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;
};
diff --git a/clang-tools-extra/unittests/clangd/ClangdTests.cpp b/clang-tools-extra/unittests/clangd/ClangdTests.cpp
index ada661cb3b6..c532564802c 100644
--- a/clang-tools-extra/unittests/clangd/ClangdTests.cpp
+++ b/clang-tools-extra/unittests/clangd/ClangdTests.cpp
@@ -49,7 +49,7 @@ static bool diagsContainErrors(ArrayRef<DiagWithFixIts> Diagnostics) {
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 @@ int d;
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 @@ TEST_F(ClangdThreadingTest, NoConcurrentDiagnostics) {
: 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());
diff --git a/clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp b/clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp
index 497263959e9..601c2daa471 100644
--- a/clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp
+++ b/clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp
@@ -59,8 +59,10 @@ using ::testing::ElementsAre;
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.
OpenPOWER on IntegriCloud