Page MenuHomePhabricator

[clang-format] Fix aligning of java-style declarations
ClosedPublic

Authored by eoanermine on Jul 13 2022, 3:21 AM.

Details

Summary
  • Modify TokenAnnotator to work fine with java-style array declarations
  • Add test for aligning of java declarations

Closes https://github.com/llvm/llvm-project/issues/55931

Diff Detail

Event Timeline

eoanermine created this revision.Jul 13 2022, 3:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 3:21 AM
eoanermine requested review of this revision.Jul 13 2022, 3:21 AM
eoanermine edited the summary of this revision. (Show Details)Jul 13 2022, 3:22 AM
eoanermine added a comment.EditedJul 13 2022, 3:25 AM

I found that the problem was that TokenAnnotator doesn't handle Java-style array declarations fine. It doesn't consider identifier after square brackets as a StartOfName (see github issue for more context).

I fixed it, it seems valid, but I'm not a hundred percent sure about it.

This revision is now accepted and ready to land.Jul 13 2022, 9:10 AM
HazardyKnusperkeks retitled this revision from Fix aligning of java-style declarations to [clang-format] Fix aligning of java-style declarations.Jul 13 2022, 9:10 AM
curdeius accepted this revision.Jul 13 2022, 10:09 AM
owenpan accepted this revision.Jul 13 2022, 4:21 PM

I don't have an access to commit the patch by myself.

This revision was landed with ongoing or failed builds.Aug 15 2022, 8:27 PM
This revision was automatically updated to reflect the committed changes.