Page MenuHomePhabricator

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

Authored by jbcoe on Mar 6 2020, 9:57 AM.



Flag '= {' as a braced init list when parsing C# code.

Diff Detail

Event Timeline

jbcoe created this revision.Mar 6 2020, 9:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2020, 9:57 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
krasimir requested changes to this revision.Mar 9 2020, 10:17 AM
krasimir added inline comments.

A more general approach might be to adapt parseBracedList() itself to mark the block kind BK_BracedInit:

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.

This revision now requires changes to proceed.Mar 9 2020, 10:17 AM
jbcoe marked an inline comment as done.Mar 13 2020, 7:57 AM
jbcoe added inline comments.

Setting block kind inside parseBracedList() caused test failures outside of C# tests.

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

krasimir accepted this revision.Mar 23 2020, 7:12 AM

This is OK with the comment in the code. Thank you!

This revision is now accepted and ready to land.Mar 23 2020, 7:12 AM
jbcoe updated this revision to Diff 252028.Mar 23 2020, 7:22 AM

Rebase and update patch.

This revision was automatically updated to reflect the committed changes.