IntelliJ - How to force named parameters in Scala editor and add them
Asked Answered
V

0

6

Basically I want the IDE to enforce named parameters syntax when it is auto-completing

https://docs.scala-lang.org/style/method-invocation.html

So for example a given class

class MyClass {
  def myMethod( param1 : String, param2 : String)
}

I want the IDE to put the placeholders for "param1" and "param2" like this:

val myObj = new MyClass()
myObj.myMethod( param1 = "value of param 1", param2 = "value of param2")

AND NOT (This is bad)

myObj.myMethod("calling the method without explicitly naming param1" , "calling the method without explicitly naming param2")
Valeryvalerye answered 17/9, 2017 at 10:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.