Vscode-java: disable unused import warnings

Created on 21 Apr 2019  路  5Comments  路  Source: redhat-developer/vscode-java

Is there a way to disable unused import warnings.
At some stages I don't care about them and I have hundreds of them, they get in the way of things I do care about.

Most helpful comment

You can add the following preference:

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

to /.settings/org.eclipse.jdt.core.prefs

All 5 comments

You can add the following preference:

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

to /.settings/org.eclipse.jdt.core.prefs

You can add the following preference:

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

to /.settings/org.eclipse.jdt.core.prefs

It doesn't work for me锛宑an I figure out what happen by myself?
Another config of org.eclipse.jdt.core.prefs is not working too, such as org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore

@AntSworD could you provide a sample project?

@A

You can add the following preference:

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

to /.settings/org.eclipse.jdt.core.prefs

It doesn't work for me锛宑an I figure out what happen by myself?
Another config of org.eclipse.jdt.core.prefs is not working too, such as org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore

if you are working on a java project with multiple sub-projects, you can try to copy org.eclipse.jdt.core.prefs to each sub-projects`s .settings folder

./main-project
----./.settings
----./sub-project
--------./settings
------------./org.eclipse.jdt.core.prefs

I can no longer get this to work.
I'm not using maven or gradlle but I just use 'vscode' (I have no idea how to call it), with the lib folder, and where I can add libs using the + button under the Java Projects in the EXPLORER.

This is what my structure looks like:

Screen Shot 2020-08-28 at 10 40 04

Was this page helpful?
0 / 5 - 0 ratings