`remove all unused imports` should remove all unused imports of the file.
Currently it only removes all unused imports of the current use item and we have no way of doing it for the entire file.
If you select all the use items (or the whole file), I think the assist will work on all of them. Agree that it should maybe do that by default.
I haven't figured out how to do that in neovim
I haven't figured out how to do that in neovim
I think that you can do that with the visual mode
in VS Code there is no way to select all unused?
Removing all unused for a single line saves a well-caffeinated developer maybe hundredths of a second, removing all unused for the file saves seconds.
@evbo you can select the whole file (or just the uses), then trigger the assist. You don't have to go through each of them.
@lnicola thanks and the only reason I don't currently do this is for some reason it also can remove more than what is unused (underlined by the yellow squiggly):
https://github.com/rust-lang/rust-analyzer/issues/18941