Intellij IDEA reformat scala code -


if have scala method declaration long fit in single line, separate in several lines, , reformat expectations is:

protected def prunefilterproject(     relation: logicalrelation,     projectlist: seq[namedexpression],     filterpredicates: seq[expression],     scanbuilder: (array[string], array[filter]) => rdd[row]) = {   prunefilterprojectraw(     relation,     projectlist,     filterpredicates,     (requestedcolumns, pushedfilters) => {       scanbuilder(requestedcolumns.map(_.name).toarray, selectfilters(pushedfilters).toarray)     }) } 

but after reformat code(control + alt + l), output is:

protected def prunefilterproject(                                   relation: logicalrelation,                                   projectlist: seq[namedexpression],                                   filterpredicates: seq[expression],                                   scanbuilder: (array[string], array[filter]) => rdd[row]) = {   prunefilterprojectraw(     relation,     projectlist,     filterpredicates,     (requestedcolumns, pushedfilters) => {       scanbuilder(requestedcolumns.map(_.name).toarray, selectfilters(pushedfilters).toarray)     }) } 

what proper code style rules in intellij idea scala lang should set override default behaviour , desired output style?

edit

deselect align when multiline result in:

protected def prunefilterproject(   relation: logicalrelation,   projectlist: seq[namedexpression],   filterpredicates: seq[expression],   scanbuilder: (array[string], array[filter]) => rdd[row]) = {   prunefilterprojectraw(     relation,     projectlist,     filterpredicates,     (requestedcolumns, pushedfilters) => {       scanbuilder(requestedcolumns.map(_.name).toarray, selectfilters(pushedfilters).toarray)     }) } 

arguments , method body have same indention(2 space), not desired one: argument list 2 indents(4 space), method list 1 indent(2 space)

you might want deselect align when multiline option in method declaration parameters section in wrapping , braces tab in scala part of preferences menu. might want set wrapping option in same section warp if long.

in order tabs want, want set continuation indent 4 , indent 2 on tabs , indents tab.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -