[PATCH] D52800: Java import sorting in clang-format

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 3 13:38:40 PDT 2018


krasimir added a comment.

Another example: we have to be careful with something like this as we don't want to break correct code:

  import x;
  import a.loooooong.
    c;
  import y;



================
Comment at: unittests/Format/SortImportsTestJava.cpp:130
+                 "// that do\n"
+                 "// nothing\n",
+                 Ranges));
----------------
krasimir wrote:
> I wonder what happens if there are comments between import statements and comment lines after import statements. Consider adding some tests for that.
Specifically, as discussed, we wanna keep comments about imports together with them when we reorder stuff around.


Repository:
  rC Clang

https://reviews.llvm.org/D52800





More information about the cfe-commits mailing list