clang-format: [JS] sort ES6 imports.
Summary: This change automatically sorts ES6 imports and exports into four groups: absolute imports, parent imports, relative imports, and then exports. Exports are sorted in the same order, but not grouped further. To keep JS import sorting out of Format.cpp, this required extracting the TokenAnalyzer infrastructure to separate header and implementation files. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D20198 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270203 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Format/Format.h 16 additions, 0 deletionsinclude/clang/Format/Format.h
- lib/Format/CMakeLists.txt 3 additions, 0 deletionslib/Format/CMakeLists.txt
- lib/Format/Format.cpp 24 additions, 781 deletionslib/Format/Format.cpp
- lib/Format/FormatToken.h 2 additions, 0 deletionslib/Format/FormatToken.h
- lib/Format/FormatTokenLexer.cpp 597 additions, 0 deletionslib/Format/FormatTokenLexer.cpp
- lib/Format/FormatTokenLexer.h 97 additions, 0 deletionslib/Format/FormatTokenLexer.h
- lib/Format/SortJavaScriptImports.cpp 385 additions, 0 deletionslib/Format/SortJavaScriptImports.cpp
- lib/Format/SortJavaScriptImports.h 36 additions, 0 deletionslib/Format/SortJavaScriptImports.h
- lib/Format/TokenAnalyzer.cpp 138 additions, 0 deletionslib/Format/TokenAnalyzer.cpp
- lib/Format/TokenAnalyzer.h 108 additions, 0 deletionslib/Format/TokenAnalyzer.h
- unittests/Format/CMakeLists.txt 1 addition, 0 deletionsunittests/Format/CMakeLists.txt
- unittests/Format/SortImportsTestJS.cpp 201 additions, 0 deletionsunittests/Format/SortImportsTestJS.cpp
Loading
Please register or sign in to comment