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

Jonathan B Coe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 13 08:01:20 PDT 2020


jbcoe marked an inline comment as done.
jbcoe added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1443
+        if (Style.isCSharp())
+          FormatTok->BlockKind = BK_BracedInit;
         nextToken();
----------------
krasimir wrote:
> 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.
Setting block kind inside parseBracedList() caused test failures outside of C# tests.

I was hoping to make this surgical for now, hence the comment.


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