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

Import new_library assist should auto-remove unecessary import #55946

Open
FMorschel opened this issue Jun 5, 2024 · 2 comments
Open

Import new_library assist should auto-remove unecessary import #55946

FMorschel opened this issue Jun 5, 2024 · 2 comments
Labels
analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug

Comments

@FMorschel
Copy link
Contributor

When working on Flutter projects, sometimes I extract a Widget to a new file.

While importing the missing dependencies with the assist, sometimes I miss click and import widgets first and then material. Which then warns me about the unnecessary import of widgets.

I believe that the assist should replace the old import if that happens.

@bwilkerson
Copy link
Member

While importing the missing dependencies with the assist ...

Are you manually extracting the widget, or is the 'Move to File' refactoring sometimes not adding the imports automatically?

I believe that the assist should replace the old import if that happens.

That's definitely an interesting idea. I suspect the right way to do that would be to look to see whether the import being added exports an existing import.

@bwilkerson bwilkerson added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-quick-fix labels Jun 6, 2024
@FMorschel
Copy link
Contributor Author

Manually moving. This was before I found out about the new "Move to File" refactor.

@srawlins srawlins added type-enhancement A request for a change that isn't a bug P3 A lower priority bug or feature request labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-quick-fix area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P3 A lower priority bug or feature request type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants