summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/ClangdLSPServer.cpp5
-rw-r--r--clang-tools-extra/clangd/ClangdServer.cpp4
-rw-r--r--clang-tools-extra/clangd/JSONRPCDispatcher.cpp6
-rw-r--r--clang-tools-extra/clangd/Protocol.cpp2
-rw-r--r--clang-tools-extra/unittests/clangd/JSONExprTests.cpp26
5 files changed, 21 insertions, 22 deletions
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index 465bbde67e0..4eac624a58f 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -132,9 +132,8 @@ void ClangdLSPServer::onRename(Ctx C, RenameParams &Params) {
auto File = Params.textDocument.uri.file;
auto Replacements = Server.rename(File, Params.position, Params.newName);
if (!Replacements) {
- C.replyError(
- ErrorCode::InternalError,
- llvm::toString(Replacements.takeError()));
+ C.replyError(ErrorCode::InternalError,
+ llvm::toString(Replacements.takeError()));
return;
}
std::string Code = Server.getDocument(File);
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp
index 3dece2491d6..18fd2b7be83 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -9,11 +9,11 @@
#include "ClangdServer.h"
#include "clang/Format/Format.h"
-#include "clang/Tooling/Refactoring/RefactoringResultConsumer.h"
-#include "clang/Tooling/Refactoring/Rename/RenamingAction.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Tooling/CompilationDatabase.h"
+#include "clang/Tooling/Refactoring/RefactoringResultConsumer.h"
+#include "clang/Tooling/Refactoring/Rename/RenamingAction.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/FileSystem.h"
diff --git a/clang-tools-extra/clangd/JSONRPCDispatcher.cpp b/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
index 557fadbac06..376f83329c5 100644
--- a/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
+++ b/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
@@ -66,13 +66,15 @@ void RequestContext::reply(json::Expr &&Result) {
});
}
-void RequestContext::replyError(ErrorCode code, const llvm::StringRef &Message) {
+void RequestContext::replyError(ErrorCode code,
+ const llvm::StringRef &Message) {
Out.log("Error " + Twine(static_cast<int>(code)) + ": " + Message + "\n");
if (ID) {
Out.writeMessage(json::obj{
{"jsonrpc", "2.0"},
{"id", *ID},
- {"error", json::obj{{"code", static_cast<int>(code)}, {"message", Message}}},
+ {"error",
+ json::obj{{"code", static_cast<int>(code)}, {"message", Message}}},
});
}
}
diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp
index 5ef8c9bfe8e..8caeacc7695 100644
--- a/clang-tools-extra/clangd/Protocol.cpp
+++ b/clang-tools-extra/clangd/Protocol.cpp
@@ -1094,7 +1094,7 @@ RenameParams::parse(llvm::yaml::MappingNode *Params, clangd::Logger &Logger) {
if (KeyValue == "textDocument") {
auto *Value =
- dyn_cast_or_null<llvm::yaml::MappingNode>(NextKeyValue.getValue());
+ dyn_cast_or_null<llvm::yaml::MappingNode>(NextKeyValue.getValue());
if (!Value)
continue;
auto *Map = dyn_cast<llvm::yaml::MappingNode>(Value);
diff --git a/clang-tools-extra/unittests/clangd/JSONExprTests.cpp b/clang-tools-extra/unittests/clangd/JSONExprTests.cpp
index a95b4b0c6ce..efa9eb34ea8 100644
--- a/clang-tools-extra/unittests/clangd/JSONExprTests.cpp
+++ b/clang-tools-extra/unittests/clangd/JSONExprTests.cpp
@@ -94,20 +94,18 @@ TEST(JSONExprTests, PrettyPrinting) {
}
})";
- EXPECT_EQ(
- str,
- sp(obj{
- {"empty_object", obj{}},
- {"empty_array", {}},
- {"full_array", {1, nullptr}},
- {"full_object",
- obj{
- {"nested_array",
- {obj{
- {"property", "value"},
- }}},
- }},
- }));
+ EXPECT_EQ(str, sp(obj{
+ {"empty_object", obj{}},
+ {"empty_array", {}},
+ {"full_array", {1, nullptr}},
+ {"full_object",
+ obj{
+ {"nested_array",
+ {obj{
+ {"property", "value"},
+ }}},
+ }},
+ }));
}
} // namespace
OpenPOWER on IntegriCloud