Enumerator initializer alignment
Would it be possible to get this feature for C# resharper?
https://resharper-support.jetbrains.com/hc/en-us/community/posts/360009524160-enum-value-indentation
The option to indent enum values on code cleanup would be amazing
Please sign in to leave a comment.
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!
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.
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!
Upload id: 2024_01_11_cfN4BfL8aVxktyaKkShbmf (file: ResharperProject.zip)
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.
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!