History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: FB-8297
Type: Minor Enhancement Minor Enhancement
Status: Waiting on Info Waiting on Info
Priority: C C
Assignee: Heidi Williams
Reporter: Leen Toelen
Votes: 120
Watchers: 52
Operations

If you were logged in you would be able to see more operations.
Flash Builder / Flex Builder

Source code formatter

Created: 07/13/07 01:29 AM   Updated: 04/30/09 09:42 AM
Component/s: General Eclipse UI
Security Level: Public (All JIRA Users )

Issue Links:
Duplicate
 
This issue is duplicated by:
FB-13044 Code fomatting not possible in Flex B... C Closed

Severity: Usability Issue
Reproducibility: Every Time
Discoverability: High
Found in Version: Moxie M3 (Beta 2)
Milestone: Gumbo I10
Affected OS(s): All OS Platforms - All
Steps to Reproduce:
Steps to reproduce:
1. Go to Source menu item
2. There is not format action
 
Expected Results:
There really should be a code formatter. When copy-pasting code around a file, MXML/AS3 code gets messy really fast. A formatter would really help a lot to keep your code readable.
 
 Workaround (if any):
 
 
 
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: No
QA Owner: Mac Martine
Fixed Version: (Planning) Post Moxie - Next Build
Confirmed Version: Moxie M3 (Beta 2) - 178196
Participants: Asai, Ben Clinkinbeard, Dasa Paddock, Ernest Pasour, Harry B. Garland, Heidi Williams, Larry McLister, Leen Toelen, Leif Wells, RJ Owen, Tanya Dimalsky, Tom Chiverton and Tony Fendall


 All   Comments      Sort Order:
Heidi Williams - [07/31/07 11:40 AM ]
QRB deferred for Moxie.

Leif Wells - [04/16/08 11:45 AM ]
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.



Leif Wells - [05/20/08 06:09 PM ]
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).

RJ Owen - [05/20/08 11:51 PM ]
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.

Tony Fendall - [05/21/08 05:19 PM ]
Adding Leif's comments, it would be nice if it would always put the "id" attribute first

Dasa Paddock - [05/23/08 10:49 AM ]
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

Larry McLister - [05/30/08 03:40 PM ]
moved to I6

Larry McLister - [08/25/08 06:00 PM ]
moved to I7

Larry McLister - [09/16/08 06:34 PM ]
move from I7 to I8

Larry McLister - [10/03/08 03:45 PM ]
to HW MAX

Larry McLister - [10/13/08 03:11 PM ]
to postMAX

Asai - [12/01/08 11:22 AM ]
Seems like a feature which most mature Eclipse based platforms already have. Would be good for Flex Builder to have this included. Makes Flex look a little behind the times.

Ernest Pasour - [12/19/08 09:45 AM ]
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/

Larry McLister - [01/05/09 03:46 PM ]
bulk change from I9 to I10

Heidi Williams - [01/18/09 10:58 PM ]
consider_for_i13

Harry B. Garland - [01/29/09 12:46 PM ]
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.)

Tom Chiverton - [04/30/09 09:31 AM ]
Why don't Adobe just bundle http://sourceforge.net/projects/flexformatter/ and be done with it ?

Ben Clinkinbeard - [04/30/09 09:42 AM ]
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.