diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp --- a/clang-tools-extra/clangd/Protocol.cpp +++ b/clang-tools-extra/clangd/Protocol.cpp @@ -179,10 +179,12 @@ if (*S == "off") { Out = TraceLevel::Off; return true; - } else if (*S == "messages") { + } + if (*S == "messages") { Out = TraceLevel::Messages; return true; - } else if (*S == "verbose") { + } + if (*S == "verbose") { Out = TraceLevel::Verbose; return true; } @@ -319,7 +321,8 @@ if (auto *Item = Completion->getObject("completionItem")) { if (auto SnippetSupport = Item->getBoolean("snippetSupport")) R.CompletionSnippets = *SnippetSupport; - if (auto DocumentationFormat = Item->getArray("documentationFormat")) { + if (const auto *DocumentationFormat = + Item->getArray("documentationFormat")) { for (const auto &Format : *DocumentationFormat) { if (fromJSON(Format, R.CompletionDocumentationFormat, P)) break; @@ -645,7 +648,7 @@ if (!O || !O.map("command", R.command)) return false; - auto Args = Params.getAsObject()->getArray("arguments"); + const auto *Args = Params.getAsObject()->getArray("arguments"); if (R.command == ExecuteCommandParams::CLANGD_APPLY_FIX_COMMAND) { return Args && Args->size() == 1 && fromJSON(Args->front(), R.workspaceEdit,