Case staments not collapsable in visual D

user1237 user1234 at 1234.de
Sat Nov 3 08:28:23 UTC 2018


On Tuesday, 30 October 2018 at 15:25:28 UTC, Michelle Long wrote:
> On Monday, 29 October 2018 at 07:48:28 UTC, Rainer Schuetze 
> wrote:
>> [...]
>
> case statements are blocks. They might not be represented as 
> such but they are semantically the same as blocks. The 
> representation is irrelevant. Since, in D, every case must end 
> with a break or return or throw, it means that the next case 
> terminates the block automatically.
>
> So, all that needs to be done, if it is possible is to collapse 
> everything up to the next case statement or terminal }.
>
> One could make it general for labels so one could collapse any 
> label statement. Simply terminate up to the next label and or }.

If the "case" deserve folding maybe just add a scope "{}" ? In my 
opinion case statements are often just a one liner, followed bu 
break and don't deserve folding.




More information about the Digitalmars-d-ide mailing list