danbeam created this revision.
danbeam added a reviewer: thakis.
danbeam added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Chromium is starting to use clang-format on more JavaScript.
In doing this, we discovered that our defaults were not doing a good job
differentiating betwe
danbeam updated this revision to Diff 82946.
danbeam added a comment.
make a branch specific to JS and duplicate some format options for explicitness
https://reviews.llvm.org/D28165
Files:
lib/Format/Format.cpp
Index: lib/Format/Format.cpp
===
danbeam marked an inline comment as done.
danbeam added inline comments.
Comment at: lib/Format/Format.cpp:643
+ChromiumStyle.AllowShortIfStatementsOnASingleLine = false;
+ChromiumStyle.AllowShortLoopsOnASingleLine = false;
+ }
thakis wrote:
> Thanks for
danbeam updated this revision to Diff 82989.
danbeam marked an inline comment as done.
danbeam added a comment.
setting up arc
https://reviews.llvm.org/D28165
Files:
lib/Format/Format.cpp
Index: lib/Format/Format.cpp
===
--- li
danbeam created this revision.
Herald added a subscriber: klimek.
Because IIFEs[1] are often used like an anonymous namespace around large
sections of JavaScript code, it's useful not to indent to them (which
effectively reduces the column limit by the indent amount needlessly).
It's also common
danbeam updated this revision to Diff 98332.
danbeam marked 4 inline comments as done.
danbeam added a comment.
mprobst@ review
https://reviews.llvm.org/D32989
Files:
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
danbeam added inline comments.
Comment at: lib/Format/UnwrappedLineParser.cpp:2353
+ // expressions?
+ if (Line->Tokens.size() < 5)
+return false;
mprobst wrote:
> There's a `startsSequenceInternal` on `Line` that might come in handy here?
it wasn't on `Lin