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
 Issue: Create Implementation for all Class methods
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

azur
Senior Member

Germany
40 Posts

Posted - Aug 16 2012 :  03:27:14 AM  Show Profile  Reply with Quote
I have modified the VA Snippet G?Refactor Create ImplementationG?:
$SymbolType$ $SymbolContext$( $ParameterList$ ) $MethodQualifier$
{
	$end$$MethodBody$
}  // $SymbolName$

If I use G?Refactor Create ImplementationG? on the method name in the H-file everything works fine.
But if I use the same command on the class name the macro $SymbolName$ is not fulfilled. No matter if I choose one or more methods.

Another issue is that if the implementation file is modified and not saved all methods are listed if you want to execute use G?Refactor Create ImplementationG? on the class name in the H-file.

Finally I have a suggestion. General itG??s a good thing that G?Refactor Create ImplementationG? is disabled if I have always one implementation. I use this function often via shortcut. So now I hit the shortcut and nothing happens. Why not execute G?Goto ImplementationG? in the case that the implementation always exists?

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Aug 17 2012 :  08:40:50 AM  Show Profile  Reply with Quote
I am seeing the same effect regarding $SymbolName$, thank you for the clear description:

case=68550

Regarding the reparsing problem: I wasn't able to reproduce that problem. Basically, save is not required for re-parse. When you modify a smaller file, the reparse should be occur after a sec.
- Do you see the problem if you wait for a few sec in the cpp before switching back to the header file?
- How did you modify the (cpp) file? Directly, or via Create Implementation?
- How did you switch back to the header? Via alt+o or some other way?
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Aug 17 2012 :  08:46:03 AM  Show Profile  Reply with Quote
I have put in a feature request for your suggestion:

case=68551
Go to Top of Page

azur
Senior Member

Germany
40 Posts

Posted - Aug 17 2012 :  10:29:01 AM  Show Profile  Reply with Quote
My first hint (unsaved implementation file) seemed not reproduce the issue.
I guess it has something to do with internal caching (you mentioned G?wait for a few secG?).

This can I reproduce:
Open H-File for a class like G?class CData : public CObjectG?
Right click on the class name: G?Refactor Create ImplementationG? is available with some methods (canG??t describe the pattern wich methods are shown)
Right click on the constructor in the H-file: G?Refactor Create ImplementationG? is available.
Right click again on the constructor: G?Refactor Create ImplementationG? is not available.
Right click on the class name: G?Refactor Create ImplementationG? is not available.
Right click again on the class name: G?Refactor Create ImplementationG? is available.
How much methods there are listening varied.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17026 Posts

Posted - Aug 23 2012 :  1:08:45 PM  Show Profile  Reply with Quote
Which IDE and version of VA are you using?

In these steps, when you are right clicking and checking which refactoring commands are available, are you ever triggering these refactoring commands, or simply looking at them? In build 1912 VA now knows which methods have implementations, so Create Implementation is no longer offered if the implementation already exists. So this could explain some of what you are seeing.

Using VS2010, VA 1912 I have added the following code to a .h file, and simply following your steps, I am not seeing any problems. I am not triggering any refactoring commands though, since if I use Create Implementation in an early step, then it should never be offered later on.


#include <afx.h>

class CDataTestReparsing : CObject
{
public:
	CDataTestReparsing();
	~CDataTestReparsing();

	void testMember1();
	void testMember2();
};


Am I doing / testing the right thing here?

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

azur
Senior Member

Germany
40 Posts

Posted - Aug 24 2012 :  02:11:24 AM  Show Profile  Reply with Quote
I'm working with VA 1912 and Microsoft Visual Studio Premium 2012 Version 11.0.50727.1 RTMREL

I have copied your example to one of my H-files.
On the class name "Refactor Create Implementation" create all methods - OK.
All the next try's show only the destructor in the choice-list. If I hit <OK> then every time a new implementation (CDataTestReparsing::~CDataTestReparsing()) in the CPP-File is generated.

If I try "Refactor Create Implementation" on the destructor after that the function is not available (OK, that's what I expected).
But now "Refactor Create Implementation" on the class name is also not available. (That's OK - but why not before?)

Maybe you don't use completely the same function for a single method if you are in the "all methods from class"-mode. A hint to that can also be the different handling of the VA Snippet's. (see my topic)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17026 Posts

Posted - Aug 24 2012 :  2:37:13 PM  Show Profile  Reply with Quote
I am seeing a different result. I am running Windows 7 64bit, VS2012 RTMREL, VA 1912. So the same IDE and version of VA.

Sitting in the .h file, I trigger Create Implementation on the class name, all 4 methods are created in the matching .cpp file. Now Create Implementation is no longer offered on the class name or the destructor.

So VA is more successful at catching up with what happened on my system than on yours.

Would you be able to send me your cpp.tpl file, and the .h and .cpp file you are testing in? I can then try the same VA Snippets, and the same code files as you, and see if I can reproduce this problem. Your C++ VA Snippets, the tpl file, should be:

C:\\Users\\%USERNAME%\\AppData\\Roaming\\VisualAssist\\Autotext\\cpp.tpl

If so, 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.

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

azur
Senior Member

Germany
40 Posts

Posted - Aug 27 2012 :  02:01:01 AM  Show Profile  Reply with Quote
I send the cpp.tpl to you.

I am also running on Windows 7 64bit.

The same issue if I create a new Project (File->New->Project: "MFC Application" and <Finish> the Wizard Dialog) and then put the CDataTestReparsing into "ChildFrame.h"
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17026 Posts

Posted - Aug 30 2012 :  09:54:28 AM  Show Profile  Reply with Quote
Being discussed via email

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

support
Whole Tomato Software

5566 Posts

Posted - Oct 29 2012 :  11:08:57 AM  Show Profile  Reply with Quote
case=68550 is fixed in build 1918
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