JavaScript allows parameter lists to include trailing commas:
myFunction(param1, param2,); For symmetry with other parenthesized lists ([...], {...}), clang-format should wrap parenthesized lists one-per-line if they contain a trailing comma: myFunction( param1, param2, ); This is particularly useful in function declarations or calls with many arguments, e.g. commonly in constructors. Differential Revision: https://reviews.llvm.org/D33023 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303049 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- lib/Format/ContinuationIndenter.cpp 12 additions, 0 deletionslib/Format/ContinuationIndenter.cpp
- lib/Format/TokenAnnotator.cpp 10 additions, 6 deletionslib/Format/TokenAnnotator.cpp
- unittests/Format/FormatTest.cpp 4 additions, 4 deletionsunittests/Format/FormatTest.cpp
- unittests/Format/FormatTestJS.cpp 26 additions, 2 deletionsunittests/Format/FormatTestJS.cpp
Loading
Please register or sign in to comment