djonsson
djonsson

Reputation: 623

IntelliJ IDE does not detect Scala templates properly

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:

  1. Brew install play
  2. Brew install sbt
  3. Download and install play Framework plugin for IntelliJ
  4. Download and install Scala plugin for IntelliJ
  5. Download and install SBT plugin for IntelliJ

From Terminal i run this (in the following order):

  1. play new doTest
  2. play clean compile
  3. play idea
  4. sbt
  5. gen-idea

In IntelliJ I open the project and check the file target/scala-2.10/src_managed/main/controllers/routes and it looks like this: http://i.imgur.com/EN4iqux.png

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: https://i.sstatic.net/fL9V3.png

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!

Upvotes: 6

Views: 2996

Answers (2)

djonsson
djonsson

Reputation: 623

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.

Upvotes: 5

David Weinberg
David Weinberg

Reputation: 533

IntelliJ doesn't use the routes file as a source file. It is aware of the routes, though, so if you do something like routes.Application, it will be able to resolve that.

Upvotes: 0

Related Questions