rearranger arranges all my code onto one line...

I'm finding rearranger is arranging my code onto a few huge lines. Maybe it's my configuration file, which I've attached too. But if you run rearranger on this file, you should see what I mean.



Attachment(s):
Setup.java
rearrangerConfig
5 comments
Comment actions Permalink

Interesting..sounds like the spacer code that forces ]]> lines in certain locations is removing too many newline characters and joining your lines. Sorry about that. :)

I'll look into it.

Thanks,
-Dave

0
Comment actions Permalink

no problem. What is the simplest workaround for the moment? Shall I not use the forced spacing?

0
Comment actions Permalink

Problem is due to the empty comment rules in your configuration. When the plugin searches for matching comments, it is picking up all blank lines and removing them. This is because the algorithm that searches for comments eats up all preceding and trailing blank lines. A comment with no text therefore matches all contiguous blank lines (plus the 'newline' character that started them...)

It looks like you were trying simply to unconditionally insert a blank line at these points in the rearranged file. As a workaround, you can remove these empty comment rules or insert an extra blank line at the beginning of the subsequent conditional comment rule.

I'll see if I can make it smart enough to eat up blank lines but not the 'newline' character that separates the stuff before and after the blank line.

I hope to have a fix for you later today.
-Dave

0
Comment actions Permalink

Hi Alan,

In version 2.9 I fixed some bugs related to empty comment rules. (Your "empty" comments actually consist of a single newline character, so generate a blank line unconditionally.)

I noticed that your other comment rules were missing "//" or some other form of Java comment syntax. You'll need to add these or the generated "comments" will cause compiler errors.

Having an empty (blank line) comment without a preceding "//" has the effect of removing every blank line that precedes a class, field, or method. This might not be what you want. Again, you might consider adding "//" to the comment rule.

Let me know if you have any more trouble!

-Dave

0
Comment actions Permalink

Thanks Dave. I promptly went on vacation after my last email, but not before I'd spotted the lack of '//'s in my comments.

Thanks again for the help and the prompt reply...

alan

0

Please sign in to leave a comment.