-
Notifications
You must be signed in to change notification settings - Fork 12
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
Remove unused imports across project/current file #113
Comments
How about also adding "Remove unused imports on save" option? |
@halohalospecial Makes sense to me! I am curious if you have any thoughts to when functionality like this should go into elmjutsu instead of linter-elm-make or vice versa? |
@mybuddymichael |
There are sometimes overlaps though. Like if we want to have a quick fix that also needs parsed info. Just realized that Atom is the only editor/IDE where major Elm support features are spread across different packages/plugins :D |
I'll try and take a look today |
The timing seems a little tricky regarding save/linting/removeImports. The linting happens after save(unless you have on the fly enabled) and because removeImports requires the linter to run first it means that it also can't be run until after save. This means that you have to hit save twice to save the results from removeImports. There doesn't appear to be anyway to force the linting to happen before save because even if I call it explicitly in the onWillSave hook https://github.com/mybuddymichael/linter-elm-make/blob/master/lib/linter-elm-make.js#L407 is async which means that it still runs after save. Potentially I can trigger a second save automatically but preventing an infinite loop is fiddly. Open to ideas if anyone has any. |
So I added a hack that does the job, 33795c8. It does work reliably but you definitely have to hold your nose. |
Should we also have "Add missing type annotations on save" and the "Add Missing Type Annotations" command? |
happy to add these as well |
As I'm just switching to Atom and haven't had the linter running in my editor previously I have a ton of unused imports. It would be fantastic if the following commands existed:
The text was updated successfully, but these errors were encountered: