Duplicate
I am generating a bunch of code and would like it's initial output (pre ctrl+K, Ctrl+D) to look reasonable. Managing indents is a royal pain and there has to be a utility or class out there I can embed inside of my code generator. I am embedding this into a VS add-in and in a build process so I am not interested in an external program. I need something I can call programatically.
Recommendations?