diff options
author | Krasimir Georgiev <krasimir@google.com> | 2017-08-03 14:17:29 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2017-08-03 14:17:29 +0000 |
commit | ddb19248eb1bea29aaf5c9ed8b1b19e45b08e8e9 (patch) | |
tree | 6f26a5a479b91990fededd9e8d17a933809112e5 /clang/unittests/Format/FormatTestProto.cpp | |
parent | 50f6d3545785b061ece2fad2355bc914912db7cc (diff) | |
download | bcm5719-llvm-ddb19248eb1bea29aaf5c9ed8b1b19e45b08e8e9.tar.gz bcm5719-llvm-ddb19248eb1bea29aaf5c9ed8b1b19e45b08e8e9.zip |
[clang-format] Fix indent of 'key <...>' and 'key {...}' in text protos
Summary:
This patch fixes the indentation of the code pattern `key <...>`and `key {...}` in text protos.
Previously, such line would be alinged depending on the column of the previous
colon, which usually indents too much.
I'm gonna go ahead and commit this since it's a straightforward bugfix.
Reviewers: djasper, klimek
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D36143
llvm-svn: 309941
Diffstat (limited to 'clang/unittests/Format/FormatTestProto.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestProto.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp index ca26c543959..df94d817273 100644 --- a/clang/unittests/Format/FormatTestProto.cpp +++ b/clang/unittests/Format/FormatTestProto.cpp @@ -361,6 +361,19 @@ TEST_F(FormatTestProto, FormatsOptions) { " data1 <key1: value1>\n" " data2 {key2: value2}\n" ">;"); + + verifyFormat("option (MyProto.options) = <\n" + " app_id: 'com.javax.swing.salsa.latino'\n" + " head_id: 1\n" + " data <key: value>\n" + ">;"); + + verifyFormat("option (MyProto.options) = {\n" + " app_id: 'com.javax.swing.salsa.latino'\n" + " head_id: 1\n" + " headheadheadheadheadhead_id: 1\n" + " product_data {product {1}}\n" + "};"); } TEST_F(FormatTestProto, FormatsService) { |