Play Framework - IntelliJ Issues - IDE suggestions?

219 Views Asked by At

I'm using IntelliJ IDE to set up a Play project and do my development. I cannot create a new project nor can I get an existing project (e.g.: websocket-chat) compile in IntelliJ.

I posted this on IntelliJ forums http://devnet.jetbrains.com/thread/450345?tstart=0 but no response yet.

Has anyone been able to get Play project set up in IntelliJ? What IDE do you use? I'm using Play 2.2.

2

There are 2 best solutions below

1
Jason Pearson On

Likely the fix to your issue is to run "play idea" in the console to generate all the files IntelliJ needs to properly index the project.

I use the EAP version of IntelliJ, believe that I run into fewer problems because while it might incur a breaking change they also release fixes quite fast.

IntelliJ has written its own Scala parser for type highlighting, I find that it doesn't always keep up with the latest Scala features and even some that have been around for a while (there were issues with package objects for a bit). Considering that, I usually turn type highlighting off and keep a console window open to do continuous compilations there. Even when compiling works in IntelliJ its always significantly slower than directly using play or sbt from command line.

1
Vidya On

I managed, but it was a pain to set up. I am going to blog about this, but here is a sneak preview to how I solved it:

  • Create a new project in IDEA in the directory of your sample. Choose type "Scala module."
  • Only after it's done should you navigate to the same directory in the command line and run play.
  • When the Play console is up, use the idea command: e.g. [websocket-chat] $ idea
  • Go back to IDEA. You should see a prompt that says something along the lines of "Project was modified outside of IDEA. Would you like to reload it?" Do it.
  • Once the project is reloaded and indexed, you should be good. At least I was.

Hope that helps. This was unnecessarily difficult. It's bad when I find women easier to understand.