Author |
Topic  |
|
Krakken
Ketchup Master
   
Australia
63 Posts |
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()
{
}
|
Edited by - Krakken on Jul 15 2008 02:39:23 AM |
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
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. |
zen is the art of being at one with the two'ness |
 |
|
Krakken
Ketchup Master
   
Australia
63 Posts |
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? |
Edited by - Krakken on Jul 16 2008 12:11:58 AM |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
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. |
zen is the art of being at one with the two'ness |
 |
|
Krakken
Ketchup Master
   
Australia
63 Posts |
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. |
Edited by - Krakken on Jul 16 2008 10:28:52 PM |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
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. |
zen is the art of being at one with the two'ness |
 |
|
Krakken
Ketchup Master
   
Australia
63 Posts |
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. |
 |
|
Krakken
Ketchup Master
   
Australia
63 Posts |
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. |
Edited by - Krakken on Jul 18 2008 12:10:45 AM |
 |
|
Krakken
Ketchup Master
   
Australia
63 Posts |
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. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
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. |
zen is the art of being at one with the two'ness |
 |
|
|
Topic  |
|