Scala logo

Scala Plugin

Scala Plugin for IntelliJ IDEA and Android Studio

Features Releases

IntelliJ Scala plugin 2018.1: inline hints, better Structure View, improved refactoring, and greater usability

Meet the newly released Scala Plugin 2018.1! It’s packed with a whole variety of features, improvements and bug-fixes, and ready for download. In preparing this release for you, we’ve focused on the overall quality and UI/UX aspects, but also managed to add a couple of new interesting features. Read on to find out more.

Parameter Name Hints

If you’ve worked with Java code in IntelliJ IDEA, you’ve probably noticed the feature called “Parameter name hints”. The Scala language has a similar tool called “Named arguments” but we actually cannot completely rely on it. Sometimes developers do not use named arguments in places where they’re useful; and if you call a method from Java, you can not use named arguments at all. That’s why Inline hints are useful for Scala.

You can easily customize when to show such hints in Preferences | Editor | General | Appearance | Show parameter hints | Configure | Scala.

Inline_hints_params

Type Hints

Similarly to the previous feature, the Scala plugin now supports showing inferred types. You can configure these hints by going to Preferences | Editor | General | Appearance. For example, you can ask the Editor to show result type hints only for functions, properties, or local variables, and to hide all hints with length greater than n. You can also disable type hints when the type is obvious.

Inline_hints_types

Structure View improvement

The Structure View now shows you more information about code. It displays final, abstract, and access modifiers, nested definitions, primary constructor types, case class parameters as members, etc.

SV

The Structure View also provides an option to show all inherited members with their original class. Also, we’re now displaying Scala types, not Java signatures (with “void”, etc.).

Refactoring: Inline function with parameters

Want to perform the inline refactoring for a function with parameters? You’re in luck! Thanks to our contributors from Wix, the refactoring is now capable of inlining such kind of functions. It correctly substitutes them with actual values.

Inline_method

Macro expansion feature update

We have made a few changes to the way macro expansion capturing works, when “-Ymacro-debug-lite” compiler option is enabled:

  • Ambiguous keyboard shortcuts have been removed and replaced with a gutter icon that expands macro right in the editor.
  • Capturing expansions is only available when using SBT-shell for building the project.

macro
The release brings lots of other usability enhancements and bug-fixes in SBT Shell, Worksheet, Error highlighting, and Gradle support. We thank all the contributors who helped us implement them!

Your feedback is always very welcome. Please do report bugs you find, and share your ideas, in our issue tracker. Thanks!

Happy developing!