You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DartFixKind.ADD_CURLY_BRACES_MULTI never shows up #49079
Dart SDK Version: Dart SDK version: 2.18.0-127.0.dev (dev) (Tue May 17 17:35:09 2022 -0700) on "macos_arm64"
I'm trying to efficiently apply this fix for always_put_control_body_on_new_line to a bunch of files but the "fix everywhere in file option" never appears, whether in Android Studio or VSCode, even when the file is opened and focused.
This is resolved. Shortly after this was filed, https://dart-review.googlesource.com/c/sdk/+/246120 (in 2.18.0-152.0.dev) registered "Add curly braces" as a fix for always_put_control_body_on_new_line, with single-file applicability. So "Add curly braces everywhere in file" is now offered for this lint. It is not applied by dart fix, because braces are not the only valid fix for that lint.
Verified on a local build of main (3.14.0-edge.17e7a7c8bdb3ecc5cfcdf15d39daf2bd0ae8b443): ControlBodyOnNewLineInFileTest in pkg/analysis_server/test/src/services/correction/fix/use_curly_braces_test.dart, which covers the fix-all-in-file result for this lint, passes.
If there is more work to do here, please let us know by filing a new issue with up to date information. Thanks!
Activity
asashour commentedon Jun 29, 2022
Having a multi option doesn't mean it is used for
always_put_control_body_on_new_line. It is used forcurly_braces_in_flow_control_structuresPlease see
sdk/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
Lines 360 to 362 in eec1494
and the below for explanation
sdk/pkg/analysis_server/lib/src/services/correction/dart/use_curly_braces.dart
Lines 23 to 26 in eec1494
keertip commentedon Sep 30, 2026
This is resolved. Shortly after this was filed, https://dart-review.googlesource.com/c/sdk/+/246120 (in 2.18.0-152.0.dev) registered "Add curly braces" as a fix for
always_put_control_body_on_new_line, with single-file applicability. So "Add curly braces everywhere in file" is now offered for this lint. It is not applied bydart fix, because braces are not the only valid fix for that lint.Verified on a local build of
main(3.14.0-edge.17e7a7c8bdb3ecc5cfcdf15d39daf2bd0ae8b443):ControlBodyOnNewLineInFileTestinpkg/analysis_server/test/src/services/correction/fix/use_curly_braces_test.dart, which covers the fix-all-in-file result for this lint, passes.If there is more work to do here, please let us know by filing a new issue with up to date information. Thanks!