diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp index 55e63c71b23e..18682866d800 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.cpp +++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -600,6 +600,8 @@ void ClangdLSPServer::onInitialize(const InitializeParams &Params, Reply(std::move(Result)); } +void ClangdLSPServer::onInitialized(const InitializedParams &Params) {} + void ClangdLSPServer::onShutdown(const ShutdownParams &Params, Callback Reply) { // Do essentially nothing, just say we're ready to exit. @@ -1243,6 +1245,7 @@ ClangdLSPServer::ClangdLSPServer( NegotiatedOffsetEncoding(ForcedOffsetEncoding) { // clang-format off MsgHandler->bind("initialize", &ClangdLSPServer::onInitialize); + MsgHandler->bind("initialized", &ClangdLSPServer::onInitialized); MsgHandler->bind("shutdown", &ClangdLSPServer::onShutdown); MsgHandler->bind("sync", &ClangdLSPServer::onSync); MsgHandler->bind("textDocument/rangeFormatting", &ClangdLSPServer::onDocumentRangeFormatting); diff --git a/clang-tools-extra/clangd/ClangdLSPServer.h b/clang-tools-extra/clangd/ClangdLSPServer.h index f30fbf6b5149..09167ca39a0f 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.h +++ b/clang-tools-extra/clangd/ClangdLSPServer.h @@ -67,6 +67,7 @@ private: // LSP methods. Notifications have signature void(const Params&). // Calls have signature void(const Params&, Callback). void onInitialize(const InitializeParams &, Callback); + void onInitialized(const InitializedParams &); void onShutdown(const ShutdownParams &, Callback); void onSync(const NoParams &, Callback); void onDocumentDidOpen(const DidOpenTextDocumentParams &); diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h index a376e5f39e79..b706e07e5686 100644 --- a/clang-tools-extra/clangd/Protocol.h +++ b/clang-tools-extra/clangd/Protocol.h @@ -239,6 +239,7 @@ bool fromJSON(const llvm::json::Value &E, TraceLevel &Out); struct NoParams {}; inline bool fromJSON(const llvm::json::Value &, NoParams &) { return true; } +using InitializedParams = NoParams; using ShutdownParams = NoParams; using ExitParams = NoParams;