class Rufo::Formatter
def visit_def_from_name(name, params, body)
def visit_def_from_name(name, params, body) visit name if params[0] == :paren params = params[1] end skip_space if current_token_kind == :on_lparen next_token skip_space skip_semicolons if empty_params?(params) skip_space_or_newline check :on_rparen next_token skip_space # () needs to be preserved if some content follows unless newline? || comment? write "()" end else write "(" if newline? || comment? column = @column indent(column) do consume_end_of_line write_indent visit params end else indent(@column) do visit params end end skip_space_or_newline check :on_rparen write ")" next_token end elsif !empty_params?(params) write "(" visit params write ")" skip_space end visit body end