Fix spaces around typename and [] in C# object initializers.
Details
Diff Detail
Event Timeline
clang/lib/Format/TokenAnnotator.cpp | ||
---|---|---|
2869 | This test feels a bit too rigid: you might additionally want to consider new Type<Param> { and new Type /*comment*/ { and new [] /* comment */ {. | |
2870 | The TT_Unknown is a bit confusing -- why is it needed? If this is a workaround for something, please add it as a comment. We might need to improve the token detection later to allow for more complicated pattern matching. |
clang/unittests/Format/FormatTestCSharp.cpp | ||
---|---|---|
379 | Is this needed for the formatting below? I find it surprising if this controls the spacing before braces. |
clang/lib/Format/TokenAnnotator.cpp | ||
---|---|---|
2869 | Sorry, disregard the patterns with /* comment */ above. I guess the spaces around the comment there are enforced at another place. |
clang/lib/Format/TokenAnnotator.cpp | ||
---|---|---|
2870 | +1 that comment what was Left I think we need to be more specific |
This test feels a bit too rigid: you might additionally want to consider new Type<Param> { and new Type /*comment*/ { and new [] /* comment */ {.
For these you might find the MatchingParen and getPreviousNonComment useful. And example for this is below, at line 2880-2885 in javascript handling.