View unanswered posts | View active topics



Reply to topic  [ 8 posts ] 
Genereated getter/setter do not respect indenting settings 
Author Message
Member

Joined: Wed Jan 06, 2010 10:45 am
Posts: 5
When generating getters/setters using CTRL+SHIT+1 the getter always ends up as a single line like this:

Code:
public function get foo():type { return _foo; }


And the setter only seems to respect the style type setting, so that it always ends up as either this:

Code:
public function set foo(value:type):void
{
    _foo = value;
}


or this:

Code:
public function set foo(value:type):void  {
    _foo = value;
}


Regards
Timo


Sun Oct 10, 2010 11:29 pm
Profile
Member

Joined: Thu Mar 29, 2007 9:32 am
Posts: 244
you can customize formatting in Generator.txt file. However, I agree that formatting should be changed to a proper one by default to respect coding conventions


Mon Oct 11, 2010 6:40 am
Profile
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 3034
Location: Finland
I have to agree here. I will change it.


Mon Oct 11, 2010 6:45 am
Profile WWW
Admin

Joined: Wed Aug 31, 2005 7:27 am
Posts: 12172
Location: London
Hey I don't agree ;) All these getters take too much space.


Mon Oct 11, 2010 9:14 pm
Profile WWW
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 3034
Location: Finland
Well they should follow the indent settings as everything else does. FD should generate clean code, not minimal.

And also, you can customize the templates as you wish. :)


Mon Oct 11, 2010 9:40 pm
Profile WWW
Member

Joined: Wed Jun 20, 2007 8:09 am
Posts: 331
Hi,

I go for the minimal one (in the default case) - like Philippe said, otherwise it takes too much space.

If a getter is a simple getter I write the minimal one, if it's a "complex" getter (other than "return xxx;") I write it like a normal function.
Then, if I see a minimal getter I instantly know: "OK, its a simple one." and I don't have to bother with the function body.

Lg
warappa

_________________
Practice always defeats theory


Tue Oct 12, 2010 8:08 am
Profile WWW
Member

Joined: Sat May 02, 2009 1:08 pm
Posts: 96
yeah single line getters are a must.
let's break some damn rules for the sake of creativity :)


Tue Oct 12, 2010 8:27 am
Profile WWW
Admin

Joined: Tue Aug 30, 2005 6:14 pm
Posts: 3034
Location: Finland
It should follow the normal code formatting settings and other generic coding templates like if's. We do not know if the dev intents to add some other functionality to it.

As stated, you can easily customize this template file.


Tue Oct 12, 2010 9:05 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.