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

Martin Probst via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 15 03:21:27 PDT 2017


mprobst marked an inline comment as done.
mprobst added inline comments.


================
Comment at: unittests/Format/FormatTest.cpp:5505
+  verifyFormat(
+      "void aaaaaaaaaaaaaaaaaa(\n"
+      "    int level,\n"
----------------
djasper wrote:
> Don't add this line break? I suspect your clang-format isn't set to LLVM style?
Yeah, something is amiss. Not sure what yet, but formatted manually for the time being.


================
Comment at: unittests/Format/FormatTest.cpp:9645
+               "  bar(\n"
+               "      []() {} // Did not respect SpacesBeforeTrailingComments\n"
+               "  );\n"
----------------
djasper wrote:
> What caused this change?
The trailing comma triggers a break, and then the code in TokenAnnotator causes the wrapping logic (on trailing comma and trailing comment).

Only triggering the wrapping in JS mode, this now just unindents the closing paren, which I think is sensible.


https://reviews.llvm.org/D33023





More information about the cfe-commits mailing list