[PATCH] clang-format: [js] Support ES6 module imports.

Daniel Jasper djasper at google.com
Thu Feb 19 07:47:14 PST 2015


================
Comment at: lib/Format/UnwrappedLineParser.cpp:1607
@@ +1606,3 @@
+void UnwrappedLineParser::parseJavaScriptEs6Import() {
+  nextToken();  // 'import'
+  if (FormatTok->is(tok::l_brace)) {
----------------
Maybe:

  assert(FormatTok->is(Keywords.kw_import));

instead of the comment?

================
Comment at: unittests/Format/FormatTestJS.cpp:529
@@ +528,3 @@
+  verifyFormat("import {X, Y} from 'some/module.js';");
+  // TODO(martinprobst): +2 indent only, and handle lists w/o trailing comma.
+  verifyFormat("import {\n"
----------------
The first part seems obsolete and I am not sure what you mean by the second.

http://reviews.llvm.org/D7753

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list