|
|
|
[
Permlink
| « Hide
]
Heidi Williams - [07/31/07 11:40 AM ]
QRB deferred for Moxie.
If you are seriously considering implementing a source formatter, please consider the following requests:
1) Make it possible for us to set team standards for source formatting so that we can control the order of our MXML attributes. For instance: Format attributes to always list "x" before "y" Format attributes to always list "width" and "height" after "x" and "y" Format code to always place a line break after "x", "y", "width" and "height" keeping those attributes on a single line Items like these can make standardizing code a little easier in teams. 2) Make it possible for us to create and set templates for new MXML and ActionScript files so we may be able to control things like copyright notices when a file is created. Tim, if you want to discuss how this issue effects me, feel free to contact me at any time (leif [dot] wells [at] gmail [dot] com).
This issue is partially addressed by adding Snippets to Flex Builder. However, this is a rather difficult process for the average user and doesn't provide the same depth of functionality that a real source formatter would. Snippets also change on a per-workspace basis and the user has to create them all from scratch at least once anyway. I'd love to see something of the same level as Java's source formatter - it'd be a huge plus for me.
Adding Leif's comments, it would be nice if it would always put the "id" attribute first
It'd be great if it had an option to format the code according to the coding conventions at:
http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions I've put together a plug-in that allows a small number of indenting/formatting options that satisfies most of my needs. It has a BSD license (because it uses the Antlr parser), so it is modifiable/reshippable etc. with minimal restrictions.
Also, I put in some code that allows you to specify which mxml attrs appear on successive lines, and in what order. Seems to satisfy the requests of Leif and Tony above, although it may not be intuitive how to use it. There are no guarantees that all legal code will be accepted by my parser, but I've done my best. If the code cannot be parsed, or if the output text doesn't seem to 'match' the input text, then the format will fail with an error and without modifying the text. However, use at your own risk. https://sourceforge.net/projects/flexformatter/ I am big on the rule of "one statement per line of code", so I'd like this formatter to preserve the following format, EVEN WHEN new xmlns tags are being automatically added:
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:maps="com.on24.JiraOnAir.maps.*" xmlns:model="com.on24.JiraOnAir.model.*" xmlns:views="com.on24.JiraOnAir.ui.views.*" layout="absolute" width="1000" height="750" > <mx:Style source="assets/yflexskin.css" /> <mx:Binding source="jiraModel.applicationState.isLoginOK" destination="isLoggedIn" /> (etc.) Why don't Adobe just bundle http://sourceforge.net/projects/flexformatter/ and be done with it ?
I agree with Tom. I started using http://sourceforge.net/projects/flexformatter/ a few days ago and while its not perfect, its certainly a great start. Shouldn't be that tough to polish the corners and create some hooks for it.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||