[PATCH] D20198: clang-format: [JS] sort ES6 imports.
Daniel Jasper via cfe-commits
cfe-commits at lists.llvm.org
Mon May 16 23:09:06 PDT 2016
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
I think, this looks good.
Manuel: Are you fine with this, design-wise?
================
Comment at: lib/Format/SortJavaScriptImports.cpp:77
@@ +76,3 @@
+ return false;
+ // NB: empty URLs sort *last* (for export {...};).
+ if (LHS.URL.empty() != RHS.URL.empty())
----------------
NB?
================
Comment at: lib/Format/SortJavaScriptImports.cpp:255
@@ +254,3 @@
+ // * as prefix from '...';
+ if (Current->is(tok::star)) {
+ if (!nextToken())
----------------
We probably should really have a variant of AnnotatedLine::startsWith() that can start at an arbitrary token. But we can try that in a follow-up.
http://reviews.llvm.org/D20198
More information about the cfe-commits
mailing list