简体   繁体   English

如何在IntelliJ IDEA中忽略针对Kotlin的所有警告?

[英]How can I ignore all warnings for Kotlin in IntelliJ IDEA?

There used to be an option to "Generate no warnings" in the IntelliJ Kotlin Compiler setting but it looks like it was removed. IntelliJ Kotlin编译器设置中曾经有一个选项“不生成警告”,但看起来已被删除。 How can I completely ignore warnings so that my IntelliJ doesn't switch to the messages tab after compilation? 如何完全忽略警告,以便编译后我的IntelliJ不会切换到“消息”选项卡?

在此处输入图片说明

The "Generate no warnings" switch has been reversed and is now named "Report compiler warnings", see the first checkbox on the first screenshot. “ Generate no warnings”(生成无警告)开关已被反转,现在被命名为“ Report Compiler warnings”,请参见第一个屏幕截图的第一个复选框。

However, what's really changed is that since Kotlin 1.1.2 , this switch does not affect warnings related to the configuration of your project. 但是,真正的变化是, 从Kotlin 1.1.2开始 ,此开关不会影响与项目配置有关的警告。 The reason for this is that configuration-related warnings usually have a bigger impact on the whole build and may provide lots of useful information if the build does not succeed. 这样做的原因是,与配置相关的警告通常会对整个构建产生更大的影响,如果构建不成功,则可能会提供很多有用的信息。 So, we thought that it's necessary to report these warnings even if you opted to disable warnings related to the language, which usually can be ignored without any harm. 因此,我们认为即使您选择禁用与语言相关的警告,也必须报告这些警告,通常可以忽略这些警告而不会造成任何伤害。

In your case, the -d option with directory destination ... warning is fixed in Kotlin 1.1.3 . 在您的情况下, -d option with directory destination ...警告的-d option with directory destination ... 在Kotlin 1.1.3中修复 Other warnings ( Classpath entry points to a non-existent location ), I think, are worth investigating into, as they might mean that the project is not configured properly. 我认为值得研究其他警告( Classpath entry points to a non-existent location ),因为它们可能意味着项目配置不正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM