Forcing method signature on the minimum number of line

Hello,

Is there a way to define a code style to force method declaration to be declared on the minimum possible number of line ?

My problem is the following: I sometime reformat the code but have a brace mismatch. The code thus get indented wrongly (and method declarations are indented as method call: On several line in my config).
When I fix the problem, method call are not getting to there original one or two lines definition, but are kept as one line per parameter or something like that.

It would be nice to have a setting where code reindent can reverse my mistake.

Thank you,

--
Mickaël Rémond
http://www.3pblog.net/

1 comment

You can do that by disabling the option "Keep when reformatting" - "Line breaks" in the
"Alignment and Braces" tab of the code style settings. But be aware that this also causes
manually wrapped elements to be re-wrapped according to the code style.

I'd advise against reformatting syntactically incorrect code anyway as you never know how
the formatter would deal with that. I even think it would be reasonable to disable it for
incorrect code to eliminate reformat "accidents".

Sascha

0

Please sign in to leave a comment.