-
Notifications
You must be signed in to change notification settings - Fork 17
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
Removes falsely used usages! Even while option is not active! #175
Comments
Hm, thanks for the report, that would be pretty nasty, I'll look later today |
Did it start recently? Did you ever tick "Remove unused use-s on save" or did plugin start behave this way on it's own? And what version of phpstorm are you using? I tried your minimal example with Of course, perfectly would be to nail down the exact reason why you get this problems, I'll need your feedback on my questions to do that. |
Just in case, you did mention you have this problem in multiple projects, is this flag unchecked in each of them? That could be a source of confusion, as it's a project wide setting, not IDE wide... Also, does it, per chance, reproduce only when several projects are open at once? There is probably a possibility IDEA keeps one project window focused, and takes setting from this focused project, even though the file in which save handler runs belongs to a different project. Also, do these "falsely used usages" get removed when there are some syntax errors in the file? It's not as bad as behaviour not matching the setting, but that could be fixed as well. |
Also, to be 100% sure, did you try disabling the plugin and restarting the IDEA, does issue not reproduce then? |
Seems to be rather an unfortunate coincidence of several IDE instances/open projects and thus more an exceptional case. |
Hm, thank you very much, will try to play around to reproduce it. Based on your feedback and the code, my main theory is that plugin considers setting on for all open projects if at least one of them has it on. PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document); If my theory is right, the problem is that I assume that IDEA would not allow me to access a document from context of a project that it does not belong to, but probably my assumption was wrong and it would after all. |
The plugin is causing much trouble right now, in some of my projects.
I have not activated the feature "Remove unused use-s on save" even though it removes some usages while saving!
Trouble code e.g. (heavily abridged):
the usage
use Application\Model\Supplier;
is always deleted, while saving.This issue is critical as the plugin is not usable anymore, right now.
The text was updated successfully, but these errors were encountered: