Before you create a project make sure that the Scala plugin is downloaded and enabled in IntelliJ IDEA.
If no project is currently open in IntelliJ IDEA,
click Create New Project on the Welcome screen.
Otherwise, select File | New | Project.
As a result, the New Project wizard opens.
In the left-hand pane, select Scala.
Note that for creating a Java project with the Play 2.x framework, you need to select Java.
In the right-hand pane, select Play 2.x.
You can also select Scala for creating a project with the Scala module,
SBT for creating a project with the SBT module or
Activator for creating a project with Typesafe Activator templates.
Click Next.
On the next page of the wizard, specify project and module location settings.
Click Finish. The IDE will create an empty application.
Importing a Play 2.x project
IntelliJ IDEA lets you import an existing Play 2.x project.
On the main menu, select File | New | Project from Existing Sources.
In the window that opens, select a file that you want to import and click OK. The Import project wizard opens.
On the first page of the wizard, select Import project from external model option and
choose SBT project from the list. Click Next.
On the next page of the wizard, select SBT options and click Finish.
Checking project settings
On the main menu, select File | Project Structure. Alternatively, use icon on the Toolbar.
In the Project Structure dialog, check if module dependencies are resolved
without warnings.
Also,ensure that the Scala compiler library is set.
Using code assistance
When everything is set up, you can use code completion, navigation and on-the-fly code analysis features in your Play files.
IntelliJ IDEA also supports code assistance for routes files and code inspections.
Running a Play 2.x application
In the project tool window, right-click the application.
On the context menu, select Run Play 2 App.
Debugging a Play 2.x application
On the main menu, select Run | Debug.
From the list that opens, select Edit Configurations.
In the dialog that opens, specify settings for debugging or use the default ones and press OK.
IntelliJ IDEA will start a debugging session.