9

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.

Community
  • 1
  • 1
chaotic3quilibrium
  • 5,661
  • 8
  • 53
  • 86

2 Answers2

13

Add the following to your sbt build file:

scalacOptions += "-deprecation"
Alfredo Gimenez
  • 2,174
  • 1
  • 14
  • 19
  • Perfect! I have been annoyed with this for over a year. As I was doing the 2.12 upgrade, I finally got around to writing this question here. I am so glad I did! – chaotic3quilibrium Dec 16 '16 at 15:21
  • 1
    Great! Some more scalac options you may find helpful: http://blog.threatstack.com/useful-scalac-options-for-better-scala-development-part-1 – Alfredo Gimenez Dec 16 '16 at 17:49
  • 1
    This answer ***assumes*** that the reader is using a particular build tool. However, the question does not mention "sbt" and there is no "sbt" tag on it. Therefore, this answer is *off-topic* for this question. – Mike Nakis Feb 04 '21 at 13:27
8

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.

atjua
  • 541
  • 1
  • 9
  • 18
  • The pathway as of IntelliJ 2022.1 with Scala Plugin 2022.1.13 (2022/Apr/26), follow Settings -> Build, Execution, Deployment -> Compiler -> Scala_Compiler in the Options section (under the "Features" section to the right) click the checkbox, "Deprecation warnings". – chaotic3quilibrium Apr 27 '22 at 19:58