Play2 project in Intellij 12 - scala

Can someone explain me how to import your idea project for Play2 support on Intellij 12?
I've just bought the upgrade from version 10 to 12. It used to work fine with Intellij 10 (with scala support only). When using play idea and importing the project on Intellij 12 it doesn't seem to work, there is no more highlighting, even in scala files that were actually working with version 10.
It seems I'm not the only one to have troubles with Play2 support in Intellij 12 so if someone can help it would be nice :)

Please check that you have installed Scala and Play 2.0 Support plug-ins from the repository.
Then check that .scala extension is assigned to Scala Files in Settings | File Types.
See also these links:
Getting Started with Play 2.0 in IntelliJ IDEA 12
Play Framework 2.0 Tutorial

Well, importing an existing Play 2 project with IntelliJ is still not very easy, even with the new Play plug-in.
Upvote this issue to get a nice Import utility for your existing Play 2 projects.
http://youtrack.jetbrains.com/issue/SCL-5209

Related

Building a Play 2.6 project from IntelliJ builds nothing

I'm running my head into the ground trying to create a new "hello-world" level blank Play 2.6 project. I have successfully opened and run one of their example starter projects from the Play site in IntelliJ, and it works without issue.
However when creating my own I follow all the steps:
New project -> Play 2.x -> Setup as pictured:
And about 10 seconds later, this is all I get:
From my understanding, the whole structure should be available and displaying to me.
I don't know if it matters, but my Scala version is 2.12.1 and my IntelliJ version is the full version 2017.1 . I checked and the Playframework Support plugin is enabled, and so is Scala.
I'm also open to creating a "blank" one in SBT and then importing it into Scala, but unsure of how to do that either.
Thanks for the help.
Refresh your IDE, the latest Intellij IDEA version (2017.2) with up to date plugins creates a new Play 2.x project without a problem.

Why does IDEA mark certain parts of Play code red?

I'm pretty new to the Play framework. I've been trying to configure it so I can use it with IntelliJ Ultimate.
I use following:
IntelliJ Ultimate 14.03
Scala plugin for IntelliJ 1.2.1
Play Framework 2.3.7 (the one that works online 1,2MB)
Scala 2.11
JDK 1.7
Windows 7
My problem is all about the fact that i can't make the errors disappear. Below is a simple example. When I create something more complicated (mapping etc.) I get entire blocks of red (also it does not suggest any code for the more complicated code).
What I've tried to fix it:
- deleting .idea folder and generating it again
- cleaning sbt
- generating a Play app from inside activator and also from IntelliJ
- re-installing IntelliJ
This is how I create the app from inside IntelliJ
I'm new both to Scala and Play, but I've done some research and I didn't end up with working solution. The same project works on Eclipse, but I would like to stick with IntelliJ.
The Scala plugin 1.2.1 is fairly outdated (given the development stage/pace of the Scala support in IntelliJ IDEA).
As of today, Jan, 29th, you should really be using the latest version of the Scala plugin 1.3.

How to create a Play project in IntelliJ IDEA 14 Community Edition?

I am trying to create a Scala project in IntelliJ IDEA 14. As mentioned in IntelliJ IDEA's help, the Scala plugin already has support for Play 2.x.
I have installed the Scala plugin, and when I create a new project I can select Scala > Scala and Scala > SBT projects but there's no Scala > Play 2.x.
Are there any additional steps needed to make this available? I am using IDEA 14 Community Edition.
I have tried importing module to a Scala project using play-generated .impl file but IDE could not handle it well e.g. was finding errors in completely fine play! views.
Play framework is supported only in ultimate edition of Intellij Idea.
Here https://www.jetbrains.com/idea/features/editions_comparison_matrix.html, section Frameworks and Technologies.
For everyone else looking for an answer for Play 2.4+ the easiest way to get up and running is:
Create a new Run Configuration – From the main menu, select Run -> Edit Configurations
Click on the + to add a new configuration
From the list of configurations, choose “SBT Task”
In the “tasks” input box, simply put “run”
Apply changes and select OK.
Now you can choose “Run” from the main Run menu and run your application
https://www.playframework.com/documentation/2.4.x/IDE

IntelliJ: Scala code doesn't compile when Play 2.0 plugin is installed

I'm using IntelliJ IDEA 13. I have a Play 2.0 project and a separate Scala project. When I install the Play 2.0 plugin (version 0.30.379) and open just the Scala project, the Scala compiler stops working. When I remove the Play 2.0 plugin, I can see that the Scala compiler is working when doing a rebuild (it shows up in the status area then).
If I remove the Play 2.0 plugin and use the Play 1.x plugin, Scala compiles fine. Reverting to previous versions of the Scala and Play 2.0 plugins doesn't seem to help (I reverted to versions prior to february 2014).
I tried a fresh install of IntelliJ but no luck.
Any ideas?
I've also posted this issue in the Jetbrains issue tracker here: http://youtrack.jetbrains.com/issue/IDEA-120990 I'll update this if I find out anything.
It looks like this is a bug in Intellij 13.0.2+ and may work fine in 13.0.1. I'll test that and update this answer.

IntelliJ IDEA 12 Scala Play SBT_VERSION error when create new project

Play plugin is enabled.
Downloaded Play from http://www.playframework.com/download 2.2.1 zip 104.8MB.
When I try to create Play Scala project in intelliJ IDEA 12 gives me error as below.
How to configure SBT?
Note: But if I download Play from IntelliJ IDEA 12 than everything is fine but intelliJ downloading old version like play-2.1.0 but latest is 2.2.1
I've seen this before as well. I tend to use the play command to generate my new projects and then idea with-sources=yes after the project is set up.
This is because Play 2.2.x is using SBT 0.13. IDEA 12 does not support SBT 0.13. The development is on-going for IDEA 13 to support SBT 0.13, but currently IDEA 13 is still in Beta.
If you look at the Github project for IntelliJ-SBT, you can see that a commit just comes in on Nov 6 (today) with update to support IDEA 13. The first beta for IDEA 13 is available today as well (Nov 6, 2013).
That is the reason why when you download Play from IDEA 12, it only gets you Play 2.1.x.
My recommendation is to switch to Scala IDE until you get IDEA 13, or use Play 2.1 for now. I found that most libraries are just catching up with 2.2 anyways.
I don't have commercial version of IDEA to verify this, so please let me know if this match what you see.