[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Jave 3.3 code formatter question

hi Paul,
sorry, currently there is no way to do what you want. Would you agree with me, that formatting you'd like to have is very specific? I wonder what should be a more general rule, that would fit your needs.
Regarding inserting "hard" line break. Where would you actually expect it? After 29th column, after 2 argument, after second "," in line?
Maybe it would be better to select certain types of source code (like method declarations), that should not be formatted.
I'd say, that you could raise an enhancement request here https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT&component=Text
however keep in mind, that there are also voices, that formatter is already too difficult to configure because of huge number of options it offers.


Paul A. Rubin wrote:
Hi all,

I would like to invoke the code formatter when I save a file, but I'm running into one annoyance I can't seem to work around. I want to format method parameters manually, e.g.

void myMethod(int a, int b,
              int c, double d) {
...
}

but Eclipse 3.3 won't let me. If I have the formatter on, it insists on unwrapping the declaration to

void myMethod(int a, int b, int c, double d) {
...
}

and rewrapping if that violates the line length. This is with the relevant formatter preference set to no wrapping; any of the other wrapping options wraps it differently, but not the way I want.

The smart money says I'm missing something. Is there a way to tell the code formatter to ignore parameter lists when formatting the code, or a way to insert a "hard" line break that is inviolable?

TIA,
Paul