Scala Plugin
Scala Plugin for IntelliJ IDEA and Android Studio
IntelliJ IDEA Scala Plugin 2017.3: Lightbend project starter, Ammonite support, Parallel indexing, and more
First of all, we want to thank all the contributors who helped implement many useful features, bugfixes, and refactorings. You really inspire us to do our very best work. Your input is greatly appreciated!
Now let’s take a look at the new features you’ll find in Scala Plugin 2017.3.
Highlighting of implicit usages
Most likely you are already familiar with this highlighting feature (it uses violet in the Default Theme), which usages of the symbol under the caret across the opened file. Starting with this release, it also highlights places where the target is used implicitly:
Build, Run, and Test processes do not depend on indexing anymore
IntelliJ IDEA performs indexing to power many of its features such as code highlighting, inspections, etc. In theory, indexing should not be required for processes like building or running tests. Nevertheless, previous versions had a number of dependencies that forced you to wait until the indexing finished. We have completely separated that logic, so you can run your existing run_configurations (application, tests …) in parallel with indexing. It’s very helpful in big projects where indexing takes considerable time.
Automatic suggestion to import SBT library
Now, if you add an import with unresolved packages that IntelliJ IDEA cannot find in your project’s External dependencies, the plugin suggests finding it in a local Ivy cache. If it finds the correct library, it adds the corresponding dependency to build.sbt (you can select the location).
Ammonite scripts support
The Scala plugin in 2017.3 also provides support for Ammonite scripts. We’ve added:
- Accurate highlighting and navigation that respects ammonite syntax;
- Run configuration with a gutter icon for launching scripts;
- Ammonite annotations;
- An action for importing
$ivy.
dependencies. This may be required for proper resolution in the Editor.
As Ammonite is an external tool, there are some prerequisites for its usage:
- Ammonite must be installed in your OS.
- IntelliJ IDEA needs to knows where the Ammonite executable is located. You can:
- add a symlink to already accessible places like usr/bin;
- modify the $path variable;
- specify the path to the Ammonite executable in Default Ammonite Run Configuration, using the “Amm executable” field.
- Your project must have appropriate dependencies on Ammonite libraries. This is required for code processing in the Editor. If you use sbt in your project, you can add an sbt dependency. If your project is just a set of scripts, please get libraries from Maven repository and add them in the Project Structure settings. Usually, “ammonite_2.*.jar” and “ammonite-ops_2.*.jar” are enough, but for some specific operations you may need “…-repl”, “…-runtime”, “…-compiler” or another libraries.
- Finally, .sc files have to be treated as Ammonite files (by default IntelliJ IDEA treats them as Worksheets). You can define this in File | Settings | Languages & Frameworks | Scala | Worksheet.
A wizard for Lightbend Tech Hub templates
As you may already know, Lightbend Activator was EOL-ed on May 24, 2017. It was substituted with another technology: the “project starter” service. Following these changes, the Scala plugin replaces its New Activator Project Wizard with Lightbend Project Starter Wizard.
Additionally, the release brings lots of other improvements, such as better Shapeless and Play2 support in the Editor.
Your feedback is always very welcome. And please do report bugs / ideas you find to our issue tracker. Thanks!
Happy developing!