[PATCH] D20198: clang-format: [JS] sort ES6 imports.

Manuel Klimek via cfe-commits cfe-commits at lists.llvm.org
Thu May 19 08:17:53 PDT 2016


klimek added inline comments.

================
Comment at: lib/Format/SortJavaScriptImports.cpp:160
@@ +159,3 @@
+      if (i + 1 < e) {
+        // Insert breaks between imports.
+        ReferencesText += "\n";
----------------
Between categories of imports and imports and exports, right?

================
Comment at: lib/Format/SortJavaScriptImports.cpp:170-171
@@ +169,4 @@
+    // Separate references from the main code body of the file.
+    if (FirstNonImportLine && FirstNonImportLine->First->NewlinesBefore < 2)
+      ReferencesText += "\n";
+
----------------
Shouldn't we add 2 if NewlinesBefore is 0? Or is that syntactically impossible?


http://reviews.llvm.org/D20198





More information about the cfe-commits mailing list