Controlling false IntelliJ code editor error in Scala plugin

徘徊边缘 提交于 2019-12-10 17:26:06

问题


I have Java code generated from ANTLR4. Scala is using the Java code by extending some of the methods. The issue is that IntelliJ's scala plugin does not seem to know the relationship between Java base class and Scala subclass to show a false positive error message; it reports "Method ... overrides nothing" when Scala overrides Java method.

How to control the error level in IntelliJ to suppress this error message?


回答1:


Most of the false-negatives produced by Scala plugin are caused by type-aware highlighting:

Now you pressing on this icon you can disable it everywhere and your error will be gone, but that means that you'll lose your type validation everywhere.

There is less radical approach. According to IntelliJ documentation, enclosing your code in /*_*/ ... /*_*/, allows to disable type-aware highlighting locally.

For example:

class Test {
}

class Test1 {
  /*_*/
  override def foo = 1
  /*_*/
}

In this case, override def foo will not be highlighted.



来源:https://stackoverflow.com/questions/36679973/controlling-false-intellij-code-editor-error-in-scala-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!