Fields and local variables lose their annotations. Format code places the field annotations above the field declarations. CTRL-ALT-SHIFT-T then nukes them. I'm using the default Tabifier settings with one exception. The hotkey tabifies the whole file if no lines are selected.
In the Tabifier configuration panels, go to the Line Grouping pane and uncheck the option "Non-blank lines (non-tabifiable statements) delimit groups". This will cause the tabifier to group the two assignment statements together and do what you want.
surely I'm not the only one that this is happening to...
uninstall - click
problem solved :(
Tony,
Sorry for the delay in responding. I've been out of town. Are you talking about field declarations? Give me a sample piece of code and I'll fix it.
-Dave
Fields and local variables lose their annotations. Format code places the field annotations above the field declarations. CTRL-ALT-SHIFT-T then nukes them. I'm using the default Tabifier settings with one exception. The hotkey tabifies the whole file if no lines are selected.
import org.jetbrains.annotations.NonNls;
public class AnnotationsClobbered {
@NonNls
private String annotatedField;
@NonNls
private String anotherAnnotatedField;
public String getAnnotatedField() {
return annotatedField;
}
public void setAnnotatedField(final String annotatedField) {
this.annotatedField = annotatedField;
}
public String getAnotherAnnotatedField() {
return anotherAnnotatedField;
}
public void setAnotherAnnotatedField(final String anotherAnnotatedField) {
this.anotherAnnotatedField = anotherAnnotatedField;
}
public static void main(String[] args) {
@NonNls final String a1;
@NonNls final String a2;
}
}
Message was edited by:
Tony Johnson
Message was edited by:
Tony Johnson
Thanks, Tony. I've uploaded a new version, 5.2, which will preserve those annotations. Let me know if you have any problems.
I appreciate your patience and the bug report!
-Dave
Thanks. The annotations are now preserved. Unfortunately, fields that are divided by annotations are not aligned - eg:
@NonNls
public static final String GLOBAL_MAPPING_KEY_SUCCESS = "success";
@NonNls
public static final String GLOBAL_MAPPING_KEY_ERROR = "error";
does not have the initial value aligned after the file is Tabified.
Tony
Tony,
In the Tabifier configuration panels, go to the Line Grouping pane and uncheck the option "Non-blank lines (non-tabifiable statements) delimit groups". This will cause the tabifier to group the two assignment statements together and do what you want.
-Dave