summaryrefslogtreecommitdiff
path: root/include/clang/Tooling/Refactoring.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Tooling/Refactoring.h')
-rw-r--r--include/clang/Tooling/Refactoring.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/clang/Tooling/Refactoring.h b/include/clang/Tooling/Refactoring.h
index 54deff6e3661..06ec8b087629 100644
--- a/include/clang/Tooling/Refactoring.h
+++ b/include/clang/Tooling/Refactoring.h
@@ -68,6 +68,24 @@ private:
Replacements Replace;
};
+/// \brief Groups \p Replaces by the file path and applies each group of
+/// Replacements on the related file in \p Rewriter. In addition to applying
+/// given Replacements, this function also formats the changed code.
+///
+/// \pre Replacements must be conflict-free.
+///
+/// Replacement applications happen independently of the success of other
+/// applications.
+///
+/// \param[in] Replaces Replacements to apply.
+/// \param[in] Rewrite The `Rewritter` to apply replacements on.
+/// \param[in] Style The style name used for reformatting. See ```getStyle``` in
+/// "include/clang/Format/Format.h" for all possible style forms.
+///
+/// \returns true if all replacements applied and formatted. false otherwise.
+bool formatAndApplyAllReplacements(const Replacements &Replaces,
+ Rewriter &Rewrite, StringRef Style = "file");
+
} // end namespace tooling
} // end namespace clang