Skip to content

DartFixKind.ADD_CURLY_BRACES_MULTI never shows up #49079

Closed

Description

@guidezpl
  • 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.

Android Studio VSCode
Screen Shot 2022-05-22 at 15 20 33
multifix.mp4

Activity

  1. asashour commented on Jun 29, 2022

    @asashour
    Contributor

    Having a multi option doesn't mean it is used for always_put_control_body_on_new_line. It is used for curly_braces_in_flow_control_structures

    Please see

    LintNames.always_put_control_body_on_new_line: [
    UseCurlyBraces.nonBulk,
    ],

    and the below for explanation

    /// This is used in places where "Use Curly Braces" is a valid manual fix, but
    /// not clearly the only/correct fix to apply automatically, such as the
    /// `always_put_control_body_on_new_line` lint.
    UseCurlyBraces.nonBulk() : canBeAppliedInBulk = false;

  2. added
    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
    on Mar 14, 2024
  3. added
    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
    and removed on Feb 21, 2025
  4. keertip commented on Sep 30, 2026

    @keertip
    Contributor

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.closed-by-an-agentThis label is applied when an issue is closed by an agent.devexp-quick-fixIssues with analysis server (quick) fixestype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions