-
Notifications
You must be signed in to change notification settings - Fork 323
Code folding for switch
statements
#4506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Fixes Dart-Code/Dart-Code#4506. Change-Id: Idd5924d04e9ffffc49f088ca6884393ea72e9bea Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298120 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This landed in dart-lang/sdk@528c75a. It's entirely a language server change so will show up with a new SDK release and doesn't require an extension update. |
not working for me at VScode, using latest version of the SDK @DanTup |
@Fernandomr88 the change was made after the branch for the last SDK (Dart 3.0), so it will show up in a future SDK release (3.1, etc.). It should be available on beta/dev/master channels already. |
sorry for my mistake @DanTup, hadn't noticed that "tiny" detail lol, looking forward for that release |
@DanTup hey Dan, any hint on when this will be released? |
@Fernandomr88 this change shipped in Dart 3.1 / Flutter 3.13. It seems to work in my testing: folding.mp4If you have code where it doesn't work, could you file a new issue with an explicit (complete) code sample so I can test with it? Please also include your exact SDK version. Thanks! |
Hey @DanTup , it worked indeed. Sorry for the mess, I was commuting and remembered this and asked 🫠 |
Great, thanks for confirming :-) |
@DanTup should I open an issue for this case too? or is it meant to be like this? |
@Fernandomr88 generally we've only added folding regions for things that have been requested (in part because VS Code used to have a fairly low limit on how many folding regions it would support, so having too many resulted in warnings being shown). If there are things you'd like to fold that aren't currently foldable, please do file additional issues :-) Thanks! |
With the addition of patterns to the Dart language, it would be nice if code folding could be used on
switch
statements, much as it can be used for other control flow such asif
statements.For example, given the code:
It would be nice to be able to collapse individual cases, e.g.
Or to collapse the entire switch statement:
switch (expr) {… }
The text was updated successfully, but these errors were encountered: