[PATCH] D75517: [clang-format] Do not format C# array subscript operators as attributes

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 3 13:14:07 PST 2020


krasimir accepted this revision.
krasimir added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:376
+
+    // Chains [] in of `identifier[i][j][k]` are not attributes.
+    if (Tok.Previous && Tok.Previous->is(tok::r_square)) {
----------------
nit: `// Chains of [] in ...`


================
Comment at: clang/unittests/Format/FormatTestCSharp.cpp:626
+  // Do not format array subscript operators as attributes.
+  verifyFormat(R"(if (someThings[index].Contains(myThing)) {)", Style);
+  verifyFormat(R"(if (someThings[i][j][k].Contains(myThing)) {)", Style);
----------------
please add a `}` at the end of this examples so that the braces are balanced, otherwise the examples read as incomplete.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75517/new/

https://reviews.llvm.org/D75517





More information about the cfe-commits mailing list