如何让IntelliJ显示Scala编译弃用警告

cha*_*ium 3 scala intellij-idea deprecation-warning

在IntelliJ(版本:2016.3.1,Scala插件版本:2016.3.5)中,我有一个Scala 2.12(这意味着需要Java 1.8)项目,我选择"Build/Rebuild Project".我在"消息"窗口中收到以下输出:

Warning:scalac: there were four deprecation warnings (since 2.12.0); re-run with -deprecation for details

我必须采取哪些步骤来配置我的项目,以便我能够真正看到4个警告的内容?

我发现了IntelliJ 14的另一个问题,它显示了如何打开弃用警告,但没有说明如何显示弃用警告本身的实际内容.任何有关这方面的指导将不胜感激.

Alf*_*nez 9

将以下内容添加到您的sbt构建文件中:

scalacOptions += "-deprecation"
Run Code Online (Sandbox Code Playgroud)


atj*_*jua 8

截至目前最新的 Intellij 版本,您还可以打开Settings-> Build, Execution, Deployment-> Compiler-> Scala Compiler,并在Additional compiler options:, append -deprecation