[ANN] Tabifier version 2.8

This is a bug fix release. Full details at http://www.intellij.org/twiki/bin/view/Main/TabifierPlugin.

Version 2.7 added functionality to align assignment statements with "prefixes" like if/else statements, e.g.

but would incorrectly align adjacent non-prefixed statements, e.g.


Version 2.8 aligns these lines independently, for example


There is more work to do in this area, but I'll include it with the next major version of tabifier which will align parameters in parameter lists.

Thanks,
-Dave

2 comments
Comment actions Permalink

I have the following lines:
public static final int i = 1;
public static final int ii = 1

You will notice that I have a semicolon missing on the 2nd line.

When I activate the Tabifier, I get this in the console:
ERROR - mand.impl.CommandProcessorImpl -
ERROR - mand.impl.CommandProcessorImpl - IntelliJ IDEA (Aurora)
Bui
ld #828
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: Windows XP
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 el
ement:PsiErrorElement:';' expected, class=com.intellij.psi.impl.source.g.x;
impl
emented interfaces com.intellij.psi.PsiErrorElement,
at
com.wrq.tabifier.parse.AlignableVariableDeclaration$1.visitElement(Al
ignableVariableDeclaration.java:69)
at
com.intellij.psi.JavaElementVisitor.visitErrorElement(JavaElementVisi
tor.java:40)
at com.intellij.psi.impl.source.g.x.accept(x.java:14)
at com.intellij.psi.impl.source.bc.acceptChildren(bc.java:72)
at
com.intellij.psi.PsiRecursiveElementVisitor.visitElement(PsiRecursive
ElementVisitor.java:2)
at
com.wrq.tabifier.parse.AlignableVariableDeclaration$1.visitVariable(A
lignableVariableDeclaration.java:95)
at
com.intellij.psi.JavaElementVisitor.visitField(JavaElementVisitor.jav
a:67)
at com.intellij.psi.impl.source.bi.accept(bi.java:101)
at
com.wrq.tabifier.parse.AlignableVariableDeclaration.parseVariable(Ali
gnableVariableDeclaration.java:161)
at
com.wrq.tabifier.parse.AlignableFieldDeclaration.parse(AlignableField
Declaration.java:42)
at
com.wrq.tabifier.parse.AlignableStatementParser.parseCurrentElement(A
lignableStatementParser.java:193)
at
com.wrq.tabifier.parse.AlignableStatementParser.getNextToken(Alignabl
eStatementParser.java:91)
at
com.wrq.tabifier.parse.Formatter.calculateWidths(Formatter.java:92)
at
com.wrq.tabifier.write_action.reformatRange(write_action.java:417)
at com.wrq.tabifier.write_action.tabify(write_action.java:185)
at
com.wrq.tabifier.write_action.executeWriteAction(write_action.java:12
1)
at
com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.r
un(EditorWriteActionHandler.java:1)
at com.intellij.openapi.application.a.d.runWriteAction(d.java:257)
at
com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.exe
cute(EditorWriteActionHandler.java:4)
at
com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAct
ion.java:1)
at com.intellij.openapi.command.a.b.executeCommand(b.java:55)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:1)
at
com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed
(EditorAction.java:18)
at com.intellij.openapi.a.b.e.a(e.java:41)
at com.intellij.openapi.a.b.e.b(e.java:0)
at com.intellij.openapi.a.b.e.a(e.java:153)
at com.intellij.ide.t.dispatchEvent(t.java:104)
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)


If I add the semicolon it works.



0
Comment actions Permalink

Hi Amnon,

Thanks for the report. Looks like the Psi tree is different when there's an error -- none of my code is prepared to handle a PsiErrorElement. I suspect it is new in Aurora. If so, it's probably time to have two versions of the plugin, one for Ariadna, one for Aurora.

I'll try to fix it over the weekend.

-Dave

0

Please sign in to leave a comment.