[ANN] Tabifier 2.4 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.

22 May 2003 - Version 2.4 - bug fix:

multiline field or variable declarations like

int a = 1,
b = 2,
c = 3;

could be incorrectly aligned as if "b" and "c" were assignment expressions.
If the grouping option was set to format adjacent declarations and
assignments independently, then "b" and "c" would be aligned relative to
each other but not to "a". Now treat "b" and "c" as declarations. This
forces "a", "b" and "c" to be formatted together in all cases.

Thanks, Guillaume, for reporting the bug and for using the plugin!

-Dave


5 comments
Comment actions Permalink

Hello Dave,

Thanks, Guillaume, for reporting the bug and for using the plugin!


Thank you for this quick fix !
Now Tabifier is just perfect

Guillaume

PS : one minor bug though, just by curiosity, I tried to "tabify" a
selection in the HTML part of a JSP, and I got an internal error exception.
It does not prevent IDEA from working. But maybe there is a check that is
missing ? The plugin must be sure that the current selection is only pure
Java, or something like that.

Here is the stacktrace I got :

2003-05-22 09:55:26,031 ERROR - mand.impl.CommandProcessorImpl -
2003-05-22 09:55:26,046 ERROR - mand.impl.CommandProcessorImpl -
IntelliJ IDEA 3.0.1 Build #694
2003-05-22 09:55:26,046 ERROR - mand.impl.CommandProcessorImpl -
JDK: 1.4.1_01
2003-05-22 09:55:26,046 ERROR - mand.impl.CommandProcessorImpl -
VM: Java HotSpot(TM) Client VM
2003-05-22 09:55:26,046 ERROR - mand.impl.CommandProcessorImpl -
Vendor: Sun Microsystems Inc.
2003-05-22 09:55:26,046 ERROR - mand.impl.CommandProcessorImpl -
OS: Windows XP
2003-05-22 09:55:26,046 ERROR - mand.impl.CommandProcessorImpl -
Last Action: Tabifier
2003-05-22 09:55:26,046 ERROR - mand.impl.CommandProcessorImpl -
Current Command: Tabifier
2003-05-22 09:55:26,046 ERROR - mand.impl.CommandProcessorImpl -
com.wrq.tabifier.parse.UnacceptableSyntaxException: split token wasn't
PsiWhiteSpace
at
com.wrq.tabifier.parse.AlignableStatementParser.getNextToken(AlignableStatem
entParser.java:108)
at com.wrq.tabifier.parse.Formatter.calculateWidths(Formatter.java:66)
at com.wrq.tabifier.write_action.reformatRange(write_action.java:386)
at com.wrq.tabifier.write_action.tabify(write_action.java:157)
at com.wrq.tabifier.write_action.executeWriteAction(write_action.java:99)
at
com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(Edit
orWriteActionHandler.java:2)
at com.intellij.openapi.application.a.e.runWriteAction(e.java:235)
at
com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.execute(Ed
itorWriteActionHandler.java:2)
at
com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.jav
a:2)
at com.intellij.openapi.command.a.b.executeCommand(b.java:26)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(Editor
Action.java:6)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(Editor
Action.java:22)
at com.intellij.openapi.a.b.e.a(e.java:0)
at com.intellij.openapi.a.b.e.b(e.java:47)
at com.intellij.openapi.a.b.e.a(e.java:116)
at com.intellij.ide.q.dispatchEvent(q.java:91)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


0
Comment actions Permalink

It is supposed to work in #815 ???

I'm getting:

ERROR - mand.impl.CommandProcessorImpl -
ERROR - mand.impl.CommandProcessorImpl - IntelliJ IDEA (Aurora) Build #815
ERROR - mand.impl.CommandProcessorImpl - JDK: 1.4.1_02
ERROR - mand.impl.CommandProcessorImpl - VM: Java HotSpot(TM) Client VM
ERROR - mand.impl.CommandProcessorImpl - Vendor: Sun Microsystems Inc.
ERROR - mand.impl.CommandProcessorImpl - OS: Linux
ERROR - mand.impl.CommandProcessorImpl - Last Action: Tabifier
ERROR - mand.impl.CommandProcessorImpl - Current Command: Tabifier
ERROR - mand.impl.CommandProcessorImpl -
com.wrq.tabifier.parse.UnacceptableSyntaxException: parseVariable: unexpected element:PsiTypeElement:int
at com.wrq.tabifier.parse.AlignableVariableDeclaration$1.visitElement(AlignableVariableDeclaration.java:44)
at com.intellij.psi.JavaElementVisitor.visitTypeElement(JavaElementVisitor.java:149)
at com.intellij.psi.impl.source.ba.accept(ba.java:15)
at com.intellij.psi.impl.source.bc.acceptChildren(bc.java:8)
at com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursiveElementVisitor.java:2)
at com.wrq.tabifier.parse.AlignableVariableDeclaration$1.visitVariable(AlignableVariableDeclaration.java:68)
at com.intellij.psi.JavaElementVisitor.visitField(JavaElementVisitor.java:56)
at com.intellij.psi.impl.source.bi.accept(bi.java:18)
at com.wrq.tabifier.parse.AlignableVariableDeclaration.parseVariable(AlignableVariableDeclaration.java:134)
at com.wrq.tabifier.parse.AlignableFieldDeclaration.parse(AlignableFieldDeclaration.java:42)
at com.wrq.tabifier.parse.AlignableStatementParser.parseCurrentElement(AlignableStatementParser.java:222)
at com.wrq.tabifier.parse.AlignableStatementParser.getNextToken(AlignableStatementParser.java:112)
at com.wrq.tabifier.parse.Formatter.calculateWidths(Formatter.java:66)
at com.wrq.tabifier.write_action.reformatRange(write_action.java:386)
at com.wrq.tabifier.write_action.tabify(write_action.java:157)
at com.wrq.tabifier.write_action.executeWriteAction(write_action.java:99)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java)
at com.intellij.openapi.application.a.d.runWriteAction(d.java:97)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.execute(EditorWriteActionHandler.java:1)
at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java)
at com.intellij.openapi.command.a.b.executeCommand(b.java:2)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:1)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:7)
at com.intellij.openapi.a.a.e.a(e.java:136)
at com.intellij.openapi.a.a.e.b(e.java:6)
at com.intellij.openapi.a.a.e.a(e.java:35)
at com.intellij.ide.t.dispatchEvent(t.java:87)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.tzambalayev.util.ReflectUtil.invoke(ReflectUtil.java:13)
at org.tzambalayev.ideaplugins.tabswitch.EventQueueDecorator.dispatchEvent(EventQueueDecorator.java:55)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

0
Comment actions Permalink

Hi Daniel,

I think you'd get this exception under any version -- it's not related to
build 815, sounds like a plain old bug. May be choking on some illegal
syntax. I can remove the check but would like to know what caused it.

To fix it, though, could you do two things?

1) send me the file you're tabifying, and tell me what lines you selected
(if any).
2) On project settings for Tabifier, under Troubleshooting tab, enable debug
output, do the tabify operation that fails, then disable debug output and
send me that output file.

Thanks very much,
-Dave


0
Comment actions Permalink

Bonjour Guillaume,

Wow, two bugs in two days! Maybe I'll have to give you two free copies!
(I'm sure you have a relative, spouse or friend who could use one. :)

This one is not too serious -- I can simply refuse to tabify a selection
that contains a line that doesn't begin with white space. I'm curious
though how that could happen. (Most lines are preceded by a newline
character which ends up being parsed into a PsiWhiteSpace object.) Could
you send me your file and tell me what lines you selected? Also, if not too
much trouble, do the "debugging thing" -- go to Project Settings for
tabifier, Troubleshooting tab, turn on debugging, run the tabification, turn
off debugging, send me the output file.


Merci bien,
-Dave


0
Comment actions Permalink

Wow, two bugs in two days! Maybe I'll have to give you two free copies!
(I'm sure you have a relative, spouse or friend who could use one. :)


Well Dave, my girl friend would certainly be happy, but unfortunately (or
fortunately) she is not a Java developer ;)

This one is not too serious -- I can simply refuse to tabify a selection
that contains a line that doesn't begin with white space. I'm curious
though how that could happen. (Most lines are preceded by a newline
character which ends up being parsed into a PsiWhiteSpace object.) Could
you send me your file and tell me what lines you selected? Also, if not

too

much trouble, do the "debugging thing" -- go to Project Settings for
tabifier, Troubleshooting tab, turn on debugging, run the tabification,

turn

off debugging, send me the output file.


True ! I have forgotten that it's possible to turn on debugging
When I have some time, I'll try to reproduce that bug.
In fact, it happend when I selected some JavaScript lines (maybe not full
lines) inside a JSP.

Guillaume


0

Please sign in to leave a comment.