Visual Studio - how to make #region stay on left
-
I use the #region "directive" a lot to organize my obviously far too large source files. The trouble is that I want it to stay against the left border of Visual Studio, but the automatic formation moves it out to the code depth. I've looked in the editor settings some, but didn't find it. Anyone know how I might be able to set that? Thanks, Mike
-
I use the #region "directive" a lot to organize my obviously far too large source files. The trouble is that I want it to stay against the left border of Visual Studio, but the automatic formation moves it out to the code depth. I've looked in the editor settings some, but didn't find it. Anyone know how I might be able to set that? Thanks, Mike
Yes. Code in VB.Net :omg: Yes, seriously; in VB.Net the #region "comments" are always aligned to the left-margin, irrespective of code indentation. I can't see a way to replicate that with C# code though. I'm guessing this isn't the answer you were hoping for... ;-) See also Do not indent #region with code – Visual Studio[^]
-
I use the #region "directive" a lot to organize my obviously far too large source files. The trouble is that I want it to stay against the left border of Visual Studio, but the automatic formation moves it out to the code depth. I've looked in the editor settings some, but didn't find it. Anyone know how I might be able to set that? Thanks, Mike
You can't and you shouldn't! :-) I get annoyed because #If does butt to the left! Very annoying.
Keep your friends close. Keep Kill your enemies closer. The End
-
Yes. Code in VB.Net :omg: Yes, seriously; in VB.Net the #region "comments" are always aligned to the left-margin, irrespective of code indentation. I can't see a way to replicate that with C# code though. I'm guessing this isn't the answer you were hoping for... ;-) See also Do not indent #region with code – Visual Studio[^]
Good feedback, other than the code in VB. :) You would think that it should be a user configurable setting available under Tools > Options > Text Editor > C# > Code Style > Formatting > Indentation But it isn't there. I think we should use the the VS Help > Send Feedback option to bug MS about this.
-
I use the #region "directive" a lot to organize my obviously far too large source files. The trouble is that I want it to stay against the left border of Visual Studio, but the automatic formation moves it out to the code depth. I've looked in the editor settings some, but didn't find it. Anyone know how I might be able to set that? Thanks, Mike
Visual studio is very helpful, so for that, I have some different thought about it because I have fully experienced with visual studio. So if you used it when you create so many things. So if you want to know it then Apps Development Services just browse the site.
-
Yes. Code in VB.Net :omg: Yes, seriously; in VB.Net the #region "comments" are always aligned to the left-margin, irrespective of code indentation. I can't see a way to replicate that with C# code though. I'm guessing this isn't the answer you were hoping for... ;-) See also Do not indent #region with code – Visual Studio[^]
Nope. Not the answer. No VB.Net for me. Thanks though.
-
You can't and you shouldn't! :-) I get annoyed because #If does butt to the left! Very annoying.
Keep your friends close. Keep Kill your enemies closer. The End
-
I use the #region "directive" a lot to organize my obviously far too large source files. The trouble is that I want it to stay against the left border of Visual Studio, but the automatic formation moves it out to the code depth. I've looked in the editor settings some, but didn't find it. Anyone know how I might be able to set that? Thanks, Mike
-
That just makes debugging a hassle. Also, my methods are often over 1000 lines long... and don't think of critiquing that. I'm hired to write the big complicated stuff.
-
That just makes debugging a hassle. Also, my methods are often over 1000 lines long... and don't think of critiquing that. I'm hired to write the big complicated stuff.
-
That just makes debugging a hassle. Also, my methods are often over 1000 lines long... and don't think of critiquing that. I'm hired to write the big complicated stuff.
Michael Breeden wrote:
That just makes debugging a hassle.
No, it doesn't; VS will automatically open the correct file for editing and continue there.
Michael Breeden wrote:
I'm hired to write the big complicated stuff.
AKA "large, unmaintainable mess" :suss:
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
re #if, does that not make sense though? Its not supposed to be part of the normal flow, you want it to really stand out.
No, I don't. I'm OCD - it just looks wrong.
Keep your friends close. Keep Kill your enemies closer. The End