This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Fixes indentation of inner text proto messages
ClosedPublic

Authored by krasimir on Jan 24 2018, 1:12 PM.

Details

Summary

Consider the text proto:

message {
  sub { key: value }
}

Previously the first { was TT_Unknown, which caused the inner message to be
indented by the continuation width. This didn't happen for:

message {
  sub: { key: value }
}

This is because the code to mark the first { as a TT_DictLiteral was only
considering the case where it marches forward and reaches a :.

This patch updates this by looking not only for :, but also for < and {.

Diff Detail

Repository
rL LLVM

Event Timeline

krasimir created this revision.Jan 24 2018, 1:12 PM
djasper accepted this revision.Jan 24 2018, 1:40 PM

Looks good

This revision is now accepted and ready to land.Jan 24 2018, 1:40 PM
This revision was automatically updated to reflect the committed changes.