I am trying to get play framework to work properly in IntelliJ but it seems like my Scala templates aren´t detected properly. These are the steps I have done:
Setup:
From Terminal i run this (in the following order):
In IntelliJ I open the project and check the file target/scala-2.10/src_managed/main/controllers/routes and it looks like this:
I have also tried following these instructions step by step to set up a completely fresh installation:
How to use intellij with play framework
And after completing all steps, IntelliJ is still unable to resolve the Scala templates. This is from a completely fresh play application:
I can compile, run tests from the IDE and watch changes I have made in the browser. The only thing that isn´t working is the code assistance within IntelliJ. I have no idea how to proceed at this point, any help is greatly appreciated!
To add Scala support to existing module:Right-click the module in Project View, choose “Add Framework Support…” Check “Scala” in technologies list (unavailable if module has Scala facet attached) Provide a path to Scala installation (if not detected)
To start working with Scala in IntelliJ IDEA you need to download and enable the Scala plugin. If you run IntelliJ IDEA for the first time, you can install the Scala plugin when IntelliJ IDEA suggests downloading featured plugins. Otherwise, you can use the Settings | Plugins page for the installation.
Open IntelliJ IDEA, go to File Menu --> Plugins --> [ Or directly press Ctrl+Alt+S ] Click on "Browse repositories" button and enter "Scala". Select Scala plugin to install it.
Press Ctrl+Alt+S to open Settings/Preferences dialog. From the options on the left, select Build, Execution, Deployment | Compiler | Scala | Scala Compiler Server.
So I finally managed to figure it out. It seems like IntelliJ picks up on the compiled Scala templates. Right-clicking on the target folder, and select "Mark Directory As" --> "Excluded" fixed the problem for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With