Scala Plugin Update for IntelliJ IDEA 14 RC is Out

Following IntelliJ IDEA 14 RC that has been released a couple of days ago, we’re publishing a Scala plugin update for it. In this post you will find what’s new in this build:

Scala plugin project migrates to SBT

First of all, Scala plugin project itself now uses SBT for build and dependency management. This is good in a number of ways, one of which is that the SBT task that comes with the project will let you download a correct version of IntelliJ IDEA as a dependency.

Rethinking the project configuration model

Another change is that we’ve finally decided to get rid of the Scala facet and replace it with so called Scala SDK library that, in addition to the standard Scala libraries, has a classpath to Scala compiler:

Screen Shot 2014-10-30 at 17.31.33

This change unfortunately is not backward-compatible, and that means you’ll have to convert the your projects to use them with IntelliJ IDEA 14, but don’t worry, it will do it automatically.

Anonymous functions evaluation

And last, but not least, the updated Evaluate expression and Watches now let you evaluate anonymous functions:

Screen Shot 2014-10-30 at 17.38.12

This feature still has several limitations and not everything may work as expected (e.g. it doesn’t allow you to access private members unused in other anonymous functions/classes) but we hope to fix it soon.

That’s it for now. For the complete list of changes, please refer to the Release Notes.

The IntelliJ IDEA 14 release is around a corner, it’s your last chance to submit your feedback, use our discussion forum or report bugs directly to the issue tracker.

Develop with Pleasure!

This entry was posted in EAP, New Features and tagged , , . Bookmark the permalink.

28 Responses to Scala Plugin Update for IntelliJ IDEA 14 RC is Out

  1. Igor Kolomiets says:

    “Rethinking the project configuration model”

    Thank you, guys! The old one was soo confusing…

  2. Alex says:

    The plugin give the follows errors
    Throwable: Project is already disposed: Project (Disposed) and
    Error:bad option: ‘-language postfixOps’

    and how I can add the postfixOps option for a non-sbt project?

  3. Remi says:

    Hi,

    Do you plan to reintroduce the facility to create SBT based scala modules, as in IntelliJ 13? I’d actually prefer this to creating non-SBT modules.

    • Pavel Fatin says:

      Hi Remi!

      The previous “Add SBT module” action was actually a “bug” – it was only possible to create a whole SBT project. Because new modules within an SBT project must be declared in SBT definition itself, and syntax of that definition is quite arbitrary, we can’t modify SBT files from some UI wizard.

      It’s still possible to create an SBT-based project via the File / New Project action (Scala / SBT). Then you may add additional modules (“projects” in SBT’s terms) in the SBT project definition and press “Refresh SBT project” in the SBT toolbar (or rely on auto-import), so these modules will appear in IDEA. The same is possible within an imported SBT project.

      • Remi says:

        Pavel,

        Thanks for your answer.

        Meanmwhile I have tried a few times to create a new SBT project from scratch using the new GA releases of IDEA and Scala plugin. I found that creating new modules is best performed by adding them to the root .sbt file and not via the usual “New Module” menu in the project tree. Also, auto-import at some point started a never-ending reimport without me performiong any changes on any .sbt, so I did not use it on further attempts.

        I found that a lot of nested project folders were created for subprojects, although the SBT documentation states that they are disregarded if there is a parent module (maybe I misunderstood this and there is still a purpose for them).

        When I look at the SBT tool window, it is either empty or – after manually adding a .sbt file – there are some entries which don’t allow me to execute SBT build commands like I would expect, nor have I ever seen an the menu entry to navigate to the source location (F4) in enabled state. Am I doing something wrong here – or how can I run SBT commands (like clean, compile, test etc.) from IDEA?

        Is there something like a getting started / cookbook / best practices documentation for using the IDEA Scala plugin in a multi-module scenario that guides not-yet-experienced users of it (like me) to using it in the way it was meant to be used (and also the way it works)?

        Cheers and thanks in advance for any hints,

        Remi.

  4. kerr says:

    the project refreshing tack too long time

    after I upgrade,the SBT plugin starting to refresh the project ,but seems it take too long time to finish it work,
    from the linux’s indicator view,seems it using high local network

    you could verify this issue via akka project

  5. John says:

    Scala worksheet backward, show object defined and not the inner values and def of the object

  6. Kevin Osborn says:

    I just updated today. If it converted an existing project, it works fine. But if I tried to just import an SBT project, it just shows the root files (build.sbt, .gitignore, etc.). It doesn’t seem to recognize the SBT structure. Although if I uninstall the plugin, it does recognize the structure.

  7. Pingback: IntelliJ IDEA 14 is Released! | JetBrains IntelliJ IDEA Blog

  8. slam says:

    I think there are some issue with it.
    I just convert the project from intellij 13,and i run the unit test with errors like xxxText class not found. but it works fine with 13.

    • arussel says:

      same here, I can’t find a way to have the test class to be compiled, I have to run sbt outside with ~test:compile to be able to run the test inside idea

      • Sergey says:

        It doesn’t compile any scala sources actually, not only tests.

        • geekmartian says:

          I’m having the same issue with a brand new project, from IntelliJ 14 I get “xx Test class not found”. falling back to “sbt test” from command line. Any solution for this?

          • Luchesar Cekov says:

            The same here. Intellij 14 with scala plugin stopped compiling any scala files.

            I am not able to run the tests or any main method class either.

            Hope to get some update soon!

  9. Richard says:

    There is a downside to moving from a project-level Facet to an application-level Scala SDK library.

    I like my builds to define Scala dependencies using Maven-style “coordinates”, and have my build automation pull in the Scala jars from a repository – both to compile against and to package a deployable artifact.

    I also like to ensure that the build automation sets up IntelliJ to match the settings used to compile and deploy artifacts – that way, I can be sure (as far as possible) that what runs in IntelliJ is the same as that deployed.

    I use the Gradle idea plugin to generate IntelliJ project and module files – hence Gradle pulls in the Scala jars and sets up module libraries/project libraries using them, and will also compile and package against the same files.

    It does not seem possible to specify a repository and Maven-style coordinates when setting up a Scala SDK. In any case, since a Scala SDK is configured application wide, no external build automation can set this up.

  10. Stephen Boesch says:

    quasiquotes are not working for a project that was auto upgraded from 13.1.5 to 14

    Specifically I am compiling the spark project and the spark/sql module uses quasiquotes.

    Is there a fix for this?

  11. Sergey says:

    Hi! Thanks for your work, however this release is actually a downgrade from what we’re used to. Is support for Play2 project compilation within IDE planned? No matter what I do, I can’t make it compile.

  12. Mark says:

    We have a relatively large Scala 2.11/Play 2.3 SBT project – Build.scala based, and the SBT import fails with errors like “object PlayImport is not a member of package play” (for “import play.PlayImport._”)

    We are currently able to use “activator gen-idea” to get a working project but it would be nice to be able to use SBT import and avoid the conversion step each time we update the project.

    Also noticed that unlike IntelliJ 13, 14 seems to be affected by PLAY_HOME and/or SCALA_HOME set in my .bash_profile (OS X 10.10) – I had some projects that failed with strange errors until I removed these (which were for Scala 2.10, Play 2.2, while the project was for 2.11/2.3.)

  13. drozzy says:

    Is there ever going to be a tutorial on how to use Sbt with IntelliJ?
    It all seems to just happen “magically” — I have no idea what’s going on behind the scenes. Why is there another “project” (created by sbt plugin) inside my “project”?

    Would really appreciate if someone could post a “For Dummies” explanation. Thank you.

  14. michwyz says:

    Hi, I have problem with sbt idea plugin i think. It occurred after migration to 14. When I add dependency to my build.sbt, Idea is not loading new libraries. Project is compiling and works, but editor is full of “Cannot resolve symbol” errors.
    Maybe someone has similar issue?

  15. SemanticBeeng says:

    Hi,
    It also “felt like a downgrade” to me as well.
    Figured some things out and posting here to save others from possibly missing the chance to use a great tool due to some rough edges

    http://stackoverflow.com/questions/3677174/idea-jetbrains-intellij-compile-error-on-make-but-fine-when-compiled-using-m/27251319#27251319

    Intellij 14 seems to fix some “debugger on vacation” problems from version 13 so I had to upgrade…

  16. Kostas says:

    I am having issues importing a big multi-module sbt project with 1.1.3 of the plugin. No modules are imported and no error in the event log.

  17. Shishir Lamichhane says:

    Why is this IDEA 14 version spending a lot time to hot reload a small change in code? Also IDEA sbt seems to be busy all the time?

  18. Pingback: ScalaTest IntelliJ Problem | Active Intelligence

Leave a Reply

Your email address will not be published. Required fields are marked *