Moved from https://github.com/Microsoft/vscode/issues/9661:
Regions must be in the same tab. It would be great to allow us to fold no matter if they are in the same tab or not.


Steps to Reproduce:
Hmmm... I wonder if this is fixed with #631.
It doesn't. I did notice that csharp.json has this section:
"foldingStartMarker": "^\\s*#\\s*region|^\\s*/\\*|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))",
"foldingStopMarker": "^\\s*#\\s*endregion|^\\s*\\*/|^\\s*\\}",
There are two issues:
/ should be escaped \/ or in this case because they are in a string block \\/I haven't investigated folding in VS Code either, so I was curious if it gathered information from the syntax grammar. Will take a closer look in the near future
Similar to #567
Probably same issue, but note that they don't seem to work at column 0 ...
Any updates on this issue? I can confirm that it's still the same, I use version 1.6.1 on Mac OS X
Unfortunately, no there isn't any update on this one yet.
I would like to add another quirk to this bug, the folding matches on the next '#' not the end of the region. For example;
``` C#
//Some code
//Some conditional code
//Bit more code
```
If you fold the FOO region it collapses to the 'BAR' part of the #if.
Just updating everyone here. The problem is that we don't actually have a way to add custom folding in VS Code today. There is an issue tracking this: https://github.com/Microsoft/vscode/issues/3422.
@DustinCampbell
OmniSharp wont support folding on #region until VS Code fix stuff at their side? Sad
@guoboism: I'm confused by your comment. There's actually no way for us to do it until we have API from VS Code to make it possible.
We now have an API from VS Code that will allow us to fix issues like this one. I'm tracking that work at https://github.com/OmniSharp/omnisharp-vscode/issues/2335.
Most helpful comment
I would like to add another quirk to this bug, the folding matches on the next '#' not the end of the region. For example;
``` C#
region FOO
if BAR
endif
endregion
```
If you fold the FOO region it collapses to the 'BAR' part of the #if.