[clangd] Handle initialized notification (no-op to suppress log message)

This commit is contained in:
Sam McCall 2020-03-03 12:12:14 +01:00
parent ec7e4a9a80
commit 8a2d294ed0
3 changed files with 5 additions and 0 deletions

View File

@ -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<std::nullptr_t> 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);

View File

@ -67,6 +67,7 @@ private:
// LSP methods. Notifications have signature void(const Params&).
// Calls have signature void(const Params&, Callback<Response>).
void onInitialize(const InitializeParams &, Callback<llvm::json::Value>);
void onInitialized(const InitializedParams &);
void onShutdown(const ShutdownParams &, Callback<std::nullptr_t>);
void onSync(const NoParams &, Callback<std::nullptr_t>);
void onDocumentDidOpen(const DidOpenTextDocumentParams &);

View File

@ -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;