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

Martin Probst via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 14 08:06:32 PDT 2021


mprobst marked 3 inline comments as done.
mprobst added inline comments.


================
Comment at: clang/lib/Format/SortJavaScriptImports.cpp:92
+  // reference needs re-formatting.
+  bool SymbolsMerged;
   // The source location just after { and just before } in the import.
----------------
FYI I restructured the algorithm a bit here.


================
Comment at: clang/unittests/Format/SortImportsTestJS.cpp:333
+  // ignores default import
+  verifySort("import X from 'foo';\n"
+             "import {A} from 'foo';\n",
----------------
h-joo wrote:
> I'm a bit confused on what this is trying to test. Could you explain?
This makes sure we don't collapse `import * as foo` imports with `import {A}` style imports.


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