-
Notifications
You must be signed in to change notification settings - Fork 456
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
visual studio code removes import statements on save #675
Comments
Those imports are not used. If you set |
Has this become the default? Because I surely did not set that one in my settings. Where else can it come from? This is a dangerous thing because if you save with syntax errors, maybe just a curly brace too many, it will happily remove most of your imports. |
@MarcelloPerathoner sounds similar to #3370. If you have a .settings/org.eclipse.jdt.ui.prefs file with:
Setting either to false, or deleting the prefs file should help. @rgrunber vscode-java should probably disable JDT UI prefs support. It's a definitely a source of confusion/frustration. |
Thanks. I had both those settings. But that file was last committed 6 years ago, and I don't remember it happening before. Something must have changed in vscode lately. |
@MarcelloPerathoner yes, this is caused by eclipse-jdtls/eclipse.jdt.ls#2870 |
I disabled my java extensions searching for |
Copied from microsoft/vscode-java-pack/issues/44
@viraj1994 reported that the import statements are removed on save. Here's a video of the issue:
https://drive.google.com/file/d/16bxoqj-4pA_aJAOChTpLpinpaiZCwwQf/view
The text was updated successfully, but these errors were encountered: