Menu

#233 SkinPart metatag formating

open
nobody
None
5
2012-11-10
2011-04-28
Anonymous
No

My SkinPart metatags get formatted like this

[ SkinPart( required = "true" ) ]

public var group:Group;

Notice:
- Space between "[" and "SkinPart" but not between ")" and "]"
- New line between metatag and variable declaration.

This is a feature request to allow SkinPart tags to be treated and Bindable tags with the same formatting options.

In the above example I would like to end up with something like:

[SkinPart( "required" = true )]
public var group:Group;

Discussion

  • Ernest

    Ernest - 2011-05-07

    Sorry for the late reply. Now that I look at this more closely, I'm having trouble figuring out what you want to happen exactly.

    What version of the formatter are you working with?

    The spaces inside parens are controlled by the same setting as for expressions.
    It looks like I'm not honoring the spaces around '=' for metatags. I'm going to add that.
    I don't see the behavior you describe about spaces between [ and SkinPart or adding a blank line between the two. I know that if the metatag isn't identified as such, that this behavior can result (the parser treats it as an array declaration or something). However, that doesn't seem to happen when I copy your first example. I think your second example is invalid because you have String=boolean.

     
  • Ernest

    Ernest - 2011-05-07

    I've pushed the change for the next release to honor spaces around equals.

     
  • Ernest

    Ernest - 2011-05-11

    I just published a release containing the space around '='.

     
  • Josh Iverson

    Josh Iverson - 2011-05-23

    Is there a way to add an option to change how meta data is formated only? The reason I ask is because I see that the space around the "=" in the metadata has changed to reflect how .as is formatted with "=".

    So I would like something like this:
    [Bindable(event="someevent")]
    public function set someProp(value:String):void
    {
    _someProp = value;
    }

     
  • Ernest

    Ernest - 2011-05-29

    I've pushed an option on the 'tweaks' page to allow setting the spaces around '=' specially in metatags.

     

Log in to post a comment.