[PATCH] D100466: clang-format: [JS] merge import lines.

Hana Joo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 14 05:33:49 PDT 2021


h-joo added inline comments.


================
Comment at: clang/lib/Format/SortJavaScriptImports.cpp:154
 
+    // Merge module references:
+    // After sorting, find all references that import named symbols from the
----------------
Would it be better if this were a named function?


================
Comment at: clang/lib/Format/SortJavaScriptImports.cpp:164
+    JsModuleReference *PreviousReference = &References[Indices[0]];
+    auto *it = std::next(Indices.begin());
+    bool ImportsMerged = false;
----------------
nit : `It`?


================
Comment at: clang/unittests/Format/SortImportsTestJS.cpp:333
+  // ignores default import
+  verifySort("import X from 'foo';\n"
+             "import {A} from 'foo';\n",
----------------
I'm a bit confused on what this is trying to test. Could you explain?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100466/new/

https://reviews.llvm.org/D100466



More information about the cfe-commits mailing list