6 comments

Hello Claire,

thank you for contacting us.

Have you tried to turn on this option: ReSharper | Options | Code Editing | C# | Formatting Style | Tabs, Indents, Alignment  | Align similar code in columns | Other assignments and initializers?

Thank you!

0

Hi Olga, I tried out the setting but it doesn't seem to have made any difference neither when typing nor running code cleanup. Setting it in the .editorconfig also doesn't seem to have made any change.

0
Hello Claire,
thank you for the answer.
Could you please share with us a code snippet where we can reproduce the issue?
You can upload it here: https://uploads.jetbrains.com/
Then please share the Upload ID.
Thank you!
0

Upload id: 2024_01_11_cfN4BfL8aVxktyaKkShbmf (file: ResharperProject.zip)

0

Interestingly, I've kept the option on and (though it still doesn't work on enum initializers) it's been aligning struct initializers

var fruit = new MyStruct { Name            = "Fruit" };
var lastNightsDinner = new MyStruct { Name = "Last Night's Dinner" };
var lunchBox = new MyStruct { Name         = "Lunch Box" };

I don't really like it doing this, so if possible, please don't add the enum aligning functionality to this option, but give it its own setting if possible.

0
Hello Claire,
thank you for the details.
I've created a feature request in YouTrack: https://youtrack.jetbrains.com/issue/RSRP-495588/Add-a-formatting-option-to-align-enumerator-initializers-in-columns, you are welcome to comment on it and vote.
Thank you!
0

Please sign in to leave a comment.