This revision was automatically updated to reflect the committed changes.
Closed by commit rL272558: clang-format: [JS] Introduce JavaScriptWrapImports
option. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21273?vs=60532&id=60552#toc
Repository:
rL LLVM
http://rev
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
http://reviews.llvm.org/D21273
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listin
mprobst updated this revision to Diff 60532.
mprobst added a comment.
- classify as LT_ImportStatement, re-enable wrapping later
- no early exist in TokenAnnotator: while loop is required for consumeToken().
http://reviews.llvm.org/D21273
Files:
include/clang/Format/Format.h
lib/Format/Form
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:789
@@ -788,3 +788,3 @@
if (Style.Language == FormatStyle::LK_JavaScript &&
-CurrentToken->is(Keywords.kw_import))
+CurrentToken->is(Keywords.kw_import) && !Style.JavaScriptWrapImports)
mprobst updated this revision to Diff 60519.
mprobst added a comment.
- rename to JavaScriptWrapImports
- re-alphabetize options list
http://reviews.llvm.org/D21273
Files:
include/clang/Format/Format.h
lib/Format/Format.cpp
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
djasper added inline comments.
Comment at: include/clang/Format/Format.h:631
@@ +630,3 @@
+ /// \brief Whether to wrap JavaScript import/export statements.
+ bool WrapJavaScriptImports;
+
Wondering whether we should call this JavaScriptWrapImports so that the
J
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
When turned on, clang-format wraps JavaScript imports (and importing exports),
instead of forcing the entire import statement onto one line.
http://reviews