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
 refactor -> create declaration
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

eco
Tomato Guru

102 Posts

Posted - Oct 05 2009 :  03:39:15 AM  Show Profile  Reply with Quote
build 1738, in c++

1. If the class is declared directly in the .cpp file and having a corresponding .h file, the declaration is inserted at the end of the .h file (outside the namespace), not in the correct place in the .cpp file.

2. The class name is also inserted, that's not the thing I need.
ex.
class xxx
{
void xxx::refactored_method( );
     ~~~~~
};

3. I cannot change the VA snippet for the declaration.

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Oct 05 2009 :  4:38:04 PM  Show Profile  Reply with Quote
Can you please provide a more specific description? I wasn't able to reproduce this with the following code snippet:

code in the cpp file:

namespace nTest {
	class cTest
	{
	};
}

void nTest::cTest::TestMethod() {}

If I use Create Declaration on the last line, I get this:

namespace nTest {
	class cTest
	{

		void TestMethod();
	};
}

void nTest::cTest::TestMethod() {}

I also get the correct result, when I place the definition into the namespace, but outside the class.
Can you please try this simplified example in a new win32 test project just to see if this work on your computer?

What IDE do you use?

What modification would you do if we had a snippet for Create Declaration?

Edited by - accord on Oct 05 2009 4:41:06 PM
Go to Top of Page

eco
Tomato Guru

102 Posts

Posted - Oct 06 2009 :  04:19:25 AM  Show Profile  Reply with Quote
VA_X.dll file version 10.5.1738.0 built 2009.10.01
Licensed to:
VA X: xxxxxxxxxxxxxxxxxx (17-user license) Support ends 2010.04.09
DevEnv.exe version 9.0.21022.8
msenv.dll version 9.0.21022.8
Font: Courier New 13(Pixels)
Comctl32.dll version 6.10.6001.18000
Windows Vista 6.0 Build 6001 Service Pack 1
2 processors (x86-64; WOW64)

Platform: Custom
Stable Includes:
C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include;
C:\\Program Files\\Microsoft SDKs\\Windows\\v6.1\\include;

Other Includes:

Stable Source Directories:

------------------------------------------------------

ok, create a va.h with that content:

#define THEAPI

namespace blah
{
class THEAPI xxxx;
}


now, create a va.cpp with that content

#include "va.h"


namespace blah
{
class THEAPI xxxx
{
public:
};


void xxxx::test( )
{

}
}

create a console project with the 2 files.

now go on the line (in va.cpp)
void xxxx::test( )

right click on 'test' and select refactor->create declaration.
you will get the problem

by the way (I think there is a relationship), when you click on the same line on xxxx and select 'go to declaration', the cursor is going inside the va.h file, not on the class


Go to Top of Page

eco
Tomato Guru

102 Posts

Posted - Oct 06 2009 :  08:18:15 AM  Show Profile  Reply with Quote
sorry, i forget a response:
with a VA snippet I should comment my .h file
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Oct 07 2009 :  3:03:39 PM  Show Profile  Reply with Quote
I am seeing the same thing here. Thank you for the clear description.

case=33389

The problem is caused by the macro before the typename in the class forward declaration.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Oct 07 2009 :  3:17:04 PM  Show Profile  Reply with Quote
quote:

with a VA snippet I should comment my .h file


You mean you would write a description template, something like "Document Method" refactoring does?

Edited by - accord on Oct 07 2009 3:17:57 PM
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Aug 09 2012 :  01:58:06 AM  Show Profile  Reply with Quote
case=33389 is fixed in build 1912

Whole Tomato Software, Inc.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000