This revision was automatically updated to reflect the committed changes.
Closed by commit rL309712: clang-format: [JS] prefer wrapping chains over empty
literals. (authored by mprobst).
Changed prior to commit:
https://reviews.llvm.org/D36139?vs=109082&id=109155#toc
Repository:
rL LLVM
htt
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2009
+// Prefer breaking call chains (".foo") over empty "{}", "[]" or "()".
+if ((Left.is(tok::l_brace) && Right.is(tok::r_brace)) ||
+(Left.is(tok::l_square) && Right.is(tok::r_square)) ||
mprobst created this revision.
Herald added a subscriber: klimek.
E.g. don't wrap like this:
(foo.bar.baz).and.bam(Blah.of({
}))
But rather:
(foo.bar.baz)
.and.bam(Blah.of({}))
https://reviews.llvm.org/D36139
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.