How to automatically format AS3 variable declarations in alphabetical order?

During coding, I wondered if there was a plugin that I could highlight a series of variable declarations, hit a special key combination and BAM! They will appear in alphabetical order.

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

So this came from this:

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

For this:

 private var _foobar:Boolean; private var _helloWorld:String; private var _value:Number; 
+4
source share
3 answers

FlexFormatter is a plugin for Flash Builder and allows you to do this. You can enable it in the plugin settings ("AS reranging"). After that, you can select 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/

+6
source

In FlashDevelop, select the variable lines and select Edit> SortLines.

+1
source

In FlashDevelop, you can select text and go to Edit → Sort lines. There may even be a keyboard shortcut.

There is also the Sort Row Groups command, which is useful if you split up groups of variables.

 private var _value1:Number; private var _helloWorld1:String; private var _foobar1:Boolean; private var _value2:Number; private var _helloWorld2:String; private var _foobar2:Boolean; 

leads to

 private var _foobar1:Boolean; private var _helloWorld1:String; private var _value1:Number; private var _foobar2:Boolean; private var _helloWorld2:String; private var _value2:Number; 
+1
source

Source: https://habr.com/ru/post/1382300/


All Articles