Do not indent #region with code
In C# the #region's follow the code in indentation. I think this is wrong, as they are not a part of the code, and should stay aside - just like they do it in Visual Basic.
I find the C# #region's too obtrusive. Please, change the behaviour, so they are left-aligned in the editor window, both when folded and unfolded.
Would be a real beloved feature. As @Stephen says, should be configurable ...
Would totally love that feature.
Stephen Elms commented
C# #region indentation should be a user configurable setting available under Tools > Options > Text Editor > C# > Code Style > Formatting > Indentation
I agree 100%. #region is not part of the code and with #region indented the code is harder to read. That really annoys me EVERYTIME I see it, so there should be an option, so that we can decide that individually for ourselves.
Data Juggler commented
I think Regions should be indented, and VS 2015 brought in a bug that VS 2013 or below didn't have.
Now every time I paste with an indented region, even with all formatted options turned off, I have to push my code back to the right.
Nathan Wood commented
This should be an option we can enable.
Agreed, I would love this feature to be implemented. #region in line with code just looks messy.
Richard P commented
I so agree, the way VB.Net treats the #Region tags is far more readable - they're not part of the code so why indent them with the code?!
There's a model for this in the C/C++ preprocessing indentation options at some point in the past 5 years. But the current behaviour I think might be a slight bit more magic than any of those options and I would hate to lose it. Anyway, I suggest you ignore this guy who thinks he knows what's best and make it an option instead.
By having the #region #endregion to the far left the code is much easier to read and looks less polluted. At the least we should be able to default the alignment to wherever we like.
I strongly agree !
Or at least make it configurable.