This revision was automatically updated to reflect the committed changes.
mprobst marked 2 inline comments as done.
Closed by commit rL270203: clang-format: [JS] sort ES6 imports. (authored by
mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20198?vs=57795=57922#toc
Repository:
mprobst marked 2 inline comments as done.
mprobst added a comment.
Thanks for the review, appreciated!
Comment at: lib/Format/SortJavaScriptImports.cpp:160
@@ +159,3 @@
+ if (i + 1 < e) {
+// Insert breaks between imports.
+ReferencesText += "\n";
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?
mprobst updated this revision to Diff 57795.
mprobst added a comment.
- ranges
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
lib/Format/FormatTokenLexer.cpp
lib/Format/FormatTokenLexer.h
mprobst updated this revision to Diff 57794.
mprobst added a comment.
- correctly insert breaks after import block
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
klimek accepted this revision.
klimek added a comment.
lg
http://reviews.llvm.org/D20198
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mprobst updated this revision to Diff 57637.
mprobst marked an inline comment as done.
mprobst added a comment.
- address review comments
- - extract parseModuleReferences
- more review comments
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
mprobst marked 4 inline comments as done.
Comment at: lib/Format/SortJavaScriptImports.cpp:216-217
@@ +215,4 @@
+break;
+ Current = Line->First;
+ LineEnd = Line->Last;
+ skipComments();
klimek wrote:
> Both of these are used only once,
klimek added a comment.
We're getting there. Couple of nits left.
Comment at: lib/Format/SortJavaScriptImports.cpp:94-97
@@ +93,6 @@
+// Side effect imports might be ordering sensitive. Consider them equal so
+// that they maintain their relative order in the stable
mprobst added a comment.
PTAL.
http://reviews.llvm.org/D20198
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mprobst updated this revision to Diff 57621.
mprobst marked 2 inline comments as done.
mprobst added a comment.
- address review comments
- - extract parseModuleReferences
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
mprobst marked 6 inline comments as done.
mprobst added a comment.
PTAL.
Comment at: lib/Format/SortJavaScriptImports.cpp:93-96
@@ +92,6 @@
+return LHS.Category < RHS.Category;
+ if (LHS.Category == JsModuleReference::ReferenceCategory::SIDE_EFFECT)
+// Side effect
klimek added inline comments.
Comment at: lib/Format/SortJavaScriptImports.cpp:46-47
@@ +45,4 @@
+// An ES6 module reference.
+//
+// ES6 implements a module system, where individual modules (~= source files)
+// can reference other modules, either importing symbols from them, or
mprobst updated this revision to Diff 57497.
mprobst marked 8 inline comments as done.
mprobst added a comment.
- address review comments
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
klimek added inline comments.
Comment at: include/clang/Format/Format.h:855
@@ -854,1 +854,3 @@
+// \brief Returns a string representation of ``Language`` for debugging.
+inline StringRef getLanguageName(FormatStyle::LanguageKind Language) {
s/for debugging/.
mprobst updated this revision to Diff 57440.
mprobst marked an inline comment as done.
mprobst added a comment.
- review comments
http://reviews.llvm.org/D20198
Files:
include/clang/Format/Format.h
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
mprobst updated this revision to Diff 57438.
mprobst marked an inline comment as done.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports/
- includes
- address review comments
- pull out implementations from header files.
- support side effect
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
I think, this looks good.
Manuel: Are you fine with this, design-wise?
Comment at: lib/Format/SortJavaScriptImports.cpp:77
@@ +76,3 @@
+return false;
+ // NB: empty
mprobst updated this revision to Diff 57138.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports/
- includes
- address review comments
- pull out implementations from header files.
- support side effect imports, keep in relative order at top.
mprobst added a comment.
PTAL.
Comment at: lib/Format/SortJavaScriptImports.cpp:162
@@ +161,3 @@
+std::string ImportsText;
+for (unsigned i = 0, e = Indices.size(); i != e; ++i) {
+ JsImportExport ImpExp = Imports[Indices[i]];
djasper wrote:
> Is
mprobst updated this revision to Diff 57073.
mprobst marked 9 inline comments as done.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports/
- includes
- address review comments
- pull out implementations from header files.
djasper added inline comments.
Comment at: lib/Format/Format.cpp:21
@@ -19,1 +20,3 @@
#include "TokenAnnotator.h"
+#include "FormatTokenLexer.h"
+#include "TokenAnalyzer.h"
Use clang-format to fix the order :-)
Comment at:
mprobst updated this revision to Diff 57039.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports/
- includes
http://reviews.llvm.org/D20198
Files:
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
mprobst marked 2 inline comments as done.
mprobst added a comment.
http://reviews.llvm.org/D20198
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mprobst updated this revision to Diff 57037.
mprobst added a comment.
- extract TokenAnalyzer.h and SortJavaScriptImports.h/cpp
- clean up imports
http://reviews.llvm.org/D20198
Files:
lib/Format/CMakeLists.txt
lib/Format/Format.cpp
lib/Format/FormatToken.h
djasper added a comment.
Just two high-level comments. Will review in more depth later.
Comment at: include/clang/Format/Format.h:770
@@ +769,3 @@
+/// ``export`` blocks are affected by ``Ranges``.
+tooling::Replacements sortJavaScriptIncludes(const FormatStyle ,
+
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
This change automatically sorts ES6 imports and exports into four groups:
absolute imports, parent imports, relative imports, and then exports. Exports
are
27 matches
Mail list logo