[PATCH] D75760: [clang-format] Do not indent C# array initialisers as continuations

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 9 10:46:50 PDT 2020


krasimir requested changes to this revision.
krasimir added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1443
+        if (Style.isCSharp())
+          FormatTok->BlockKind = BK_BracedInit;
         nextToken();
----------------
A more general approach might be to adapt parseBracedList() itself to mark the block kind `BK_BracedInit`:
https://github.com/llvm/llvm-project/blob/7d2fdd3f6639731284dd8b6b274f01f04fd19215/clang/lib/Format/UnwrappedLineParser.cpp#L1628

Could you try to see if it will be easy/possible to get the same effect by adapting that?
If that's hard or has unintended side effects, we can reconsider.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75760





More information about the cfe-commits mailing list