Single line methods have their body pushed to the next line
Environment
- Visual Studio version:2022 Professional
- CodeMaid version: 2.0
- Code language: C#
Description
Default settings of codemaid, have the foillowing method

Run code cleanup, and have the brackets + return moved to the next line

Not only do I not want it to move it, it also seems to format it very oddly by leaving the brackets and return on the same line.
Steps to recreate
- Create a new project
- Create a single line method as shown above
- Run code cleanup, the body gets pushed to the next line.
Current behavior
It pushes the body to a single line below the method name.
Expected behavior
I'm expecting it to not push the code to the next line at all, and if it does, that it alteast ensures that its formatted correctly by having the brackets and content all on seperate lines.
Thanks for reporting the issue. I have been able to reproduce it. It appears to fall under the bucket of issues caused by a breaking change to the VS SDK related to access modifiers. If you disable "Insert explicit access modifiers on methods" it behaves as expected (return statement and braces all on their own line). Link to #879 for more details on the root SDK issue.
any new versions?
I'm definitely seeing this one myself, though this is just with using snippets. I swear it worked fine at first, but now it's definitely adding extra lines. I feel like it may have something to do with Visual Studio's snippet implementation, if that's what codemaid is leveraging. It's also interesting in that I have a class skeleton template that I use that does not have this issue. Maybe that advises some direction here.
I think this project is not maintained anymore