summaryrefslogtreecommitdiffstats
path: root/include/clang/Format/Format.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Format/Format.h')
-rw-r--r--include/clang/Format/Format.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/include/clang/Format/Format.h b/include/clang/Format/Format.h
index 60c54ab..3fdee99 100644
--- a/include/clang/Format/Format.h
+++ b/include/clang/Format/Format.h
@@ -247,6 +247,17 @@ struct FormatStyle {
/// \brief If \c true, aligns trailing comments.
bool AlignTrailingComments;
+ /// \brief If \c true, aligns consecutive assignments.
+ ///
+ /// This will align the assignment operators of consecutive lines. This
+ /// will result in formattings like
+ /// \code
+ /// int aaaa = 12;
+ /// int b = 23;
+ /// int ccc = 23;
+ /// \endcode
+ bool AlignConsecutiveAssignments;
+
/// \brief If \c true, aligns escaped newlines as far left as possible.
/// Otherwise puts them into the right-most column.
bool AlignEscapedNewlinesLeft;
@@ -527,14 +538,6 @@ std::error_code parseConfiguration(StringRef Text, FormatStyle *Style);
/// \brief Gets configuration in a YAML string.
std::string configurationAsText(const FormatStyle &Style);
-/// \brief Reformats the given \p Ranges in the token stream coming out of
-/// \c Lex.
-///
-/// DEPRECATED: Do not use.
-tooling::Replacements reformat(const FormatStyle &Style, Lexer &Lex,
- SourceManager &SourceMgr,
- ArrayRef<CharSourceRange> Ranges);
-
/// \brief Reformats the given \p Ranges in the file \p ID.
///
/// Each range is extended on either end to its next bigger logic unit, i.e.
@@ -543,16 +546,22 @@ tooling::Replacements reformat(const FormatStyle &Style, Lexer &Lex,
///
/// Returns the \c Replacements necessary to make all \p Ranges comply with
/// \p Style.
+///
+/// If \c IncompleteFormat is non-null, its value will be set to true if any
+/// of the affected ranges were not formatted due to a non-recoverable syntax
+/// error.
tooling::Replacements reformat(const FormatStyle &Style,
SourceManager &SourceMgr, FileID ID,
- ArrayRef<CharSourceRange> Ranges);
+ ArrayRef<CharSourceRange> Ranges,
+ bool *IncompleteFormat = nullptr);
/// \brief Reformats the given \p Ranges in \p Code.
///
-/// Otherwise identical to the reformat() function consuming a \c Lexer.
+/// Otherwise identical to the reformat() function using a file ID.
tooling::Replacements reformat(const FormatStyle &Style, StringRef Code,
ArrayRef<tooling::Range> Ranges,
- StringRef FileName = "<stdin>");
+ StringRef FileName = "<stdin>",
+ bool *IncompleteFormat = nullptr);
/// \brief Returns the \c LangOpts that the formatter expects you to set.
///
OpenPOWER on IntegriCloud