I suggest you ...

Allow #region blocks to be indented much like they are in C#

In C# you can indent a #region block so that the region flows with the layout of your code. Unless I am missing something, this is not the case in VB.

Example (C#):
public class MyClass
{

+[VARIABLES]

+[PROPERTIES]

+[METHODS]
}

Example (VB):
Public Class MyClass

+[VARIABLES]

+[PROPERTIES]

+[METHODS]

EndClass

68 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Gregory GammonGregory Gammon shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    Hey Greg,

    Thanks for the great suggestion. I agree that it would be nice to see these indented properly. I honestly couldn’t tell you the reason for this design choice but it applies to all preprocessing directives. Having said that, our team owns both the VB and C# code editor experiences and as we’re rebuilding them as part of Project “Roslyn” we’re trying to be on the look out for opportunities to make the experiences more consistent where it makes sense – this looks to me like one of those cases. The “Roslyn” based editing experience is not planned to be in the next release of Visual Studio but it’s certainly not to early to look at improving this. I’ll follow up with the right folks to see if I can make this happen :)

    Regards,

    -Anthony D. Green, Program Manager, Visual Basic & C# Languages Team

    5 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • RayRay commented  ·   ·  Flag as inappropriate

        How about allow the "normal" hide/show +/- in front of functions/subs that are enclosed in #IF directives? No reason to treat the code inside differently, just because (for the moment) the #IF evaluates to False and all the code in between is gray'd out. Now I just want to look at one of the functions inside the gray area... actually, the +/- are still there in VS 2012 right after changing the controlling #CONST from True to False... but one click inside the gray range and *poof* they disappear.

      • DaveDave commented  ·   ·  Flag as inappropriate

        No no no no no no no!!!! Don't you dare make VB indent regions... that's what makes them readable! I want to find a way to STOP C# from indenting them as they look so bad and UN-readable like that - you can't tell at a glance where the regions start or end - they're just mixed up with all the methods!

      • NEBIRENEBIRE commented  ·   ·  Flag as inappropriate

        Then, you simply, change of language. Vb it's Vb, if was equal C#, then don't be VB. Choose....

      Feedback and Knowledge Base