In Scala, method signature semantics goes beyond method name, parameters and result type. The signature can also tell about whether a method has side effects, or whether a method represents a property.
However, sometimes we forget about writing proper definitions or method calls. That’s where 15 new method signature inspections may help.
Method declaration syntax inspections
Method with Unit result type is parameterless:
Method with Unit result type defined with equals sign:
Method with Unit result type defined like function:
Redundant Unit result type annotation:
Apparent refinement of result type:
Method name inspections
Method with accessor-like name is empty-paren:
Method with accessor-like name has Unit result type:
Method with mutator-like name is parameterless:
Method overriding inspections
Empy-paren Scala method overriden as parameterless:
Parameterless Scala member overriden as empty-paren:
Java accessor method overriden as empty-paren:
Java mutator method overriden as parameterless:
Method access inspections
Empty-paren method accessed as parameterless:
Java accessor method called as empty-paren:
Java mutator method accessed as parameterless:
IntelliJ Scala Plugin 2023.3 Is Out!
Scala 3 As usual, the new release focused much on improving the Scala 3 support. Especially enums received much attention. The Scala plugin now recognizes that enums cannot be extended and highlights such attempts; annotations and modifiers are now propagated correctly to generated symbols; type…
IntelliJScala @ Scala Days 2023 Madrid
On September 12 – 14, the Scala Plugin team was in Madrid for the Scala Days conference. JetBrains was a Gold Sponsor for the event and we are very proud of it. We came to Madrid with a booth, merchandise, and a talk about the IntelliJ Scala Plugin. The Scala Plugin has seen a lot of improvements…
IntelliJ Scala Plugin 2023.2 Is Out!
Better Scala 3 Support IntelliJ IDEA 2023.2 brings enhanced Scala 3 support, with a focus on providing a streamlined development experience. Notable improvements include fixes for Scala 3 enum highlighting, navigation to enum definitions, and the correct resolution of enum cases in various contex…
IntelliJ Scala Plugin 2023.1 Is Out!
Improved support for braceless Scala syntax IntelliJ IDEA can now desugar braceless Scala code properly, and it handles refactorings where the “fewer braces” feature is used. It also supports braceless syntax in worksheets and correctly interprets indentation when you move extensions methods up a…