[clangd] clang-format the source code. NFC.
authorIlya Biryukov <ibiryukov@google.com>
Wed, 15 Nov 2017 18:04:56 +0000 (18:04 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Wed, 15 Nov 2017 18:04:56 +0000 (18:04 +0000)
llvm-svn: 318317

clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/JSONRPCDispatcher.cpp
clang-tools-extra/clangd/Protocol.cpp
clang-tools-extra/unittests/clangd/JSONExprTests.cpp

index 465bbde..4eac624 100644 (file)
@@ -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);
index 3dece24..18fd2b7 100644 (file)
@@ -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"
index 557fadb..376f833 100644 (file)
@@ -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}}},
     });
   }
 }
index 5ef8c9b..8caeacc 100644 (file)
@@ -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);
index a95b4b0..efa9eb3 100644 (file)
@@ -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