[PATCH] D40178: clang-format: [JS] remove trailing lines in arrow functions.

2017-11-17 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318537: clang-format: remove trailing lines in lamdas and arrow functions. (authored by mprobst). Repository: rL LLVM https://reviews.llvm.org/D40178 Files: cfe/trunk/lib/Format/ContinuationIndenter

[PATCH] D40178: clang-format: [JS] remove trailing lines in arrow functions.

2017-11-17 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 123371. mprobst added a comment. - prefer !x.empty() over .size() > 0. https://reviews.llvm.org/D40178 Files: lib/Format/ContinuationIndenter.cpp lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp unittests/Format/FormatTestJS.cpp

[PATCH] D40178: clang-format: [JS] remove trailing lines in arrow functions.

2017-11-17 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 123370. mprobst added a comment. - document the meaning if Children.size() == 0 in this context. https://reviews.llvm.org/D40178 Files: lib/Format/ContinuationIndenter.cpp lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp unittes

[PATCH] D40178: clang-format: [JS] remove trailing lines in arrow functions.

2017-11-17 Thread Daniel Jasper via Phabricator via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. Looks good. There is a chance that some people do not want this in their coding style. But if so, we can add an option later. https://reviews.llvm.org/D40178

[PATCH] D40178: clang-format: [JS] remove trailing lines in arrow functions.

2017-11-17 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 123368. mprobst added a comment. - reduce test cases a bit, no need to separate before/after cases https://reviews.llvm.org/D40178 Files: lib/Format/ContinuationIndenter.cpp lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp unitt

[PATCH] D40178: clang-format: [JS] remove trailing lines in arrow functions.

2017-11-17 Thread Martin Probst via Phabricator via cfe-commits
mprobst added a comment. In https://reviews.llvm.org/D40178#928645, @djasper wrote: > Is this different for C++ lambdas? I would think that we never should add an > empty line before the "}" of a child block. Actually indeed turns out to be identical for C++ lambdas. Fixed as we discussed off

[PATCH] D40178: clang-format: [JS] remove trailing lines in arrow functions.

2017-11-17 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 123367. mprobst added a comment. - handle C++ lambdas - handle preceding empty lines https://reviews.llvm.org/D40178 Files: lib/Format/ContinuationIndenter.cpp lib/Format/UnwrappedLineFormatter.cpp unittests/Format/FormatTest.cpp unittests/Format/Fo

[PATCH] D40178: clang-format: [JS] remove trailing lines in arrow functions.

2017-11-17 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added a comment. Is this different for C++ lambdas? I would think that we never should add an empty line before the "}" of a child block. https://reviews.llvm.org/D40178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D40178: clang-format: [JS] remove trailing lines in arrow functions.

2017-11-17 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. clang-format already removes lines trailing at the end of blocks: function x() { foo(); // next line will be removed. } However because JS arrow functions are parsed as expressions, the existing logic to remove empty l