[PATCH] D42727: [clang-format] Adds space around angle brackets in text protos

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 2 04:14:34 PST 2018


djasper added inline comments.


================
Comment at: lib/Format/TokenAnnotator.cpp:82
         CurrentToken->MatchingParen = Left;
-        CurrentToken->Type = TT_TemplateCloser;
+        if (Style.Language == FormatStyle::LK_TextProto)
+          CurrentToken->Type = TT_DictLiteral;
----------------
Here and in many other places, you are only checking against LK_TextProto. However, in LK_Proto, we also have a lot of text-formatted protos in field options. So, most places, these two should result in the same behavior, I think.


================
Comment at: lib/Format/TokenAnnotator.cpp:2517
+  if (Left.is(tok::greater) && Right.is(tok::greater)) {
+    if (Style.Language == FormatStyle::LK_TextProto) {
+      return !Style.Cpp11BracedListStyle;
----------------
No braces.


Repository:
  rC Clang

https://reviews.llvm.org/D42727





More information about the cfe-commits mailing list