Playframework Plugin non-functional in IntelliJ IDEA 12 - scala

I have just downloaded and installed IntelliJ IDEA 12 (Ultimate Edition), under Ubuntu, with high hopes that I could cash-in on IJ's tight integration with Scala and the Play Framework.
I have a fully functional install of Play at /home/ryan/play-2.0.4 and from searching around, it seems that all one has to do is perform a play idea on a play project at the command-line and simply open the project in IntelliJ.
However, if I do this: I can't even verify that the Playframework plug-in is even active/functioning. There is no syntax highlighting in Play config files or templates, absolutely no Playframework options in the pull-down menu. If I right-click the project, choose "Add Framework support ..." and "Play" is not even on the list, I can't just create a new "Play" project from scratch in the IDE either (not sure if that is even supported).
If I click File -> Settings -> Play Configuration, I have the Home and Working directory set to: /home/ryan/play-2.0.4. I should note that I am using Play under Eclipse with no issues (except there isn't any Play integration with Eclipse --- hence the reason why I am giving this a try in IJ). If I didn't know any better: I'd declare IJ 12's Play support as a miserable failure, but given all the postings suggesting that play 2.0 integration with IJ 12 is "very easy" - perhaps there is something I am missing?

Most probably you need to download and/or install Play 2.0 Support plugin + dependencies (most probably you will need to find it in Browse repositories section, it is not the same plugin as bundled Playframework support!)
I can ensure you that I'm just sitting and playing with Play 2.0 in Idea 12 with new support, and it works quite nice.
Go to Settings > Plugins section and check if you have newest version of mentioned plugin and if isn't blocked by some error (ie. missing dependency), try to resolve all missing dependencies, restart the IDE, and compile (or run) your applications at least once.
I didn't test it to the end yet, but I can see large progress in the support especially in templates and controllers. routes file allow easily navigate to the target actions, but as I can see there is no syntax highlighting in conf file.
There is even possible now to run and debug Play application from the menu.
In general if you'll enable the Play plugin you will see it for sure :)

You don't have to install additional plugins. You only have to run your application once, and afterwards IntelliJ highlights everything etc.
Look here: http://devnet.jetbrains.net/message/5473435?tstart=0#5473435

Related

Building JUnit 5 from Source in eclipse on Windows

I'm currently using JUnit 5.1, but I want to switch to JUnit 5.5 (at least 5.4) to use new features of that version (mainly the #Order annotation), but I'm really struggling to properly set it up.
Unfortunately I cannot simply switch to a newer eclipse version, because I'm tied a specific version we use at my workplace.
As there is no JAR-download, i've tried to build it from source. The only guidelines concerning this are saying to build it with Gradle, but I don't understand how to do this.
What I tried so far:
- downloaded the repository as an archive (zip) and imported it to eclipse, which resulted in multiple projects and <1.000 errors
- imported the repository into eclipse (via import wizard), but failed to find a way to make a build from it
I was able to run some test with JUnit 5.4 features, but i achieved this by downloading different modules as JARs from some maven-repository I found in a JUnit issue on github and including them as external JARs into the classpath. This was very tedious because of the number of different JARs & the way they were organized in the repository folders.
To me this feels like a workaround, as I still have no idea how to solve the initial problem of building JUnit from source.
I'm quite new to eclipse and have a basic understanding of what Gradle is, but I've never used it so far.
I don't expect a detailed step-by-step guide on how to achieve this (although I wouldn't complain ;) ), but I'd really appreciate it, if you could give me an outline of how building from source is done in general and maybe additional references for me to read about certain steps (e.g. setting up gradle).

Resolving Controllers via routes for imported Play 2.4.x project in IntelliJ

I'm trying to import any Play project (usually from activator) into IntelliJ and each time I end up with Controllers not being resolved, i.e. you go to conf/routes and routes.ApplicationController shows up red and inside any Controller completion for routes. shows no controllers.
The projects do compile in, and even run from IntelliJ, but compiled routes just aren't picked up.
I don't know if it's related, but on project load I always get the following message:
SBT compilation for play framework 2.x disabled by default
But even if I go into the Languages & Frameworks setup and tell it to use the Play 2 compiler, the routes are not affected.
Hüseyin Zengin is right. The activator plugin which generates the .idea directory and metadata is no longer 'the way'.
The truth is it doesn't work perfectly out of the box and your best bet is to get on the latest versions of all three. This means using the Early Access Program version of Intellij.
This largely depends on the versions of Play!, Intellij and the Scala (formerly Play) plugin.
If you can't do that or still get the problem anyway then following these steps might help:
Open your Play! 2.x project in Intellij
Open Module Settings F4
In the Root Source Settings navigate the directory structure.
Add the main directory at
target/scala-/routes/main
to the Source Folders list. Right clicking the main folder and selecting Sources is one way to do this.

How to eliminate error underlining in IntelliJ 14.0.3 for Play 2.3.7 application?

I am using IntelliJ IDEA 14.0.3 to develop a Play 2.3.7 application using the Scala 1.3.3 plugin.
The attached screenshot shows that IntelliJ underlines the parameter to a render method as invalid when, in fact, the system compiles and runs successfully both in IntelliJ and at the command line (using Activator):
Another user has reported this problem in IntelliJ when the view template file uses Scala-specific syntax (i.e. Form[formdata.ContactFormData]) while the controller uses Java-specific syntax (i.e. Form<formdata.ContactFormdata>). That is the case here as well.
The sources to illustrate this problem are available at: https://github.com/philipmjohnson/intellij-play-error-highlight-problem
Is this indeed a bug in IntelliJ or its Scala plugin? Are there any workarounds?
My team and I have this same issue, using Intellij 14.0.3, Scala 1.3.3 plugin and Play 2.3.8.
To workaround this I open File --> Project Structure, then click on "Modules" on the left side bar. Adding target/scala-2.11/src_managed/main to the sources eliminates these reverse routing underlines. Make sure that the root target directory is not in the excluded folders.
One thing to note however, is that Intellij seems to remove this from the sources from time to time, causing much annoyance...
The above solution works, but I think it might be useful to document a ripple effect: if you are using the Checkstyle plugin, then after adding those additional source root directories, Checkstyle will process those auto-generated Java files and (in all likelihood) raise a number of (spurious) warnings.
After fiddling around a bit, it appears the easiest way to get Checkstyle to skip those files is to specify the "Inspection Scope" as the "Default" version control scope. Since you will almost certainly exclude the target/ directory from version control, this parameter to Checkstyle keeps it on the straight and narrow. Here's a screen image illustrating the setting:

How does sbt integrate with IntelliJ?

Is there a definite doc somewhere that explains all the magic that happens behind the "Typesafe Activator" generation of "IntelliJ supported" project?
The sbt build files look absolutely monstrous, and I have no idea what and where IntelliJ looks for.
This is frustrating as working from two different PCs the scala seed project refers to different hard-coded paths.
Is there a good place to start?
Last time I checked, the typesafe activator was using SBT as the underlying build tool. When creating an intellij project it would thus use the sbt-idea plugin.
I guess a possible place to start would be that plugin's documentation.
However I think there is something else going on here. I think you have the activator installed on two different PCs and are trying to share the project between both PCs whether using version control or copying the folders.
The sbt-idea plugin will indeed write some absolute path in ideas project files (most likely the absolute paths to the sbt managed libraries in the ivy cache of your home folder) since this is required for the intellij project to work.
There should be no reason to "share" the idea project files, these should be considered computer specific and should not be checked into source control, or expected to work when copied from a random computer to another. You are expected to regenerate them for each computer the project is worked on.
If that sounds like a burden, you may want to install the Intellij scala plugin. Once installed, the sbt integration will allow you to import any sbt project even if you haven't generated the intellij support in the activator. Have a look at the features page, there is a video showing how to use the plugin.

Configure Netbeans IDE for Play Framework

I know running:
play netbeansify
configures the IDE for the Play Framework.
My Problems:
I have no JavaDoc for the Play Framework
I cannot navigate to the Play Source
Has anyone managed to get that done.
BR, Rene
It's been long since I used Netbeans so I can't give you the To link the full steps, but:
The source is available here. You'll need to link it as "code source" to your project. IntelliJ IDEA prompts me to browse for the source automatically when trying to browse it if it's not available, I don't know if Netbeans may have something similar
I assume once the source is linked the Javadoc in it will be available. There is not too much, I warn you (this is not like Maven projects where you have the 3 jars: source, binary and javadoc). But the code is simple and self-explanatory.