This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Keep level of comment before an empty line
ClosedPublic

Authored by krasimir on Jul 12 2017, 2:36 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

krasimir created this revision.Jul 12 2017, 2:36 AM
djasper edited edge metadata.Jul 12 2017, 3:41 AM

I still think we should make this dependent on the current indentation. Why do you think this is better?

krasimir updated this revision to Diff 106202.Jul 12 2017, 6:59 AM
  • Switch to original column-based detection
krasimir updated this revision to Diff 106205.Jul 12 2017, 7:06 AM
  • Update switch tests
djasper accepted this revision.Jul 12 2017, 8:09 AM

Some small comments, otherwise looks good.

lib/Format/TokenAnnotator.cpp
1706 ↗(On Diff #106205)

Add a comment a long the lines of:

// If the comment is currently aligned with the line immediately following it,
// that's probably intentional and we should keep it.

And maybe rename s/UpdateLevel/AlignedWithNextLine/

unittests/Format/FormatTest.cpp
855 ↗(On Diff #106205)

Please format this with clang-format.

This revision is now accepted and ready to land.Jul 12 2017, 8:09 AM
krasimir updated this revision to Diff 106220.Jul 12 2017, 8:17 AM
krasimir marked 2 inline comments as done.
  • Address review comments
This revision was automatically updated to reflect the committed changes.