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!

This entry was posted in New Features, Release report. Bookmark the permalink.

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

  1. Bradley Smith says:

    I just updated – it looks good but my project no longer recognizes anything scala. They show up as plain text files. Maven still works. I just get an error that the Scala Imports Organizer plugin is not loaded. Offers to enable scala, but never does. Infinite loop. Is it not supported in the community edition anymore?

    • Justin Kaeser says:

      The Scala Imports organizer is a third-party plugin that hasn’t been updated since 2014 and it’s functionality is obsolete. Try disabling it completely, and be sure that the main Scala plugin is enabled.

  2. Bradley Smith says:

    I removed the JB scala plugin manually (it said it was an older version – 2017.3.15), then reinstalled, and it works now.

  3. Josh says:

    Thank you for the update everyone :-)

  4. Matthew Maurer says:

    I can no longer create a Scala project through: File -> New -> Project -> Scala -> sbt

  5. Clement Bramy says:

    If you upgrade to IntelliJ 2018.1 you need to go to update a few plugins (including Scala plugin) otherwise it will be disabled by default and it won’t recognize your modules in existing projects and won’t let you create new SBT projects for example.

    In the IntelliJ popup click on settings and check for update, and you should be fine after a restart.

  6. Stephen N says:

    I had a few issues with the upgrade. But it looks good after resolving.

    I had to manually upgrade the scala plugin, then I had to add the scala module to each of the
    14 maven modules in my project.

  7. Cedric Krause says:

    I’m so happy to see the parameter name hints, I missed them so much.
    Now you only need to add these to rider and I’m happy af :)

  8. Oleg says:

    There was popup when editing build.sbt with “Auto-import” turned off with buttons refresh, ignore. How to get them back?

    Also when I open build.sbt file, popup asks to import project. Now it not asks.

    • Anton Yalyshev says:

      This popup was reworked to “Sticky balloon” format (happens in bottom-right corner). Please check if this notification is enabled in your IDEA (Preferences/Settings | Appearance & Behavior | Notifications | sbt Import).

  9. Bert says:

    The parameter hints are nice, but the type hints are really great! A big help, especially when you try to understand old code.

  10. XyzVayne says:

    Thank you for update.

    But I have a problem.
    When I rebuild, I get an error on java files.
    I am using Java & Scala together and my compile option is mixed.

    Could I get some advice?

  11. VIBHOR GARG says:

    The plugin worked great for a week.
    Howeve, from April 20 , 2018 onwards ,it has stopped showing me the green run / debug button around objects and main class.
    I am using scala 2.11.8 ( my project ws developed last year ) and intellij is 2018.1 .

    Steps to reproduce:-
    Just create a new scala maven project from archetype – simple scala project.
    I am using Utlimate version under corporate liscense from flipkart.
    Could you pls help me here.
    I have literally crawled the entire google and no one seems to have this issue.
    Probably due to scala version or intellij upgrade ?

Leave a Reply

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