0

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.

Schleichardt
  • 7,502
  • 1
  • 27
  • 37
dsatish
  • 1,041
  • 15
  • 27
  • Please look at this answer:http://stackoverflow.com/questions/16135716/how-to-use-intellij-with-play-framework-and-scala/16186578#16186578 – akkie Oct 25 '13 at 04:59

2 Answers2

2

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.

Jason Pearson
  • 609
  • 4
  • 15
0

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.

Vidya
  • 29,932
  • 7
  • 42
  • 70
  • You can just create a new play project with "play new", then go into that directory and type "play idea". THEN you load the project into IDEA, when there's an IntelliJ project file all set to read in. – sdanzig Oct 27 '13 at 17:09