[PATCH] D66637: [clangd] Support multifile edits as output of Tweaks

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 9 04:36:58 PDT 2019


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


================
Comment at: clang-tools-extra/clangd/ClangdServer.cpp:414
+      if (llvm::Error Err = reformatEdit(E, Style)) {
+        llvm::handleAllErrors(std::move(Err), [&](llvm::ErrorInfoBase &EIB) {
+          elog("Failed to format {0}: {1}", It.first(), EIB.message());
----------------
kadircet wrote:
> sammccall wrote:
> > isn't this just
> > `elog("Failed to format {0}: {1}", std::move(Err))`
> IIUC, just printing the error doesn't actually mark it as checked, therefore causes an assertion failure (see `getPtr` vs `getPayload` in `llvm::Error`). And I couldn't see any special handling in `elog`, but not sure if `formatv object` has this.
The special handling is on Logger.h:38. Do you see crashes?


================
Comment at: clang-tools-extra/clangd/refactor/Tweak.cpp:97
+  return llvm::createStringError(llvm::inconvertibleErrorCode(),
+                                 "Failed to get absolute path for: " +
+                                     SM.getFileEntryForID(FID)->getName());
----------------
nit: "for edited file: "...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66637





More information about the cfe-commits mailing list