Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can IntelliJ IDEA auto-import Play dependencies?

I'm can't figure out how to get IntelliJ IDEA to "play nice" with Play. I'm wondering how/if you can get it to automatically recognize dependencies in Build.scala and import them, just like IDEA can do with pom.xml entries for Maven projects.

As it is now, I have to manually keep my IDEA project and Build.scala in sync, which is kind of a pain.

like image 695
Patrick Lightbody Avatar asked Jul 26 '13 16:07

Patrick Lightbody


People also ask

How do I enable auto import dependencies in IntelliJ?

In the Settings/Preferences dialog ( Ctrl+Alt+S ), click Editor | General | Auto Import. Enable the Optimize imports on the fly option and apply the changes.

How do I automatically import packages in IntelliJ?

Select how IntelliJ IDEA should process references to missing classes and methods in pasted blocks of code: All: import statements will be added automatically for all missing classes and methods found in pasted blocks of code. Ask: IntelliJ IDEA will prompt you to select which classes and methods you want to import.

What does IntelliJ optimize imports do?

Quickly remove any unused imports and more. With the Optimize imports action (Ctrl+Alt+O), you can quickly remove any unused imports, merge imports from the same module, and optionally sort the import statements.

Do not use * imports IntelliJ?

To avoid IntelliJ IDEA replacing imports with * , you need to configure the Class count to use import with '*' and Names count to use static import with '*' preferences: Go to Preferences > Editor > Code Style > Java.


1 Answers

IntelliJ is working on sbt support (like they have for Maven). Until then just re-run play idea when you change your dependencies.

like image 94
James Ward Avatar answered Nov 11 '22 00:11

James Ward