javavisual-studio-code

Ignore unused local variable warnings in VS Code


I started to develop Java in visual studio code but on our legacy project there are hundreds of unused fields. I'm getting 300+ warnings that "The value of the local variable XXXX is not used."

How can I ignore these warnings?


Solution

  • There is a file in the in the project root folder .settings/org.eclipse.jdt.core.prefs. Add the following line, or edit it if exist:

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

    UPD: If you want edit more of your preferences, check this link.