Index: include/clang/Format/Format.h =================================================================== --- include/clang/Format/Format.h +++ include/clang/Format/Format.h @@ -444,16 +444,25 @@ /// Like ``Attach``, but break before function definitions, ``catch``, and /// ``else``. /// \code - /// try { + /// try + /// { /// foo(); - /// } catch () { /// } - /// void foo() { bar(); } + /// catch () + /// { + /// } + /// void foo() + /// { + /// bar(); + /// } /// class foo /// { /// }; - /// if (foo()) { - /// } else { + /// if (foo()) + /// { + /// } + /// else + /// { /// } /// enum X : int /// { @@ -686,7 +695,7 @@ /// ? firstValue /// : SecondValueVeryVeryVeryVeryLong; /// - /// true: + /// false: /// veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription ? /// firstValue : /// SecondValueVeryVeryVeryVeryLong; @@ -708,6 +717,16 @@ bool BreakAfterJavaFieldAnnotations; /// \brief Allow breaking string literals when formatting. + /// \code + /// true: + /// const char* x = "veryVeryVeryVeryVeryVe" + /// "ryVeryVeryVeryVeryVery" + /// "VeryLongString"; + /// + /// false: + /// const char* x = + /// "veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongString"; + /// \endcode bool BreakStringLiterals; /// \brief The column limit. @@ -880,6 +899,32 @@ /// /// When ``false``, use the same indentation level as for the switch statement. /// Switch statement body is always indented one level more than case labels. + /// + /// \code + /// true: + /// switch (type) { + /// case FirstCase: + /// FirstFunction(); + /// break; + /// + /// case SecondCase: { + /// SecondFunction(); + /// } + /// break; + /// } + /// + /// false: + /// switch (type) { + /// case FirstCase: + /// FirstFunction(); + /// break; + /// + /// case SecondCase: { + /// SecondFunction(); + /// } + /// break; + /// } + /// \endcode bool IndentCaseLabels; /// \brief The number of columns to use for indentation. @@ -939,6 +984,19 @@ bool JavaScriptWrapImports; /// \brief If true, empty lines at the start of blocks are kept. + /// + /// \code + /// true: + /// void foo() { + /// + /// bar(); + /// } + /// + /// false: + /// void foo() { + /// bar(); + /// } + /// \encode bool KeepEmptyLinesAtTheStartOfBlocks; /// \brief Supported languages.