Skip to content

"Extract Method" should run checks before asking for a method name #3872

Closed

Description

@chrisnorman7

When choosing the "Extract Method" option from the refacturing menu, you are asked for the name before the plugin checks if the closure can be extracted.

It would seem more ergonomic to perform checks before asking for the name, so that the plugin isn't offering to let you do something that will ultimately fail.

Activity

  1. added this to the v3.38.0 milestone on Mar 16, 2022
  2. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Mar 16, 2022
  3. DanTup commented on Mar 16, 2022

    @DanTup
    Member

    This isn't done yet - it needs an SDK change to match.

  4. reopened this on Mar 16, 2022
  5. DanTup commented on Apr 4, 2022

    @DanTup
    Member

    SDK work landed in dart-lang/sdk@f4b273e.

  6. chrisnorman7 commented on Apr 4, 2022

    @chrisnorman7
    Author
  7. DanTup commented on Apr 4, 2022

    @DanTup
    Member

    np, thanks for the report!

    To get the fix, you'll need the new version of Dart-Code (hopefully shipping today) and also a Dart SDK with the change above (and its version number must be at least 2.17.0). I don't know when the SDKs will next ship, but it'll just automatically start working once you have all the relevant versions.

  8. chrisnorman7 commented on Apr 4, 2022

    @chrisnorman7
    Author
  9. added a commit that references this issue on Sep 2, 2025
    800899e
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

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions