[PATCH] D33023: clang-format: [JS] wrap params with trailing commas.

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 15 02:41:40 PDT 2017


djasper added inline comments.


================
Comment at: lib/Format/ContinuationIndenter.cpp:1043
 
+    bool EndsInComma =
+        Current.MatchingParen &&
----------------
Please make this specific to JavaScript for now. C++ doesn't allow trailing commas here and a trailing comma is more likely to represent "not done yet". In those cases, we don't want to reformat the whole call.

The part above (changing the indentation of a ")" wrapped to a new line is fine to be used for all languages).


================
Comment at: unittests/Format/FormatTest.cpp:5505
+  verifyFormat(
+      "void aaaaaaaaaaaaaaaaaa(\n"
+      "    int level,\n"
----------------
Don't add this line break? I suspect your clang-format isn't set to LLVM style?


================
Comment at: unittests/Format/FormatTest.cpp:9645
+               "  bar(\n"
+               "      []() {} // Did not respect SpacesBeforeTrailingComments\n"
+               "  );\n"
----------------
What caused this change?


https://reviews.llvm.org/D33023





More information about the cfe-commits mailing list