[ANN] Tabifier 2.6 released

The tabifier plugin vertically aligns various syntactic elements of Java
declarations and assignment statements according to configuration options.

See http://www.intellij.org/twiki/bin/view/Main/TabifierPlugin for complete
details.

27 May 2003 - Version 2.6

-- enhancement: user can control what happens when no selection is made:
tabify entire file, or only the line containing the cursor (default)
-- bug fix: An extra leading space could be emitted when (for example)
variable types were not aligned but variable names were.
-- debugging output now contains version number.


10 comments
Comment actions Permalink

Dave Kriewall wrote:

The tabifier plugin vertically aligns various syntactic elements of Java
declarations and assignment statements according to configuration options.


I just tested it for the first time. Mostly it gives me exactly the
results I want (thanks!), but it does not seem to handle assigments at
the same line as a statement properly.

Take the following class (just a silly example):

package test;
public class TestMe {
public static void main(String[] args) {
int i;
if (args.length == 0) i = 0;
else i = 1;
}
}

Tabifier wants to remove all indentation from the "if" and "else" lines:

package test;
public class TestMe {
public static void main(String[] args) {
int i;
if (args.length == 0) i = 0;
else i = 1;
}
}

0
Comment actions Permalink

Jonas Kvarnstr?m wrote:

Take the following class (just a silly example):


Seems I had tabs in there. What I meant was:


Tabifier wants to remove all indentation from the "if" and "else" lines:


0
Comment actions Permalink

Hi Jonas,

Thanks for the report. I will fix it so indentation is not broken. But
before I do, may I ask you (and the newsgroup) for some feedback?

1) Would you rather have tabifier leave these if/else lines intact or are
you asking that it align the assignment statements after the if/else parts?

Eg.

if (args.length == 0) i = 0;
else i = 1;

(Needs fixed font to be viewed properly but you get the idea.)

2) I never encounter your situation because by convention I have to use
braces even when the block contains only one statement. Does this situation
only occur for you in if/else/else-if sequences? Or can it occur with any
type of statement that contains a statement block (such as for, while, do,
try)? Eg

for (i=0; i < 10; i+) aray = i;
for (j=0; j < k; j++) otherstuf[j] = something;
while (m < n) aray[m++] = n;


Should all these array element assignment statements align?

Thanks-
Dave


0
Comment actions Permalink

Dave Kriewall wrote:

1) Would you rather have tabifier leave these if/else lines intact or are
you asking that it align the assignment statements after the if/else parts?


Personally I think I would be satisfied with either, whichever is easier
for you.

I haven't checked other kinds of statements. I'll try to remember to do
that at work tomorrow (then I'll be away for a week so if you get no
more comments that's the reason).

0
Comment actions Permalink

Should all these array element assignment statements align?


Yep, it'd be a nice idea. But it's not mandatory !

Guillaume


0
Comment actions Permalink

Hi Jonas,

Version 2.7 is available -- give it a try and let me know if you have any more problems.

Thanks for the bug report!
-Dave

0
Comment actions Permalink

Dave Kriewall wrote:

Version 2.7 is available -- give it a try and let me know if you have any more problems.


Thanks! I'm away at a conference now but I've downloaded it and will be
testing it soon. I'll get back to you if I find any bugs.

0
Comment actions Permalink

Dave Kriewall wrote:

Version 2.7 is available -- give it a try and let me know if you have any more problems.


One more test case, where the first assignment should not be indented:



0
Comment actions Permalink

Hmm, I see. What should the rule be, though -- separate alignment columns for assignment statements with and without preceding tokens?

E.g.

So that lines 1 & 3 are aligned together, and 2 & 4 are aligned together?

If so, do we need another grouping option to separate groups of assignments that have no "prefix" from those that don't? This would allow choice between the above and

where only lines 2 & 3 are aligned.

Or, lines rearranged for example, would result in

where again only lines 2 & 3 are aligned.

If there's some consensus, I hope to have it fixed today.
Thanks, -Dave

0
Comment actions Permalink

Dave Kriewall wrote:

If so, do we need another grouping option to separate groups of assignments that have no "prefix" from those that don't?


I'd say you can start a new "group" of alignment lines whenever you
switch between having and not having a prefix. That boundary could be
treated just like a blank line, so the result would be as in your second
and third examples, not as in the first example.

But now I see that you've released a new version, so I should probably
just shut up and test it before I say anything :)

0

Please sign in to leave a comment.