Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 1534 - Formatting of Extract Method
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

swinefeaster
Tomato Guru

310 Posts

Posted - Sep 06 2006 :  5:44:20 PM  Show Profile  Reply with Quote
Is there any autotext entry that I can use to change an Extract Method result such as:

void DoSomething( CSomeObject &s );

To look like:

void DoSomething(CSomeObject& s);

?

Thanks!

rhummer
Tomato Guru

USA
527 Posts

Posted - Sep 06 2006 :  5:47:57 PM  Show Profile  Reply with Quote
Yes there is an auto text for extract method, "Refactor Extract Method"

Though, you cannot edit the placement of the '&' character.


Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64


Edited by - rhummer on Sep 06 2006 5:48:29 PM
Go to Top of Page

swinefeaster
Tomato Guru

310 Posts

Posted - Sep 07 2006 :  7:03:20 PM  Show Profile  Reply with Quote
:(
Go to Top of Page

swinefeaster
Tomato Guru

310 Posts

Posted - Sep 07 2006 :  7:04:22 PM  Show Profile  Reply with Quote
then why does it default to old-style?
Go to Top of Page

rhummer
Tomato Guru

USA
527 Posts

Posted - Sep 07 2006 :  8:08:59 PM  Show Profile  Reply with Quote
I'm not sure what you mean.

The parameter list is generated from the $ParameterList$ autotext keyword. Which can't be changed.

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

Go to Top of Page

swinefeaster
Tomato Guru

310 Posts

Posted - Sep 08 2006 :  12:00:41 PM  Show Profile  Reply with Quote
no i mean this:

void Foo(int *blah);

is old-school. the more modern coding style is:

void Foo(int* blah);

same with references. if you don't wanna let us change the style, then change it to the first style... ;)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Sep 09 2006 :  3:20:33 PM  Show Profile  Reply with Quote
i can see half the forum agreeing with you, and half the forum disagreeing with you.

the answer i recall reading was about defining new variables, and said to prefer:

int *foo, bar;


to:

int* foo, bar;


since the first makes it more clear that only foo will be a pointer. i have always preferred the first style, and the point about clarity makes sense to me.

however i try to avoid imposing my views on others, since then we would spend all of our time arguing and getting no work done

before you ask for a simple check box option, what do i say to the person who posts and wants the format:

void Foo(int * blah);


this is why we try to stay away from code formatting, since you end up with hundreds of options, since that is the only way to keep everyone happy.

zen is the art of being at one with the two'ness
Go to Top of Page

rhummer
Tomato Guru

USA
527 Posts

Posted - Sep 09 2006 :  3:24:01 PM  Show Profile  Reply with Quote
I agree with feline, getting into formatting options is a big can of worms to try and open.

I personally would scream murder if things were formated like:
int* foo;


I prefer:
int *foo;

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64


Edited by - rhummer on Sep 09 2006 3:24:55 PM
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Sep 09 2006 :  6:28:28 PM  Show Profile  Reply with Quote
Personally, I prefer

int* foo;

I avoid the confusion by never declaring two variables with the same statement.

I vote that we leave code formatting to programs like GC.

However, why is it that we include the "decorations" within the autotext keyword instead of separately? Maybe instead of an option, a different autotext keyword? Something like, $ParameterListSpace$ ??

Joe Pizzi
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Sep 10 2006 :  5:55:23 PM  Show Profile  Reply with Quote
this is an educated guess, but there is a single keyword for ease. this gives everyone a reasonable degree of control over the formatting, while avoiding problems with functions like:

void FelineDoesThis(const QValueList<drugMapping, QPair<int, QString> > &listCheck, const QString &drugName);

virtual void insertItem(const QString &, const QString &) { ; }  // a bit of a hack, but it works


now i know that you can separate each parameter into "type" and "name", but if we want to get picky about control over spaces and formatting code like this opens up a can of worms, just with two lines of code. i have things like this, and worse, in my code and i hardly ever make template functions or classes!

as for GC, this is an excellent program

http://sourceforge.net/projects/gcgreatcode/

but last time i tried it, it did not have enough options! there were things i wanted to do that it would not let me do. *checks* the readme file telling you how to control GC is 4,375 lines long! this is slightly off putting

zen is the art of being at one with the two'ness
Go to Top of Page

swinefeaster
Tomato Guru

310 Posts

Posted - Sep 18 2006 :  3:05:10 PM  Show Profile  Reply with Quote
so the answer is no ?

i agree that VAX shouldn't be doing code formatting of existing code, but when it adds new code, it should at least be configurable. otherwise it's just plain annoying to do refactoring, cause you have to go back and fix everything.
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Sep 19 2006 :  12:22:47 AM  Show Profile  Reply with Quote
I'll point support to the thread and see what they say.

Joe Pizzi
Go to Top of Page

Admin
Whole Tomato Software

USA
74 Posts

Posted - Sep 19 2006 :  12:38:09 AM  Show Profile  Reply with Quote
swinefeaster: You make a good point and we hear you.
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Sep 19 2006 :  12:51:55 AM  Show Profile  Reply with Quote
I entered a case for this.

case=2580

Joe Pizzi
Go to Top of Page

swinefeaster
Tomato Guru

310 Posts

Posted - Sep 19 2006 :  11:22:02 AM  Show Profile  Reply with Quote
ok great thanks :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000