如何按字母顺序自动格式化 AS3 变量声明?
在编码时,我想知道是否存在一个插件,我可以突出显示一系列变量声明,点击一些特殊的键盘快捷键,然后砰!它们会按字母顺序出现。
Flash Builder 中有什么可以做到这一点吗?甚至FlashDevelop?
所以它会从这样:
private var _value:Number;
private var _helloWorld:String;
private var _foobar:Boolean;
到这样:
private var _foobar:Boolean;
private var _helloWorld:String;
private var _value:Number;
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;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
FlexFormatter 是 Flash Builder 的一个插件,允许您执行此操作。您可以在插件的选项中启用它(“AS 重新排列”)。然后,您可以选择代码行并按 Ctrl + Shift + F 设置所选行的格式。
您可以通过将以下更新站点添加到 Flash Builder (Eclipse) 来安装该插件:
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):
在 FlashDevelop 中突出显示变量行并转到“编辑”>“排序行。
In FlashDevelop Highlight the variable lines and go Edit > SortLines.
在 FlashDevelop 中,您可以选择一些文本并转到“编辑”->“编辑”。对行进行排序。
甚至可能有一个键盘快捷键。
还有命令对行组进行排序,如果您有单独的变量组,该命令非常有用。
结果
In FlashDevelop, you can select some text and go to Edit -> Sort lines.
There might even be a keyboard shortcut for it.
There also is the command Sort line groups, which is useful if you have separated variable groups.
results in