I upgraded my IntelliJ(12.1.4) to the new Play 2.0 Support(0.5.54) plugin and two things happened:
IntelliJ no longer recompiles my .scala classes, this meaning that if I e.g change the signature of a method from def something(s1: String) = {} to def something(s1: String, s2: String) = {} I get an error that ) is expected after the first param. I run the app from the terminal with play
debug ~run
and there the app recompiles without a problem.The scala.html are not evaluated properly and I get a lot of syntax errors. The color encoding is also wrong. I tried to change the Scala plugin to the nightly build(0.10.281) as suggested in the comments but it still doesn't work.
This is crazy bad since it makes working with the IntelliJ painful and counterproductive. There is a bug reported: http://youtrack.jetbrains.com/issue/SCL-5749 but what should I do in the meantime? Anybody solved this issue?
Good news everyone: Play 2.0 plugin and Scala plugin versions are synchronized again! For IDEA12 there are 0.13.286 versions (of both) now. After updating I see some new highlighting errors, but at least they work, and there are no error messages about incompatibility!
So, it seems like it is safe now to update to the latest version of both through the built-in mechanism.
— this also gives some hopes for not repeating the same problem in future.
For me play2.0 version 0.2.49 with scala version 0.10.279 does the trick. With the other versions I ether get bugs, or my IDE just doesn't work correct.
link to play plugin: http://plugins.jetbrains.com/plugin/download?pr=&updateId=13272
link to scala plugin: http://plugins.jetbrains.com/plugin/download?pr=&updateId=13504
instructions:
1 download the .zip (do not extract)
2 make sure there are no play or scala plugins in your IDE folder (C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.2\plugins)
3 op the IDE and open the plugin menu. (file -> settings... -> plugins
4 click the button "install from disk" and select the play zip file and the scala zip file. (you don't need to disable the play and scala plugin in the plugin list, they get swapped after the IDE restart
5 restart your IDE
6(optional) report back here if it worked or not
Use the IntelliJ sbt plugin and compile your classes from sbt with "~compile". You can start play with "container:start".
Here is my own Build.scala file I run from within IntelliJ:
And here the plugins.sbt:
Additional I have a Debug configuration for a Scala application with
This replaces the Play plugin completely for me :-)
The problem here is that there is a massive incompatibility with the newer Scala plugins and the Play plugin in general. To get it to work, you have to use Scala plugin version 0.7.264 (that is the specific version number the support person gave to me anyway). I had this issue as well and, to be safe, I also reverted back to Play plugin version 0.2.26. Everything works as it did before now.
To go back to the previous version, you have to download the ZIP archive from the JetBrains plugin site and choose "install from disk" in IntelliJ IDEA. Here is the link to get the older Scala plugin version you need: http://plugins.jetbrains.com/plugin/?id=1347
This is a big compatibility issue and apparently JetBrains is aware of it, but only by contacting their help desk did I find out how to fix it for now until a more permanent solution comes along.