MXML Code Reformating

I think I must be missing something again, but my Code reformatting does not do this on actionscript files only MXML files.

When I reformat the first line of every function is placed on the same line as the function declaration and my closing brace is placed at the end of my last line. It looks like this.


Reformatted
private function onButtonBarChange(event:IndexChangeEvent):void { var buttonBar:ButtonBar = (event.target as ButtonBar);

 this.currentState = buttonBar.selectedItem.state; }


When I would like it to look like this


Desired
private function onButtonBarChange(event:IndexChangeEvent):void {
var buttonBar:ButtonBar = (event.target as ButtonBar);
 this.currentState = buttonBar.selectedItem.state;
}


This happens the same if the function only has 1 line in it, but it breaks the whole thing down into a single line.


Reformatted
private function addedHandler(event:Event):void { trace(event.target + " :: " + event.currentTarget);}


Desired
private function addedHandler(event:Event):void {
 trace(event.target + " :: " + event.currentTarget);
 }



Like I said this is only happeneing in MXML file inside the script tag which is enclosed in CDATA. Any help?

thanks,
-ross
4 comments
Comment actions Permalink

Can't reproduce this really strange behavior. Do you use default or customized code style settings (File | Code Style)?

0
Comment actions Permalink

Yes I did. I looked through for a few minutes and tried to match all my custom settings back to default, but it was still causing this problem.

To fix it I simply deleted my custom style and re-created it from a copy of default. I am not sure what happened, I have been using that style
through a lot of different versions of IntelliJ if that matters.


thanks,
-ross

0
Comment actions Permalink

So is the problem resolved now?
You  can attach here your old code style that caused problems if you want us  to check if that was a bug (use File | Export Settings, check 'File  Templates,..., Code style schemes).

0
Comment actions Permalink

Sadly I trashed the file on this computer though I am using the same style on other computers at home. When I get there I will confirm the problem is happeneing and attach the style.

It is resolved deleting and recreating the style from a copy of default.

-ross

0

Please sign in to leave a comment.