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

Unused imports #6

Open
stanch opened this issue Dec 25, 2013 · 2 comments
Open

Unused imports #6

stanch opened this issue Dec 25, 2013 · 2 comments

Comments

@stanch
Copy link

stanch commented Dec 25, 2013

I think local imports (i.e. those not in the file header) are most often added manually and for good reasons (e.g. to select a more appropriate typeclass instance). Unfortunately, your plugin removes such imports if IDEA (wrongly) deems them unused. I’m ok with removing auto-generated stuff, but removing a shadowing typeclass instance will be unnoticed and can lead to crashing code. Maybe it’s a good idea not to remove local imports, what do you think?

@aarondav
Copy link
Owner

Ouch, I didn't know that IntelliJ's import optimizer looked at local imports (my stuff certainly ignores them). Since I just use IntelliJ's stuff to identify and remove unused imports, I'm not sure it'll be possible to fix this issue from my side. Ideally IDEA would be patched to not deem these imports unused, or their optimizer would have an option to leave local imports untouched.

In the meantime, I guess the only solution is to turn off removing unused imports from this plugin's settings if you run into this problem.

@stanch
Copy link
Author

stanch commented Dec 25, 2013

Oh, I see. Fair enough, I will turn it off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants