Steps to Reproduce:
Example before folding:
csharp
public void foo() {
// some code...
}
// this empty line will be hidden when folding "foo()"
// this empty line will be hidden when folding "foo()"
// this empty line will be hidden when folding "foo()"
// this empty line will be hidden when folding "foo()"
public string Bar { get; set; }
Example after folding:
csharp
public void foo() { ...
public string Bar { get; set; }
Example of what should occur:
csharp
public void foo() { ...
// this empty line was not folded
// this empty line was not folded
// this empty line was not folded
// this empty line was not folded
public string Bar { get; set; }
I've marked this as a bug, rather than a request, because this is not how folding works with Visual Studio - which only folds code, not whitespace after it. And I assume you're aiming for parity with the IDEs, at least for c# anyway.
This is a really annoying problem, because when code is folded everything is bunched up together and you can't visually separate between them - which is why you'd use empty lines between them.
(The same problem exists for .cshtml files.)
cc @rchande
I wonder if VS is merging the code folding regions or something like that. In VS, we create code folding regions for blocks of comments.
@DustinCampbell When I posted the problem on the vscode repo, I was told vscode doesn't do folding. Not sure what is the problem, but hope that helps.
VS Code has a code folding feature, but we provide the data for it. That said, we haven't actually shipped our side of that feature yet. So, this is an issue that may already be fixed in C# for VS Code. @rchande?
@lonix1 This should be fixed in our next release.
This is fixed - closing.
Before fold:

After fold:
