Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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: http://i.imgur.com/IPrUpVL.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!

like image 812
djonsson Avatar asked Nov 03 '13 13:11

djonsson


People also ask

How do I add Scala framework support in IntelliJ?

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)

Does IntelliJ work with Scala?

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.

How do I enable Scala in IntelliJ?

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.

How do I select Scala version in IntelliJ?

Press Ctrl+Alt+S to open Settings/Preferences dialog. From the options on the left, select Build, Execution, Deployment | Compiler | Scala | Scala Compiler Server.


1 Answers

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.

like image 65
djonsson Avatar answered Oct 27 '22 15:10

djonsson