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
 Problems with extract method in C++
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

space_cowboy
New Member

8 Posts

Posted - Apr 20 2009 :  11:44:00 AM  Show Profile  Reply with Quote
This is somewhat similar to http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=8347&SearchTerms=Extract,Method, but not quite the same. I have boiled it down to the following testcode :

TestClass.h

#pragma once

namespace test {
	class SomeTestClass
	{
	public:
		void Foo();

		void Bar();
	};
};

TestClass.cpp

#include "TestClass.h"
#include <iostream>

using namespace test;

void SomeTestClass::Foo()
{
	std::cout << "Foo" << std::endl;
}

void SomeTestClass::Bar()
{
	std::cout << "Bar" << std::endl;
}

If I select the content of the method Foo() and then execute the Extract Method refactoring, i get the following in TestClass.cpp:

#include "TestClass.h"
#include <iostream>

using namespace test;

void SomeTestClass::Foo()
{
	MyMethod();
}

void SomeTestClass::Bar()
{
	std::cout << "Bar" << std::endl;

	void MyMethod()
	{
		std::cout << "Foo" << std::endl;
	}
}

If I delete the using directive in TestClass.cpp and put the namespace qualifier in front of the method names, it works fine. Somehow the using namespace messes it up.

Here is my version info:

VA_X.dll file version 10.5.1722.0 built 2009.03.31
Licensed to:
---
DevEnv.exe version 8.0.50727.762
msenv.dll version 8.0.50727.762
Font: Courier New 13(Pixels)
Comctl32.dll version 6.0.2900.5512
Windows XP 5.1 Build 2600 S
2 processors (x86)

Platform: Win32
Stable Includes:
C:\\Programme\\Microsoft Visual Studio 8\\VC\\include;
C:\\Programme\\Microsoft Visual Studio 8\\VC\\atlmfc\\include;
C:\\Programme\\Microsoft Visual Studio 8\\VC\\PlatformSDK\\include;
C:\\Programme\\Microsoft Visual Studio 8\\SDK\\v2.0\\include;
C:\\Programme\\Microsoft DirectX SDK (August 2007)\\Include;
C:\\Programme\\Intel\\IPP\\5.3.4.087\\ia32\\include;
C:\\Programme\\Microsoft SDKs\\Windows\\v6.1\\Include;

Other Includes:

Stable Source Directories:
C:\\Programme\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfc;
C:\\Programme\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfcm;
C:\\Programme\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\atl;
C:\\Programme\\Microsoft Visual Studio 8\\VC\\crt\\src;


Edited by - space_cowboy on Apr 20 2009 11:45:05 AM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Apr 20 2009 :  6:12:12 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=20072
Go to Top of Page

space_cowboy
New Member

8 Posts

Posted - Apr 21 2009 :  07:50:03 AM  Show Profile  Reply with Quote
I am putting this in the same thread because I think the problems may be related. In the samplecode I gave above any references to this in the implementation of the functions is underlined red, unless I put the namespace qualifier into the method signature.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Apr 21 2009 :  3:30:47 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=4135
Go to Top of Page

pridehaveit
New Member

3 Posts

Posted - Jul 02 2009 :  04:18:13 AM  Show Profile  Reply with Quote
Is there a plan when this issue will be fixed?
Best regards pridehaveit

EDIT:
This problem also applies to "Create Declaration".

For methods in a class that is in a namespace the refactoring "Change Signature" is not available.

Edited by - pridehaveit on Jul 02 2009 05:44:27 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Jul 08 2009 :  11:01:13 AM  Show Profile  Reply with Quote
Unfortunately I don't have an estimate on when this will be fixed, but both bugs are down as high priority bugs. The basic problem is that it is possible to confuse our parser with namespaces, as you are finding. So I am not sure how easy this will be to fix, but we are working on the whole issue of namespaces.

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

pridehaveit
New Member

3 Posts

Posted - Jul 13 2009 :  08:52:25 AM  Show Profile  Reply with Quote
Thank you for the reply.
I'm looking forward to the version this issue is fixed in.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Feb 02 2016 :  7:54:56 PM  Show Profile  Reply with Quote
case=4135 is fixed in build 2089.
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