Visual D 0.48-beta1
Rainer Schuetze
r.sagitario at gmx.de
Fri Dec 14 18:49:12 UTC 2018
On 14/12/2018 03:25, Michelle Long wrote:
> Small request on the latest release.
>
> You added the ability to collapse case statements, which is nice. The
> only problem I'm having which is just annoying more than anything else
> is that the collapse bleeds over to the next case statement's header
> comments:
>
>
> case 1:
> ....
> break;
>
>
> // Case 2
> case2:
>
>
> When collapsing case 1, the comment will get folded along with it.
>
>
> As a simple work around I suggest:
>
> You go to the next case(or default or closing }) and then backtrack to
> fight the last return, break, throw, or goto and then everything in
> between will either go with the second case, or be split up based
> "closeness" to the case statement.
>
>
>
> the idea is to handle footer comments of the previous case:
>
> case 1:
> ....
> break;
> // that was case 1
>
> // Case 2
> case2:
>
>
> Here the nl will break the two apart but mainly because // Case 2 is
> right next to case 2.
>
>
>
> Or simply attack all connected comments preceding the case statement to
> the case statement(within scope of course).
>
> Thanks.. Seems VD is starting to shape up! ;)
Yes, keeping the comment above the case makes sense. I guess it's very
uncommon to have a comment after the end of the previous case block (or
almost any block), but the newline rule sounds good, too.
In C++ I tend to add "// fallthrough" right there if I actually don't
want to break, but that's not how it works in D.
More information about the Digitalmars-d-ide
mailing list