How do I get IntelliJ to display the Scala compilation deprecation warnings

2.1k views Asked by At

In IntelliJ (version: 2016.3.1, Scala Plugin version: 2016.3.5), I have a Scala 2.12 (which implies Java 1.8 being required) project where I am selecting "Build/Rebuild Project". I am receiving the following output in the "Messages" windows:

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

What steps must I take to configure my project such that I can actually see the content of the 4 warnings?

I found another question for IntelliJ 14 which showed how to turn on deprecation warnings, but didn't indicate how to surface the actual content of the deprecation warnings themselves. Any guidance on this would be greatly appreciated.

2

There are 2 answers

1
atjua On BEST ANSWER

As of the latest Intellij version at this time, you can also open Settings -> Build, Execution, Deployment -> Compiler -> Scala Compiler, and in Additional compiler options:, append -deprecation.

3
Alfredo Gimenez On

Add the following to your sbt build file:

scalacOptions += "-deprecation"