[PATCH] D88881: [clangd] Add a NewName optional parameter to clangdServer::prepareRename.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 6 02:46:03 PDT 2020


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:797
   Server->prepareRename(
-      Params.textDocument.uri.file(), Params.position, Opts.Rename,
+      Params.textDocument.uri.file(), Params.position, /*NewName*/ "",
+      Opts.Rename,
----------------
please make this optional rather than using "" as a sentinel value. The empty string is a plausible value here (though of course will always fail)


================
Comment at: clang-tools-extra/clangd/ClangdServer.cpp:404
                                  const RenameOptions &RenameOpts,
                                  Callback<RenameResult> CB) {
+  auto Action = [Pos, File = File.str(), CB = std::move(CB),
----------------
we can fail already here if the name is specified and empty


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88881/new/

https://reviews.llvm.org/D88881



More information about the cfe-commits mailing list