Roslyn: Incorrect VB code collapsing in VS2015 update 1

Created on 25 Feb 2016  Â·  16Comments  Â·  Source: dotnet/roslyn

The following code does not collapse in the same ways as in VS2013 when ctrl-M and Ctrl-O is pressed

Module Module1

Region "asif"

Private Sub method1()

End Sub

End Region

Region "asif1"

Private Sub method2()

End Sub

End Region

End Module

I have brought this issue to: Dustin Campbell Dustin.[email protected]

vs2013codefolding
vs2015codefolding

The attached files shows the difference

Area-IDE Bug

All 16 comments

Same VB Region Collapse issue occurring in Visual Studio 2015 Update 2. Kinda thought this would get addressed. Disappointing.

HI,
I thought the fix will be targeted for update 3.
Being a code editor bug/ intellisense issue, they are usually of a lower
priority.

On Saturday 09 April 2016 01:36 PM, erictor wrote:

Same VB Region Collapse issue occurring in Visual Studio 2015 Update

  1. Kinda thought this would get addressed. Disappointing.

—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/dotnet/roslyn/issues/9189#issuecomment-207740964

This seems by design. regions are not 'definitions'. If we put in this behavior then people wanting to actually see the definitions in their file would have to collapse, then expand all the region sections.

I'm going to add an option to control this behavior for people that want it.

@CyrusNajmabadi If it's any consolation, it collapses regions in C# (and has for years in all previous version of VS). I know myself and my team would greatly appreciate the change so that it collapses regions also (even if by option).

it doesn't seme to collapse regions in C# when i try it locally. Strange.

@CyrusNajmabadi KeithPGR stated this correctly, I can vouch for it. "It [Visual Studio] collapses regions in C# and has for years in all previous version of VS." I would simply add to that, that it has always collapsed regions in VB.NET prior to Visual Studio 2015.

The fact that Outlining | Collapse to Definitions does not, locally for you when using Visual Studio 2015, collapse C# regions (in addition to functions, etc.) when you invoke it, is indeed puzzling - I would wonder if there's something non-standard/non-default about your particular install of Visual Studio 2015. Please review this behavior on other installations of Visual Studio 2015, and install a previous version of Visual Studio such as 2013, 2012, 2010, etc., and observe the behavior for _both_ C# and VB.NET code modules.

Outlining | Collapse to Definitions not collapsing the regions as well as code areas is a _departure_ from functionality that has always been true about Visual Studio.

I concur that providing the option to adjust the behavior as desired does get us there; I just wanted to point out what the default behavior has always been. Thank you.

@CyrusNajmabadi Can you explain why this was closed? Outlining | Collapse to Definitions in C# collapses regions but still does does not collapse regions in VB in VS2015 Update 3. In fact, if regions are collapsed, Outlining | Collapse to Definitions opens them. I verified that Outlining | Collapse to Definitions collapsed regions in VB in Visual Studio 2013 and Visual Studio 2010.

@isburns What is the value of this checkbox:
image

You can find it in:

Tools | Option | Text Editor | C#/Basic | Advanced

@CyrusNajmabadi Can you explain why this was closed?

Because we added an option to allow users to specify the behavior they want. that way you can get whichever feels best to you.

@CyrusNajmabadi I do not have that option. I'm running Visual Studio Community 2015, Version 14.0.25431.01 Update 3.

vs options

Isn't the C# options a weird place to put this option anyway, as it's the VB environment that it's not working in?

Also, I figured maybe you misspoke and meant that the option is in the VB section, but it isn't there either.

I have no available updates for VS.

Visual Studio Community 2015, Version 14.0.25431.01 Update 3.

This issue was fixed for VS2017. We do not have any plans to backport these fixes to VS2015.

Isn't the C# options a weird place to put this option anyway,

There are individual options for both C# and VB. Hence "Tools | Option | Text Editor | C#/Basic | Advanced"

That was shorthand for writing:

Tools | Option | Text Editor | C# | Advanced
Tools | Option | Text Editor | Basic | Advanced

I missed your "/Basic" part. My apologies.

Sad to hear this change only went into 2017, but I guess we're moving to it soon anyway. Thank you.

In general, unless an issue is super bad (i.e. things like crashes/etc.) then it's always going to be going into whatever release is 'next'. This is usually a VS update. But this time the 'next' release was the next version of VS.

Was this page helpful?
0 / 5 - 0 ratings