Add test demonstrating how trivia is handled#69448
Add test demonstrating how trivia is handled#69448CyrusNajmabadi merged 1 commit intodotnet:mainfrom
Conversation
sharwell
left a comment
There was a problem hiding this comment.
It looks like the fixed code is missing a trailing comma in two cases.
| [ | ||
| // Leading | ||
| new[] { 1 }, // Trailing | ||
| new int[] { 2 } |
There was a problem hiding this comment.
| new int[] { 2 } | |
| new int[] { 2 }, |
| [ | ||
| // Leading | ||
| [1], // Trailing | ||
| [2] |
|
currently our features do not add a trailing comma, unless they're adding to an existing initializer that already had one. I'm open to updating this decision and adding trailing commas in more places. However, i would like to do that outside of this PR. @sharwell if we did go this route, would you be ok with these rules:
If that fits what you want, i can make a followup PR to encode those rules. Thanks! |
|
Yes, those are exactly the expected rules. I believe we settled on them in an earlier discussion. We should prioritize that work, as the current refactoring produces code which is problematic for maintainability. |
Sure. I'll do tomorrow. |
No description provided.