[all-commits] [llvm/llvm-project] 03c597: clang-format: [JS] sort import aliases. Users can ...

Martin Probst via All-commits all-commits at lists.llvm.org
Fri Jan 28 02:52:10 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 03c59765b3eb2f2233728da8e16637f802147d66
      https://github.com/llvm/llvm-project/commit/03c59765b3eb2f2233728da8e16637f802147d66
  Author: Martin Probst <martin at probst.io>
  Date:   2022-01-28 (Fri, 28 Jan 2022)

  Changed paths:
    M clang/lib/Format/SortJavaScriptImports.cpp
    M clang/unittests/Format/SortImportsTestJS.cpp

  Log Message:
  -----------
  clang-format: [JS] sort import aliases. Users can define aliases for long symbols using import aliases:

    import X = A.B.C;

Previously, these were unhandled and would terminate import sorting.
With this change, aliases sort as their own group, coming last after all
other imports.

Aliases are not sorted within their group, as they may reference each
other, so order is significant.

This reverts commit f750c3d95a0c8bf1d21380ae753fce12010a7561. It fixes
the msan issue by not parsing past the end of the line when handling
import aliases.

Differential Revision: https://reviews.llvm.org/D118446




More information about the All-commits mailing list