Skip to content
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

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

Closed
chrisnorman7 opened this issue Mar 12, 2022 · 5 comments
Closed
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Milestone

Comments

@chrisnorman7
Copy link

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.

@DanTup DanTup added this to the v3.38.0 milestone Mar 16, 2022
@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement labels Mar 16, 2022
@DanTup DanTup closed this as completed in 800899e Mar 16, 2022
@DanTup
Copy link
Member

DanTup commented Mar 16, 2022

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

@DanTup DanTup reopened this Mar 16, 2022
@DanTup
Copy link
Member

DanTup commented Apr 4, 2022

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

@DanTup DanTup closed this as completed Apr 4, 2022
@chrisnorman7
Copy link
Author

chrisnorman7 commented Apr 4, 2022 via email

@DanTup
Copy link
Member

DanTup commented Apr 4, 2022

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.

@chrisnorman7
Copy link
Author

chrisnorman7 commented Apr 4, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants