Play framework support in IntelliJ IDEA Community Edition - scala

I installed IDEA version 15 with the Scala plugin, but Play projects are enabled only in the Ultimate edition. I'm new to Scala and Play, any issues if I run Play outside of IDEA? Would Play "hot deploy" any changes I make in scala source code?

Just open it as an SBT project and it's fine.

This is how it works: (1) create a project using play/activator, (2) open IntelliJ and import as SBT project (accept all defaults), (3) run the project in a command line (externally to IntelliJ), (4) edit project source files in IntelliJ - when you update a file, it is automatically compiled (you can see that refreshing the url localhost:9000)

Play works great outside of IntelliJ. I have developed play applications using Sublime Text and Atom. You'll get the errors in the console, or in the web application itself.
There's also a NetBeans plugin now (http://nbpleasureplugin.com), and the official ScalaIDE should also support it (although I've never tried using it).

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.

Running ApsctJ in Intellij IDEA with Scala

I am using Intellij IDEA Community Edition 14.0.3 for Scala development. I am having AspectJ in my application. I am using sbt-aspect v0.10.1.
I am able to run everything fine when I run the application from SBT console. However, when I use run from the intellij menu, it is not invoking the aspect.
Because of this, I am not able to run in Debug Mode. How can I make it work with intellij ?
I have the same issue.
My workaround is:
Open project Run/Debug configuration on IntelliJ IDEA
In the VM Options field type: -javaagent:path/to/aspectjweaver.jar
path/to/aspectjweaver.jar in my case is C:\Users\aelkin\.ivy2\cache\org.aspectj\aspectjweaver\jars\aspectjweaver-1.8.13.jar
Actually I do not use Scala in IntelliJ IDEA, but Java. Anyway, a quick web search led me to the SBT Community Plugins page which lists these links:
Plugins for IDEs
IntelliJ IDEA
sbt Plugin to generate IDEA project configuration: https://github.com/mpeltonen/sbt-idea
IDEA Plugin to embed an sbt Console into the IDE: https://github.com/orfjackal/idea-sbt-plugin
At the time of writing this GitHub is down for database maintenance, so I cannot check on the projects mentioned there, but in 15 minutes or you should be able to navigate there by yourself and see if the repos actually contain something useful for you.

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

How to run a Play 2.2.1 project from Scala IDE?

I have followed the Play tutorial to create a simple application, made sure it started using the "play" command and then running play eclipse I generated the eclipse project files. I finally imported the project into the latest version of Scala IDE bundle for OSX.
I would like to know if there is a way to run my application from within eclipse without having to use the shell to start play each time.
There is a similar question here, and the accepted answer says that a run configuration will be created in eclipse. In my case I can't see any, so that may have changed from version to version.
The short answer is no. You need to start the play server from command line if you want to load your application on a browser.
The long answer is that we (I'm a contributor to the Scala IDE project) are starting to work on sbt integration, which is the required building block for not having to run the play console on a terminal (because we can to do it for you in the background, once we have sbt support). My suggestion is to star the project I linked, and follow developments.