VS Code去掉 unused 警告

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_25991865/article/details/88174734

在VS Code中声明了未使用的变量会有警告信息和绿色波浪线提示,强迫症看着难受。查了很多方法,终于找到解决方法:
https://stackoverflow.com/questions/49667888/visual-studio-code-java-disable-serialversionuid-warning

Currently Java Support for VSCode reads a file called .settings/org.eclipse.jdt.core.prefs as part of its Eclipse project support. That’s a folder called .settings in the root folder of the project, then a file called org.eclipse.jdt.core.prefs in that folder.
In this file, we can suppress the serialVersionUID warning by adding the following line: org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
Now just restart VS Code, and those warnings will no longer show up.

参照这个方法,在org.eclipse.jdt.core.prefs文件中添加“org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore”解决问题!、

org.eclipse.jdt.core.prefs文件所有配置项:
https://github.com/jenkinsci/analysis-core-plugin/blob/master/.settings/org.eclipse.jdt.core.prefs

猜你喜欢

转载自blog.csdn.net/sinat_25991865/article/details/88174734
0条评论
添加一条新回复