diff options
| author | Krasimir Georgiev <krasimir@google.com> | 2017-07-06 13:58:29 +0000 |
|---|---|---|
| committer | Krasimir Georgiev <krasimir@google.com> | 2017-07-06 13:58:29 +0000 |
| commit | 47f21ef2af0a2ebfbf99a3e926577c35cc508bfd (patch) | |
| tree | ee3e86ee83c39a59c61cd544f735442109cef162 /clang/lib/Format | |
| parent | 761e5b9310c8ca101c26909a24c440bfc69bf827 (diff) | |
| download | bcm5719-llvm-47f21ef2af0a2ebfbf99a3e926577c35cc508bfd.tar.gz bcm5719-llvm-47f21ef2af0a2ebfbf99a3e926577c35cc508bfd.zip | |
[clang-format] Add space between a message field key and the opening bracket in proto messages
Summary:
This patch updates the formatting of message fields of type `a{...}` to `a {...}`
for proto messages.
Reviewers: djasper
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D35015
llvm-svn: 307261
Diffstat (limited to 'clang/lib/Format')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 821c33a3384..d0d30bcb421 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -2301,6 +2301,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, if (Right.is(tok::l_paren) && Left.isOneOf(Keywords.kw_returns, Keywords.kw_option)) return true; + if (Right.isOneOf(tok::l_brace, tok::less) && Left.is(TT_SelectorName)) + return true; } else if (Style.Language == FormatStyle::LK_JavaScript) { if (Left.is(TT_JsFatArrow)) return true; |

