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

Eric Liu via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 06:48:16 PDT 2016

ioeric added inline comments.

Comment at: lib/Tooling/Refactoring.cpp:90
@@ +89,3 @@
+// FIXME: duplicated code here. Any better way to overload?
+bool formatAndApplyAllReplacements(const Replacements &Replaces,
klimek wrote:
> Just call the above with the format::getStyle("file", FilePath, "LLVM")?
> (note that I think "Google" is a bad default style here)
But there could be more than one FilePath in Replaces? 

Comment at: unittests/Tooling/RefactoringTest.cpp:206
@@ +205,3 @@
+TEST_F(ReplacementTest, ReplaceAndFormatNoStyle) {
+  std::string Code = "MyType012345678901234567890123456789 *a =\n"
+                     "    new MyType012345678901234567890123456789();\n"
klimek wrote:
> Also use a ColumnLimit to make the test more readable?
We don't have access to the Style here? Any way to set ColumnLimit?


More information about the cfe-commits mailing list