Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto-format AS3 variable declarations in alphabetical order?

While coding, I wondered if a plugin exists that I could highlight a series of variable declarations, hit some special keyboard shortcut and BAM! They would appear in alphabetical order.

Is there anything that does this in Flash Builder? Or FlashDevelop even?

So it would go from this:

private var _value:Number;
private var _helloWorld:String;
private var _foobar:Boolean;

To this:

private var _foobar:Boolean;
private var _helloWorld:String;
private var _value:Number;
like image 608
chamberlainpi Avatar asked Feb 23 '23 08:02

chamberlainpi


1 Answers

FlexFormatter is a plugin for Flash Builder and allows you to do this. You can enable it in the plugin's options ("AS rearranging"). Afterwards you can select the lines of code and press Ctrl + Shift + F to format the selected lines.

You can install the plugin by adding the following update site to your Flash Builder (Eclipse):

http://flexformatter.googlecode.com/svn/trunk/FlexFormatter/FlexPrettyPrintCommandUpdateSite/

like image 131
Gerhard Schlager Avatar answered Apr 26 '23 11:04

Gerhard Schlager