How to align new lines by the ":" or the "=" symbol of a method, class etc.

For instance (in scala) 

case class MyClass(p1 : String, p2: String, p3: String, p4:String, .... ,.............,.......long long long line,................pn : String)

If I go down a new line for each parameter it will look like:

case class MyClass(p1 : String, 
  p2: String, 
  p3: String, 
  p4:String, .... ,
  pn : String)

I want it to align according to the ":" sign on a new line like this:


case class MyClass(p1 : String, 
p2 : String, 
                   p3 : String, 
                   p4 : String, 
                   .... ,
                   pn : String)


Notice how all the ":" are aligned.

When calling the method/class/function/ etc., I want it in similar fashion (with the "=" sign).

for instance:

 

MyClass(p1 = "parameter1", p2 = "parameter2" , ......, pn = "parameter_n")

 

(Line could be very long)

I want to align on each new line by the "=" sign like this:

 

MyClass(p1 = "parameter1", 
p2 = "parameter2" , 
        ......, 
        pn = "parameter_n")

 

Please sign in to leave a comment.