Case staments not collapsable in visual D

Michelle Long HappyDance321 at gmail.com
Tue Oct 30 15:25:28 UTC 2018


On Monday, 29 October 2018 at 07:48:28 UTC, Rainer Schuetze wrote:
>
>
> On 29/10/2018 03:23, Michelle Long wrote:
>> can't collapse/fold a case statement in the editor for some 
>> reason ;/
>
> Makes sense, but you cannot do this neither in C++ nor C# 
> aswell. I guess that it is this way because semantically 
> "cases" are not statement blocks, but just labels.
>
> BTW: bug reports and enhancements requests are less likely to 
> be forgotten when added to the bug tracking system: 
> https://issues.dlang.org/ (component visuald).

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 }.


More information about the Digitalmars-d-ide mailing list