This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Break on AfterColon only if not followed by comment
ClosedPublic

Authored by owenpan on Jul 3 2022, 6:36 PM.

Details

Diff Detail

Event Timeline

owenpan created this revision.Jul 3 2022, 6:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 3 2022, 6:36 PM
owenpan requested review of this revision.Jul 3 2022, 6:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 3 2022, 6:36 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
curdeius added inline comments.Jul 3 2022, 10:19 PM
clang/unittests/Format/FormatTest.cpp
7099

You should add a test without modifying an existing one.

curdeius added inline comments.Jul 3 2022, 10:20 PM
clang/unittests/Format/FormatTest.cpp
7136

How about very long comments? They don't get split now? Please add a test case

owenpan updated this revision to Diff 442016.Jul 3 2022, 11:54 PM

Handle PackContructorInitializers: NextLine and address review comments.

owenpan marked 2 inline comments as done.Jul 3 2022, 11:58 PM
curdeius accepted this revision.Jul 4 2022, 12:55 AM

LGTM. Thanks for addressing my comments.

This revision is now accepted and ready to land.Jul 4 2022, 12:55 AM

LGTM. Thanks for addressing my comments.

Thank you for your quick review and good comments as always!

clang/unittests/Format/FormatTest.cpp
7136

Now trailing comments don't wrap after the colon, but long ones still get split and aligned as usual.

This revision was landed with ongoing or failed builds.Jul 4 2022, 12:35 PM
This revision was automatically updated to reflect the committed changes.