[PATCH] D34441: [clang-format] Support text proto messages

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 3 07:34:14 PDT 2017


krasimir added inline comments.


================
Comment at: lib/Format/ContinuationIndenter.cpp:107
 
+  if (Style.Language == FormatStyle::LK_TextProto) {
+    State.Stack.back().AvoidBinPacking = true;
----------------
djasper wrote:
> Do we need to set this explicitly here? Is it not enough to set FormatStyle.BinPackParameters to false?
BinPackParameters doesn't work at global scope. We set these explicitly to deal with the message formatting at global scope.


================
Comment at: lib/Format/TokenAnnotator.cpp:657
+        if (Style.Language == FormatStyle::LK_TextProto) {
+          FormatToken *Previous =Tok->getPreviousNonComment();
+          if (Previous && Previous->Type != TT_DictLiteral)
----------------
djasper wrote:
> Missing space...
I don't understand? This has been formatted with clang-format.


https://reviews.llvm.org/D34441





More information about the cfe-commits mailing list