forked from OSchip/llvm-project
906b9dbc9d
TokenAnnotator::splitPenalty() was always returning 0 for opening parens if AlignAfterOpenBracket was set to BAS_DontAlign, so the preferred point for line breaking was always after the open paren (and was ignoring PenaltyBreakBeforeFirstCallParameter). This change restricts the zero penalty to the AllowAllArgumentsOnNextLine case. This results in improved formatting for FreeBSD where we set AllowAllArgumentsOnNextLine: false and a high value for PenaltyBreakBeforeFirstCallParameter to avoid breaking after the open paren. Before: ``` functionCall( paramA, paramB, paramC); void functionDecl( int A, int B, int C) ``` After: ``` functionCall(paramA, paramB, paramC); void functionDecl(int A, int B, int C) ``` Reviewed By: MyDeveloperDay Differential Revision: https://reviews.llvm.org/D90246 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
CleanupTest.cpp | ||
FormatTest.cpp | ||
FormatTestCSharp.cpp | ||
FormatTestComments.cpp | ||
FormatTestJS.cpp | ||
FormatTestJava.cpp | ||
FormatTestObjC.cpp | ||
FormatTestProto.cpp | ||
FormatTestRawStrings.cpp | ||
FormatTestSelective.cpp | ||
FormatTestTableGen.cpp | ||
FormatTestTextProto.cpp | ||
FormatTestUtils.h | ||
MacroExpanderTest.cpp | ||
NamespaceEndCommentsFixerTest.cpp | ||
SortImportsTestJS.cpp | ||
SortImportsTestJava.cpp | ||
SortIncludesTest.cpp | ||
TestLexer.h | ||
TokenAnnotatorTest.cpp | ||
UsingDeclarationsSorterTest.cpp |