]> granicus.if.org Git - clang/commit
JavaScript allows parameter lists to include trailing commas:
authorMartin Probst <martin@probst.io>
Mon, 15 May 2017 11:15:29 +0000 (11:15 +0000)
committerMartin Probst <martin@probst.io>
Mon, 15 May 2017 11:15:29 +0000 (11:15 +0000)
commit41505a741963aff60d475ed8961dce913462e629
tree8c0b4fa1d066484daca4ba033d5915963cbd578e
parentc06ddfb05866c4cc5b058976a9c0e8b27c045e9b
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
lib/Format/ContinuationIndenter.cpp
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp
unittests/Format/FormatTestJS.cpp