-
Notifications
You must be signed in to change notification settings - Fork 347
Remove suggested imports completely #1121
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
Conversation
Do not leave blank line when removing import statement. Now covers multiline imports properly when remove or comment out option selected. Tidy up tests a bit.
@gracjan I have no good test case for this. |
Remove suggested imports completely
This is a regression! 😱 I'm reverting this PR. @geraldus The reason this feature only blanks (rather than removes) the line and does not remove it is because then any future import line removals will have the wrong line number. Try this feature on this module: module X where
import Data.Char
import Data.Foldable
import Prelude
import Control.Monad
x :: ()
x = () It prompts: (1) So leaving the import lines there is the solution I went with.
If you want to do that work, feel free. 👍 I might do it myself, but let's coordinate in this PR if one of us starts working on it. |
@chrisdone ahh, I've noticed some issues with this, but haven't time to investigate what's going on, thanks. I think I could take second approach. |
@geraldus Cool! 👍 |
@chrisdone, by the way, we have discussed this a bit earlier and decided, that rather prompting user during loading process it is much better to inform him that there are redundant imports and suggest to run some command manually to remove/comment out this stuff. The issue with current behavior (at least for me) that I usually miss this prompts and wait for some time before I finally realize that I have to answer what to do. Also another a bit annoying thing is that I have to save manually all modified files. So, I want to know other people opinion about following two points:
Ping @gracjan and other active people |
I'd imagine overlays (similar to those provided by Flycheck), with the ability to navigate between them and then do fixups. Then we could have overlays signaling errors and warnings and some of those could have one (or more) automatic actions associated. |
Can removing imports be done from the end? |
@vlatkoB in this case we need some stack of all redundant imports. I'm going to implement this soon #1109 (comment) |
Do not leave blank line when removing import statement.
Now covers multiline imports properly when remove or comment out option
selected.
Will think about some test, don't merge yet.
Fixes #1109