[clang-tools-extra] [clangd] forward clang-tidy's readability-identifier-naming fix to textDocument/rename (PR #78454)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 06:48:09 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 837cde8aa15b0eb17aefc24530e82e25000d9fe0 71619f8dc07ca038b8e2e30d89f308c1e38a0726 -- clang-tools-extra/clangd/ClangdLSPServer.cpp clang-tools-extra/clangd/ClangdLSPServer.h clang-tools-extra/clangd/ClangdServer.cpp clang-tools-extra/clangd/ClangdServer.h clang-tools-extra/clangd/Protocol.cpp clang-tools-extra/clangd/Protocol.h
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index ffb241b02b..49d1eb0e83 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -825,12 +825,14 @@ void ClangdLSPServer::onCommandApplyTweak(const TweakArgs &Args,
                      std::move(Action));
 }
 
-void ClangdLSPServer::onCommandApplyRename(const RenameParams &R, Callback<llvm::json::Value> Reply) {
-    onRename(R, [this, Reply = std::move(Reply)](llvm::Expected<WorkspaceEdit> Edit) mutable {
-        if (!Edit)
-            Reply(Edit.takeError());
-        applyEdit(std::move(*Edit), "Rename applied.", std::move(Reply));
-    });
+void ClangdLSPServer::onCommandApplyRename(const RenameParams &R,
+                                           Callback<llvm::json::Value> Reply) {
+  onRename(R, [this, Reply = std::move(Reply)](
+                  llvm::Expected<WorkspaceEdit> Edit) mutable {
+    if (!Edit)
+      Reply(Edit.takeError());
+    applyEdit(std::move(*Edit), "Rename applied.", std::move(Reply));
+  });
 }
 
 void ClangdLSPServer::applyEdit(WorkspaceEdit WE, llvm::json::Value Success,
diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp
index 2b44f5c284..7cc248cd1d 100644
--- a/clang-tools-extra/clangd/Protocol.cpp
+++ b/clang-tools-extra/clangd/Protocol.cpp
@@ -1188,11 +1188,11 @@ bool fromJSON(const llvm::json::Value &Params, RenameParams &R,
 }
 
 llvm::json::Value toJSON(const RenameParams &R) {
-    return llvm::json::Object{
-        {"textDocument", R.textDocument},
-        {"position", R.position},
-        {"newName", R.newName},
-    };
+  return llvm::json::Object{
+      {"textDocument", R.textDocument},
+      {"position", R.position},
+      {"newName", R.newName},
+  };
 }
 
 llvm::json::Value toJSON(const DocumentHighlight &DH) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/78454


More information about the cfe-commits mailing list