[Rearranger] Bug with saved configuration.

Dave,

I've encountered a small bug when reading in a saved Rearranger
configuration: all multi-line separator comments get flattened onto a single
line. This includes comments for interface methods.

I'd also like a few enhancements to the rearrangement preview window, if
possible:

  • Include separator comment rules in the display (perhaps with a checkbox to

toggle them on and off).

  • An option to only show the matched rules (including matched separator

comments).
I think that would help give a better idea of what the rearranged file is
going to look like.

Hope that's not being too greedy, :)
Vil.
--
Vilya Harvey
vilya.harvey@digitalsteps.com / digital steps /
(W) +44 (0)1483 469 480
(M) +44 (0)7816 678 457 http://www.digitalsteps.com/

4 comments

Great suggestions, Vil - thanks! Now replacing those checkboxes with visible (larger than 1x1) icon buttons is even more imperative. I'll need to hire a graphics designer for all the new icons, though... :)


(I think I misspoke in my last post; the icons in the live rearranger window are implemented with JButtons, not JCheckboxes.)

0

Another bug with Rearranger:

The following code:
public final void setPrice( final double price )

{
this.price = price;
}

Rearranged doesn't pull up the braces a line.

Also if you have

private String status;

private double price;

private Integer sqFootage;

On rearranging with the default format, it doesn't pull these together into:

private String status;
private double price;
private Integer sqFootage;


Also is there a way to group those by type? So Strings are with
Strings, and Integers with Integers, THEN alpha?

Thanks
R

0

Hi Robert,

There's no setting for "force blank lines before method left brace." Currently the plugin can remove or force blank lines after the left brace, and before/after the right brace. I guess I didn't add it because nobody asked for it before! So it's on my list of feature requests. Similarly, there's no setting for "force ]]> blank lines before field declarations." Same reason, same list. :)

In both cases there's a wrinkle. If a javadoc comment precedes the field (or method), there are two (or three) places where blank lines could occur:
- before the javadoc
- after the javadoc, before the field or method name
- after the method name but before the left brace

Where are the blank lines supposed to be removed or inserted? Or do we need settings for all 5 (2 for fields, 3 for methods) possibilities?

There's an awkward way to group fields by type. You have to create a rule for each type, e.g.

would gather all the String variables together. The 'alphabetize' checkbox controls whether they would appear in original or alphabetical order.

But currently there's no way to group by type, by name within a single rule.

I could add another checkbox to field/method/class rules that sorts by type. It would take priority over sorting alphabetically, I would think. Would this meet your requirement?

-Dave

0

Robert,

Take a look at version 3.5 of the plugin. I added two features that you requested:

1) Removing the blank line between method declaration and body by setting the new spacing option "Force ]]> blank lines before method open brace" to zero, e.g.


2) Added (in version 3.4) the ability to sort alphabetically by type, then by name. You can indicate that types should be sorted ignoring case, so "int" would come between "Boolean" and "String".

3) IDEA has a feature already that would probably solve your other problem; you wanted blank lines between fields removed in

I think you can do that by setting "Code Style...Blank Lines Around field" to zero and reformatting.

Let me know if this is unsatisfactory.
-Dave

0

Please sign in to leave a comment.