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 | da0b9bb7b03533a4855a395a83a098fecf3f6556 (patch) | |
tree | 44ae4ac4544d83916fa8b24940f8c8aa180e685b /lib/Format | |
parent | f7e486629c1484d91197739790471f291d36867c (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format')
-rw-r--r-- | lib/Format/TokenAnnotator.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Format/TokenAnnotator.cpp b/lib/Format/TokenAnnotator.cpp index 821c33a338..d0d30bcb42 100644 --- a/lib/Format/TokenAnnotator.cpp +++ b/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; |