This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Adds space around angle brackets in text protos
ClosedPublic

Authored by krasimir on Jan 31 2018, 2:19 AM.

Details

Summary

This patch adds spaces around angle brackets in text proto Google style.
Previously these were detected as template openers and closers, which happened
to have the expected effect. Now we detect them as scope openers and closers
similarly to the way braces are handled in this context.

Diff Detail

Repository
rL LLVM

Event Timeline

krasimir created this revision.Jan 31 2018, 2:19 AM
krasimir updated this revision to Diff 132121.Jan 31 2018, 2:21 AM
  • Remove braces around single statement
djasper added inline comments.Feb 2 2018, 4:14 AM
lib/Format/TokenAnnotator.cpp
82 ↗(On Diff #132121)

Here and in many other places, you are only checking against LK_TextProto. However, in LK_Proto, we also have a lot of text-formatted protos in field options. So, most places, these two should result in the same behavior, I think.

2517 ↗(On Diff #132121)

No braces.

krasimir updated this revision to Diff 132964.Feb 6 2018, 3:01 AM
krasimir marked an inline comment as done.
  • Address review comments
krasimir marked an inline comment as done.Feb 6 2018, 3:01 AM
djasper accepted this revision.Feb 6 2018, 3:06 AM

Looks good.

This revision is now accepted and ready to land.Feb 6 2018, 3:06 AM
This revision was automatically updated to reflect the committed changes.