控制Scala插件中的错误IntelliJ代码编辑器错误 [英] Controlling false IntelliJ code editor error in Scala plugin

查看:178
本文介绍了控制Scala插件中的错误IntelliJ代码编辑器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有从ANTLR4生成的Java代码。 Scala通过扩展一些方法来使用Java代码。问题是IntelliJ的scala插件似乎不知道Java基类和Scala子类之间的关系,以显示误报错误消息;当Scala覆盖Java方法时,它会报告方法...无法覆盖任何内容。

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.

如何控制IntelliJ中的错误级别来抑制此错误消息?

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

推荐答案

Scala插件生成的大多数假阴性都是由类型感知突出显示引起的:

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.

没有激进的做法。根据 IntelliJ文档,将您的代码包含在<$中c $ c> / * _ * / ... / * _ * / ,允许在本地禁用类型感知突出显示。

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

For例如:

class Test {
}

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

在这种情况下,覆盖def foo 将不会突出显示。

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

这篇关于控制Scala插件中的错误IntelliJ代码编辑器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆