This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] [PR41187] moves Java import statements to the wrong location if code contains statements that start with the word import
ClosedPublic

Authored by MyDeveloperDay on Mar 22 2019, 2:59 AM.

Details

Summary

Import sorting of java file, incorrectly move import statement to after a function beginning with the word import.

Make 1 character change to regular expression to ensure there is always at least one space/tab after the word import

Previously clang-format --style="LLVM" would format

import X;

class C {
  void m() {
    importFile();
  }
}

as

class C {
  void m() {
    importFile();
import X;
  }
}

Diff Detail

Event Timeline

MyDeveloperDay created this revision.Mar 22 2019, 2:59 AM
This revision is now accepted and ready to land.Mar 25 2019, 4:29 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2019, 6:05 AM