[clang-tools-extra] 691eb81 - [clangd] NFC: Resolve Clang-Tidy warnings in Protocol.cpp
Kirill Bobyrev via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 20 02:24:03 PDT 2020
Author: Kirill Bobyrev
Date: 2020-10-20T11:23:40+02:00
New Revision: 691eb814c1ae38d5015bf070dfed3fd54d542582
URL: https://github.com/llvm/llvm-project/commit/691eb814c1ae38d5015bf070dfed3fd54d542582
DIFF: https://github.com/llvm/llvm-project/commit/691eb814c1ae38d5015bf070dfed3fd54d542582.diff
LOG: [clangd] NFC: Resolve Clang-Tidy warnings in Protocol.cpp
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D89771
Added:
Modified:
clang-tools-extra/clangd/Protocol.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp
index 0b89c622e6f8..0103a06ff951 100644
--- a/clang-tools-extra/clangd/Protocol.cpp
+++ b/clang-tools-extra/clangd/Protocol.cpp
@@ -179,10 +179,12 @@ bool fromJSON(const llvm::json::Value &E, TraceLevel &Out, llvm::json::Path P) {
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 @@ bool fromJSON(const llvm::json::Value &Params, ClientCapabilities &R,
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 @@ bool fromJSON(const llvm::json::Value &Params, ExecuteCommandParams &R,
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,
More information about the cfe-commits
mailing list