VS Code去掉 unused 警告

在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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值