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
 Extract method - Missing space
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bwinter
New Member

Germany
3 Posts

Posted - Feb 21 2011 :  03:34:08 AM  Show Profile  Reply with Quote
The codestyle of my company requires a space between a method name and (). [C++]
So I have turned on the option "Insert () and closing ... and put 1 spaces between method name and ().

After using "Extract method" the remaining method call does not have this space.

Example:
callMethod (withArgument ());

after "Extract method":
newMethod(); <-- no space in between

void Foo::newMethod ()
{
callMethod (withArgument ());
}



VA_X.dll file version 10.6.1842.0 built 2011.02.03
Licensed to:
VA X: --- (31-user license) Support ends 2012.03.31
DevEnv.exe version 9.0.30729.1 Professional
msenv.dll version 9.0.30729.1
Font: Courier New 13(Pixels)
Comctl32.dll version 6.10.7600.16661
Windows 7 6.1 Build 7600
4 processors (x86-64;
WOW64)

Platform: Win32
Stable Includes:
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\include;
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include;

Other Includes:

Stable Source Directories:
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfc;
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfcm;
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\atl;
C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\crt\\src;


Edited by - bwinter on Feb 21 2011 03:36:35 AM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 21 2011 :  08:50:58 AM  Show Profile  Reply with Quote
Refactorings have its own snippets which you can edit so you can use your styles. To open the snippet editor, just select VAssistX -> Tools -> Edit VA Snippets...

Here, open the treenode for your language (e.g. C++, C#) and find the snippet "Refactor Extract Method". You will also find other snippets for other refactorings near this one.

Edited by - accord on Feb 21 2011 09:08:32 AM
Go to Top of Page

bwinter
New Member

Germany
3 Posts

Posted - Feb 21 2011 :  09:47:22 AM  Show Profile  Reply with Quote
Thank for your reply accord.

I already have adjusted the refactoring snippets, but
I cannot find anything for defining the leftover call of the extracted method.

Updated example:
void Foo::bar ()
{
callMethod (withArgument ()); <-- use extract method on this line
}

after "Extract method":
void Foo::bar ()
{
newMethod(); <-- no space in between
}

void Foo::newMethod ()
{
callMethod (withArgument ());
}

Edited by - bwinter on Feb 21 2011 09:47:52 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Feb 22 2011 :  3:08:15 PM  Show Profile  Reply with Quote
Unfortunately you cannot configure the formatting of the new function call created by Extract Method. We have discussed more extensive code formatting, but it is a tricky area, partly due to the very large number of options it would require.

Have you considered using a separate tool that specialises in code formatting? This is one example, but I have never used it personally so I don't know how well it actually works:

http://www.profactor.co.uk/stylemanager.php

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

bwinter
New Member

Germany
3 Posts

Posted - Feb 23 2011 :  02:43:17 AM  Show Profile  Reply with Quote
Thank you for clarifying this.

I will have a look at some formatting tools or just accept the manual correction.
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