-
Notifications
You must be signed in to change notification settings - Fork 742
Closed as duplicate of#7974
Description
Environment data
VS Code version: Version: 1.81.1 (user setup)
C# Extension version: v2.0.436
Steps to reproduce
- Create a new .cs file with the following code:
long foo = new Random().Next(1,10);
if (foo == 1) {
Console.WriteLine("Foo is totally one");
} else {
Console.WriteLine("Foo is absolutely not one").
}Note: The bracket style is important.
- Fold the if statement.
Expected behavior
Line 3, with the "Foo is totally one" writeline gets folded in and hidden, while preserving the } else { to make it clear when the still visible line 5 is executed.
Actual behavior
The code fold is really misleading if one does not notice that the fold is active:
Additional context
I know that the bracketing style in this example is not the recommended style. But there is no reason for the folding to behave like this. :)
I also tried the same scenario in JavaScript in VS Code and the misleading fold does not happen there.
Reactions are currently unavailable

