Summary: This patch fixes a bug where the comment indent of comments in text protos gets messed up because by default paren states get created with AlignColons = true (which makes snese for ObjC).
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D43194
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324896
91177308-0d34-0410-b5e6-
96231b3b80d8
// global scope.
State.Stack.back().AvoidBinPacking = true;
State.Stack.back().BreakBeforeParameter = true;
+ State.Stack.back().AlignColons = false;
}
// The first token has already been indented and thus consumed.
" text: \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasaaaaaaaaaa\"\n"
"}");
}
+
+TEST_F(FormatTestTextProto, KeepsCommentsIndentedInList) {
+ verifyFormat("aaaaaaaaaa: 100\n"
+ "bbbbbbbbbbbbbbbbbbbbbbbbbbb: 200\n"
+ "# Single line comment for stuff here.\n"
+ "cccccccccccccccccccccccc: 3849\n"
+ "# Multiline comment for stuff here.\n"
+ "# Multiline comment for stuff here.\n"
+ "# Multiline comment for stuff here.\n"
+ "cccccccccccccccccccccccc: 3849");
+}
+
} // end namespace tooling
} // end namespace clang