[clang-tools-extra] [clangd] Fix renaming single argument ObjC methods (PR #82396)

David Goldman via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 22 09:36:51 PST 2024


================
@@ -811,8 +811,14 @@ renameWithinFile(ParsedAST &AST, const NamedDecl &RenameDecl,
       continue;
     Locs.push_back(RenameLoc);
   }
-  if (const auto *MD = dyn_cast<ObjCMethodDecl>(&RenameDecl))
-    return renameObjCMethodWithinFile(AST, MD, NewName, std::move(Locs));
+  if (const auto *MD = dyn_cast<ObjCMethodDecl>(&RenameDecl)) {
+    if (MD->getSelector().getNumArgs() > 1)
----------------
DavidGoldman wrote:

Done. It does work for the one arg selector case but I thought we might as well use the simpler logic.

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


More information about the cfe-commits mailing list