2

How do I modify the vb.net editor (via add-ins or whatever) to indent nested regions like thus:

#Region "Declared Variables"

    #Region "Private Variables"
        Private _werwer as integer = 0
    #End Region

    #Region "Public Variables"
        Private _DBConnectionString as String = ""
    #End Region

#End Region

What I am NOT looking for: Explanations or opinions of why I or anybody else should not use regions (including SoC). I understand the ways in which it can be abused. I also understand that they can be quite useful when used correctly. For my part, I am dyslexic, and it is very difficult for me to look at a long file of un-outlined code and parse any meaning out of it. I use outlining (regions) to chunk the data into digestible bits to overcome my disabilities that would make coding ridiculously difficult otherwise. If it seems too inconvenient to click on the little plus sign to see some code so that other people with difficulties you do not have CAN read it, you can keep your comments/answers to yourself. Your opinion is not appreciated in this specific context. I understand this paragraph is a little "off-topic" but I have seen other questions like this get completely derailed because SOME people cannot see a use for regions. See https://stackoverflow.com/questions/1476550/any-standard-way-to-divide-a-class-into-regions/1476582#1476582

5
  • Actually, what I stated is that SOME people cannot see a use for regions. Funny how that translated in to "majority" in your mind. This only shows your bias. In fact, I HAVE found several add-ins that do OTHER cool things with regions... just not this. That would seem to refute your statement. So ultimately, to paraphrase what you are saying is... "I can't give any helpful info, BUT I will take this opportunity to interject my opinion that no one likes regions... even though I was asked not to." I'm sorry if this is seems stand-offish, but as I said, I do not want this question derailed.
    – ProtoNoob
    Nov 19, 2013 at 4:22
  • @KarlAnderson - while I agree with the spirit of your advice wholeheartedly (don't bite the hand that feeds you), it was not really help I was receiving. As I stated in my question, I have dyslexia, and code outlining/regions (which give me visual cues so I can digest the information) are EXTREMELY helpful tools. I know a developer who is blind and he loves coding. He uses special tools to help him code, and while those tools are great, those tools NEED the code written in a style that would be counter-intuitive to us to be helpful...
    – ProtoNoob
    Nov 19, 2013 at 4:53
  • Would you tell him "Just stop coding" because you don't like how his code is organized? That is all I'm saying. And that is why I seem not "chill".
    – ProtoNoob
    Nov 19, 2013 at 4:54
  • 1
    My advice is to learn to write VS add-ins and solve this problem yourself. Check out How To: Create An Add-In. Nov 19, 2013 at 5:00
  • +1 While I have already found that, I think it adds something to the conversation. If you are in fact right and NO ONE has done this, I will write it myself.
    – ProtoNoob
    Nov 19, 2013 at 5:16

1 Answer 1

1

Would be interesting to see an addin to do this. I've worked with a number of developers over the years who are dyslexic to varying degrees and one thing they've all done is use regions to help limit the scope of the code they're looking at. Accessibility for users is something thats often overlooked or grudgingly acknowledged by some but accessibility for developers seems to suffer even more. (just my opinion)

There's a post on SO that discusses this and someone's posted a macro to do it. If your document gets smart formatted it undoes the indenting but someone mentioned remappint the smart indent command (Ctrl+K+D) to run smart indent then the macro

How to indent content of region with C#?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.