[clang-tools-extra] r318317 - [clangd] clang-format the source code. NFC.
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 15 10:04:56 PST 2017
Author: ibiryukov
Date: Wed Nov 15 10:04:56 2017
New Revision: 318317
URL: http://llvm.org/viewvc/llvm-project?rev=318317&view=rev
Log:
[clangd] clang-format the source code. NFC.
Modified:
clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
clang-tools-extra/trunk/clangd/ClangdServer.cpp
clang-tools-extra/trunk/clangd/JSONRPCDispatcher.cpp
clang-tools-extra/trunk/clangd/Protocol.cpp
clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp
Modified: clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp?rev=318317&r1=318316&r2=318317&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp (original)
+++ clang-tools-extra/trunk/clangd/ClangdLSPServer.cpp Wed Nov 15 10:04:56 2017
@@ -132,9 +132,8 @@ void ClangdLSPServer::onRename(Ctx C, Re
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);
Modified: clang-tools-extra/trunk/clangd/ClangdServer.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ClangdServer.cpp?rev=318317&r1=318316&r2=318317&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/ClangdServer.cpp (original)
+++ clang-tools-extra/trunk/clangd/ClangdServer.cpp Wed Nov 15 10:04:56 2017
@@ -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"
Modified: clang-tools-extra/trunk/clangd/JSONRPCDispatcher.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/JSONRPCDispatcher.cpp?rev=318317&r1=318316&r2=318317&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/JSONRPCDispatcher.cpp (original)
+++ clang-tools-extra/trunk/clangd/JSONRPCDispatcher.cpp Wed Nov 15 10:04:56 2017
@@ -66,13 +66,15 @@ void RequestContext::reply(json::Expr &&
});
}
-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}}},
});
}
}
Modified: clang-tools-extra/trunk/clangd/Protocol.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Protocol.cpp?rev=318317&r1=318316&r2=318317&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/Protocol.cpp (original)
+++ clang-tools-extra/trunk/clangd/Protocol.cpp Wed Nov 15 10:04:56 2017
@@ -1094,7 +1094,7 @@ RenameParams::parse(llvm::yaml::MappingN
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);
Modified: clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp?rev=318317&r1=318316&r2=318317&view=diff
==============================================================================
--- clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp (original)
+++ clang-tools-extra/trunk/unittests/clangd/JSONExprTests.cpp Wed Nov 15 10:04:56 2017
@@ -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
More information about the cfe-commits
mailing list