Flex-代码格式化插件: Flex Formatter

 

Flex Formatter is an extremely useful plugin for FlexBuilder / FlashBuilder that formats your ActionScript code (AS3) and MXML according to a broad range of settings, and helps you to generate ASDoc comments automatically. It is free, and open source.

It's code formatting is quite robust and configurable, handling things like brace settings (cuddling versus next line), white space around parameters and operators, sorting imports, and a ton more. Thankfully, you can export your settings to a file and share it with your whole team. You can also have it automatically update settings from a file that you can share over the network or via SVN / GIT.

Unfortunately, it's ASDoc features are much more rudimentary, and do not have any configuration options. They serve as an acceptable starting point, and save some time, but I would love to see some additional support here (for example, an option to mark private and or protected members as @private, which is a very common requirement).

Regrettably, Flex Formatter does not seem to come with installation instructions. If you are not familiar with installing Eclipse plugins, it can take a lot of work to figure it out, but it's very simple if you know how to do it:

  1. Start up FlexBuilder / FlashBuilder.
  2. From the Help menu, select 'Software Updates > Find and Install...'
  3. Select 'Search for new features to install' and click 'Next >'
  4. Click 'New Remote Site...'
  5. Use name: 'Flex Formatter' and url: 'http://flexformatter.googlecode.com/svn/trunk/FlexFormatter/FlexPrettyPrintCommandUpdateSite/'
  6. Click OK
  7. Make sure only 'Flex Formatter' is selected in the 'Sites to search' list, and click 'Finish'
  8. Follow the prompts to install Flex Formatter, and restart the IDE

Once you've restarted, you should see the Flex Formatter bar with buttons to ASDoc, format, and rearrange your code. You should also have a 'Flex Formatting' entry in preferences.

If you'd like, you can import my settings for Flex Formatter. You can download them by clicking here, unzip them, and import them using the 'import...' button at the bottom of Flex Formatter's preferences.

Flex Formatter's project home is here and you can find documentation on it's settings here.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值