[英]IntelliJ-Idea disable inspection: Actual value of parameter is always
Is there a way to disable this inspection?有没有办法禁用此检查? I know, this maybe be a bad design, but I still would like to disable it.
我知道,这可能是一个糟糕的设计,但我仍然想禁用它。
Find an instance of the inspection, and hit ALT + ENTER to open the content menu. 查找检查的实例,然后按ALT + ENTER打开内容菜单。 You'll see a suggestion there that looks like "Inline value 'XYZ' for parameter 'myParameter'".
您会在此处看到一条建议,例如“参数'myParameter'的内联值'XYZ'”。 Click the right arrow next to it to open a second context menu, and there you'll find options to edit the inspection setting in order to tune the conditions that will produce it, suppress it for the method/class/parameter, or even disable it altogether.
单击它旁边的向右箭头以打开第二个上下文菜单,您将在其中找到用于编辑检查设置的选项,以调整将产生检查条件的条件,针对方法/类/参数取消显示,甚至禁用一共。
Use @SuppressWarnings("SameParameterValue")
in java
在
java
使用@SuppressWarnings("SameParameterValue")
and @Suppress("SameParameterValue")
in kotlin
和
@Suppress("SameParameterValue")
在kotlin
Tested on Android Studio Arctic Fox | 2020.3.1
在
Android Studio Arctic Fox | 2020.3.1
上测试Android Studio Arctic Fox | 2020.3.1
Android Studio Arctic Fox | 2020.3.1
@SuppressWarnings("SameParameterValue") @SuppressWarnings(“ SameParameterValue”)
I tested it in Android Studio 3.5, which is based on IntelliJ-Idea, so it probably works in other IntelliJ-Idea based IDEs too. 我在基于IntelliJ-Idea的Android Studio 3.5中对其进行了测试,因此它可能也可以在其他基于IntelliJ-Idea的IDE中使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.