-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Duplicated fixes if 2 imports are unused #60365
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
Comments
CC @FMorschel |
As a side note: it will be very handy to automatically remove all unused / duplicated imports at once. Currently, every case requires manual fix. IntelliJ has an option to optimize imports while reformatting, but this is verry buggy |
IIRC, |
I've checked organize imports and it does not handle duplicated imports if I remember correctly. Also it fixes once at a time |
Btw, comming from Python, Dart with its analyzer, builtin linter and formatter is totally great IMO. Thank you for your great work! |
I've just tested: import 'dart:math' show max, min, Random;
Random? r; In Dart 3.8.0-edge.151edd1aabe115e8b204918f038a93e7ff5b63b2 (2025-03-17) and I can't see this neither in VS Code or IntelliJ. Can you share a repro and the version you found this bug? On this version, I can also use |
Ah, so this was fixed recently. Sorry for confusing. I am using latest stable: 3.7.2 |
It's fine! Always better to notify than to have bugs. Is there anything else this issue should address? Or can we close it? If there is nothing else feel free to close this. I'm not from the team so I can't do that. P.S.: Fixes/assists can always be tested on main at dartpad.dev if you change the channel below on the page. P.S. 2: I found this: |
Yet another case come into my mind, but this may be not possible to achieve. IntelliJ has "Optimize imports" flag (available under "alt+shift+l") and if it could be joined with "organize imports", it will be perfect. But I am aware that it can be outside control. The issue may be closed. Thank you once again and sorry for this whole churn |
I'm not aware if they have a tracker on GH or only on YouTrack. |
Prepare

Right click on any warning
Result
The text was updated successfully, but these errors were encountered: