digitalmars.D.ide - Case staments not collapsable in visual D
- Michelle Long (2/2) Oct 28 2018 can't collapse/fold a case statement in the editor for some
- Rainer Schuetze (7/8) Oct 29 2018 Makes sense, but you cannot do this neither in C++ nor C# aswell. I
- Michelle Long (10/19) Oct 30 2018 case statements are blocks. They might not be represented as such
- Rainer Schuetze (3/27) Nov 03 2018 I wasn't arguing against this, filed an enhancement request:
- user1237 (4/16) Nov 03 2018 If the "case" deserve folding maybe just add a scope "{}" ? In my
- Michelle Long (6/28) Nov 03 2018 Yeah, that might be a solution. It think avoiding having to do
can't collapse/fold a case statement in the editor for some reason ;/
Oct 28 2018
On 29/10/2018 03:23, Michelle Long wrote:can't collapse/fold a case statement in the editor for some reason ;/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).
Oct 29 2018
On Monday, 29 October 2018 at 07:48:28 UTC, Rainer Schuetze wrote:On 29/10/2018 03:23, Michelle Long 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 }.can't collapse/fold a case statement in the editor for some reason ;/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).
Oct 30 2018
On 30/10/2018 16:25, Michelle Long wrote:On Monday, 29 October 2018 at 07:48:28 UTC, Rainer Schuetze wrote:On 29/10/2018 03:23, Michelle Long 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 }.can't collapse/fold a case statement in the editor for some reason ;/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).One could make it general for labels so one could collapse any label statement. Simply terminate up to the next label and or }.I wasn't arguing against this, filed an enhancement request: https://issues.dlang.org/show_bug.cgi?id=19351
Nov 03 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: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.[...]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 }.
Nov 03 2018
On Saturday, 3 November 2018 at 08:28:23 UTC, user1237 wrote:On Tuesday, 30 October 2018 at 15:25:28 UTC, Michelle Long wrote:Yeah, that might be a solution. It think avoiding having to do these types of "hacks" though are important because having to add superfluous stuff to code just to get a desired debugging experience is not good practice. It dirties up the source code adding junk that is not necessary.On Monday, 29 October 2018 at 07:48:28 UTC, Rainer Schuetze wrote: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.[...]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 }.
Nov 03 2018