This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Implement comment reflowing
AbandonedPublic

Authored by krasimir on Nov 29 2016, 5:59 AM.

Details

Reviewers
djasper
Summary

Initial draft implementation of comment reflowing.
This is implemented as anoter pass after formatting takes place.
The reflower now takes care of breaking and reflowing comment lines. Reflowing
of comments in preprocessor directives is not supported; for these cases the
original Breakable{Line,Block}Comment still breaks the long lines.

Event Timeline

krasimir updated this revision to Diff 79554.Nov 29 2016, 5:59 AM
krasimir retitled this revision from to [clang-format] Implement comment reflowing.
krasimir updated this object.
krasimir added a reviewer: djasper.
krasimir added a subscriber: ioeric.
krasimir added inline comments.Nov 29 2016, 6:09 AM
unittests/Format/FormatTest.cpp
1631

For the FormatTest.cpp: please keep in mind that almost all of the comment-related tests are affected (not just the ones shown), since the comment breaking is now done by the reflower.

for these cases the
original Breakable{Line,Block}Comment still breaks the long lines.

Do you intend for this to continue to be the case?

djasper added inline comments.Dec 1 2016, 8:06 AM
unittests/Format/FormatTest.cpp
1787

I think it is time that me moved a lot of the comment handling logic into a separate test file.

xazax.hun added inline comments.
lib/Format/Encoding.h
136

Was just skimming through this patch. What is the reason to use a hand written algorithm instead of STL?

krasimir added inline comments.Dec 9 2016, 3:18 AM
lib/Format/Encoding.h
136

Thank you! No reason.

krasimir abandoned this revision.Feb 3 2017, 2:23 AM