[PATCH] D17852: Added formatAndApplyAllReplacements that works on multiple files in libTooling.

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 29 08:17:37 PDT 2016


djasper added inline comments.

================
Comment at: include/clang/Tooling/Refactoring.h:91
@@ +90,3 @@
+                                   Rewriter &Rewrite,
+                                   const format::FormatStyle &Style);
+
----------------
ioeric wrote:
> djasper wrote:
> > Do you have a use case where we'd want to call this with a fixed style? Otherwise, I'd just remove this function for now.
> If the .clang-format doesn't exist, it can only fall back to one default style, which is LLVM now. Shouldn't users have the flexibility to specify other styles if there is no .clang-format file?   
I am not sure, but I usually like to keep interfaces small until we have actual use cases. It is very hard to foresee in what ways this can possibly be used. An alternative might be to hand in the style as a string which is similar to what clang-format takes on the command line. Then people can supply "file", "Google", ... and we can hand that to getStyle().


http://reviews.llvm.org/D17852





More information about the cfe-commits mailing list