emacs-scala-mode icon indicating copy to clipboard operation
emacs-scala-mode copied to clipboard

Allow to customize parameter list indentation level?

Open mzhaom opened this issue 3 years ago • 1 comments

Hi,

Our company uses 2 spaces for general indentation, but 4 spaces for parameter list, as stated here: https://github.com/databricks/scala-style-guide#indent

def newAPIHadoopFile[K, V, F <: NewInputFormat[K, V]](
    path: String,
    fClass: Class[F],
    kClass: Class[K],
    vClass: Class[V],
    conf: Configuration = hadoopConfiguration): RDD[(K, V)] = {
  // method body
}

Is there any chance to support this? Thank you!

mzhaom avatar Oct 24 '21 20:10 mzhaom

You could implement it here https://github.com/hvesalai/emacs-scala-mode/blob/master/scala-mode-indent.el#L610

What you would do is add an other case into the cond list which goes back to see if the character before the point anchor is (, and if so, then returns (+ (* 2 scala-indent:step) lead))

If you want the change to be in the official release, you need to make the new feature configurable

hvesalai avatar Oct 25 '21 04:10 hvesalai