Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1645: Extract Method to Source does not bring code

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Krakken Posted - Jul 15 2008 : 02:38:49 AM
Build 1645, the new "Extract Method" with "Extract to Source" checked does not bring highlighted source code along to the .cpp, instead it remains in the header.

Example:

void Class::BigFunc()
{
	m_iIndex = 0; // Highlight and extract this line.

	while (m_iIndex < 10)
		m_iIndex++;
}


Highlighting the specified line of code and extracting to source gives this result:

//
// HEADER FILE
//
class Class
{
	void ExtractedMethod()
	{
		m_iIndex = 0; // Highlight and extract this line.
	}
}

//
// SOURCE FILE
//
void Class::ExtractedMethod()
{
	
}


9   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 18 2008 : 09:21:14 AM
Can you please export your VA and IDE settings and send them to me:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

Please submit the files via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, so we can match it up.

I can then import your settings and see if can reproduce the problem.
Krakken Posted - Jul 18 2008 : 06:55:13 AM
Also works for me at home where I'm pretty sure I'm using the same settings as work.
Krakken Posted - Jul 18 2008 : 12:10:16 AM
Okay, a work colleague has tested it and it works (semi) fine on his so I'm suspecting it's something to do with my settings as you suggested, feline.

He also experienced the declaration appearing in the source file underneath the implementation but we only got that once.
Krakken Posted - Jul 17 2008 : 7:36:35 PM
This was all tested in a new project, it's happening wherever I try it. Sorry didn't get a chance to test it last night, I'll try and get around to it tonight.
feline Posted - Jul 17 2008 : 10:25:04 AM
Can you also try this in a new default project please? It is possible this is solution specific, or it is possible it is somehow connected to your VA or IDE settings.
Krakken Posted - Jul 16 2008 : 10:25:16 PM
Same thing though the declaration was put in the class declaration properly this time.

I'll test it at home tonight too.
feline Posted - Jul 16 2008 : 1:50:52 PM
Can you try selecting the entire line. Start with the caret in the first column and then use Shift + Down arrow to select the line including the EOL. Now what happens?

I am seeing some problems when just selecting part of the line, as your screen shot shows, but I am not seeing the problems you are describing.
Krakken Posted - Jul 16 2008 : 12:11:40 AM
Hi feline,

I'm using VS2005 with VA1645.

Alt-O works correctly.

I start with this:

Main.h


Main.cpp


I extract:



...then...



I end up with this:

Main.h


Main.cpp


Seems there's another bug there too, it's not placing the declaration in the class?
feline Posted - Jul 15 2008 : 1:25:21 PM
Which IDE are you using?
Does alt-o correctly move you between the header and cpp files?

using VS2005 and VA 1645 I have added the following code to a header file:

class bugExtractMethod
{
private:
	int m_nIndex;

public:
	void inlineInClassMemberFunction()
	{
		m_nIndex = 0; // Highlight and extract this line.

		while (m_nIndex < 10)
			m_nIndex++;
	}

	void inlineInHeaderMemberFunction();
};

void bugExtractMethod::inlineInHeaderMemberFunction()
{
	m_nIndex = 10; // Highlight and extract this line.

	while (m_nIndex != 0)
		m_nIndex--;
}


Extract Method works correctly for me for both commented lines, with Extract to source turned On and Off.

Move Implementation to Source File also works correctly on inlineInClassMemberFunction()

Can you try the same code please, including the Move Implementation to Source File test.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000