简体   繁体   中英

How to disable warnings for unused imports in Java in Visual Studio Code?

I'm using the standard extension "Language Support for Java(TM) by Red Hat". How can I disable warnings for unused imports for Java projects in Visual Studio Code?

Maybe someone knows this and can help, because despite some extensive Google searches I can't find sufficient information on this. For other languages yes, but not for Java.

I finally figured it out. It seems that you need to configure this on project level.

For ignoring all unused imports edit the file .settings/org.eclipse.jdt.core.prefs and add the following line:

org.eclipse.jdt.core.compiler.problem.unusedImport=ignore

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM