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

Walter Harley wrote:
"Paul A. Rubin" <rubin@xxxxxxx> wrote in message news:f8ltaq$3ni$1@xxxxxxxxxxxxxxxxxxxx
I was thinking that it would be entered manually. For instance, in some word processors ctrl-enter means "break the line and don't alter that when you reflow the text". So perhaps ctrl-enter here could mean "line break not to be altered during a reformat".

How would that "non-wrapping line break" be represented in the .java file? It has to be something that will not trip up the compiler.

Good question. I don't know enough about javac to answer. Is there a whitespace character other than space and tab that occupies just one column and isn't visible in the display? (Maybe Unicode. Do the French have an accented space? ;-))

If you put a // comment at the end of the line you don't want wrapped, does the formatter still wrap it? I don't see how it could, so perhaps that's your answer.

Good idea, but sadly it finds a way. I tried

public void foo(FunkyClass arg1,            //
                FunkyClass arg2)
       throws Exception {

and after a save (and on-save formatting) ended up with

public void foo(FunkyClass arg1, //
    FunkyClass arg2) throws Exception {

I'm not sure if it's related to another cosmic annoyance. In the Formatter -> Comments tab, I've unchecked everything. I even exited and did a -clean restart to make sure this was absorbed. Nonetheless,

double xyz;       // comment 1
double abcdefg;   // comment 2

turns into

double xyz; // comment 1
double abcdefg; // comment 2

after a save. I even tried turning off the option to clean up end-of-line whitespace. Didn't help.

I can't help thinking that somewhere I've got a setting (of which I'm blissfully unaware) that's interfering with the ones mentioned above.

/Paul