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
 Feature Requests
 BUG/Feature: Resolve many CPP to one H
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Mordachai
Tomato Guru

USA
224 Posts

Posted - May 08 2012 :  1:04:13 PM  Show Profile  Reply with Quote
Our project has a very large class - CMacroInterpreter, which has hundreds of methods. These methods are implemented in many .cpp files, not just one.

It has been frustrating for years in VAX that when I want to change a method declaration or do anything with a method (including create a new new method or refactor header->cpp), that VAX fails to grok this idea that the many .cpp files that all define members of CMacroInterpreter are in fact equally (or cumulatively) the .cpp that corresponds to CMacroInterpreter.h.

So, some examples:

in 'Macro Dialog.cpp', right-click on:

void CMacroInterpreter::RunSomeDialog(int ID)

I cannot access anything in the refactoring menu that relates to knowing about the declaration (even though VAX does know about this method and its .h file and so on at some level because it is parsing everything properly).

So no (0):

Change Signature
Move Implementation to Source File

Doesn't work well (1):

Extract Method
Create from Usage

Broken (2):

Create Implementation

(0) disabled
(1) always puts the code-body in CMacroInterpreter.cpp - despite extracting the method in some other .cpp file, such as Macro Dialog.cpp.
(2) enabled when it should not be, because the implementation already exists


--

This has been very frustrating for many years, and would a truly lovely bug-fix/feature addition if this could be addressed.

Simply defaulting to extracting a method or creating from usage to the same .cpp or .inl file I'm already in would be more than adequate. Enabling/disabling the various refactoring methods correctly would be huge.

Thanks for looking into this, and for a great product overall!

Mordachai
Tomato Guru

USA
224 Posts

Posted - May 08 2012 :  1:06:56 PM  Show Profile  Reply with Quote
As a follow-up idea:

Allow "Move Implementation to >" fly-out, that lists the corresponding .cpp files, so that it's trivial to move a method-body from one .cpp to another (within the set of files that comprise that class's definition).
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 08 2012 :  9:07:18 PM  Show Profile  Reply with Quote
Good ideas. Most use one cpp per header file, so these problems don't occur.

I will address your ideas separately since it may take a little more time.

First, about the refactorings that were executed from the source files: they should choose the same source file when deciding where to put the result. I have put in an enhancement request for this:

case=66607
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 09 2012 :  3:33:55 PM  Show Profile  Reply with Quote
Regarding Create/Move Implementation to "fly-out": I have put in an improvement request for this, to see what the developers make of it:

case=66620

I'm not sure whether this is viable, or would be too slow to check all cpp files. Goto can jump, so there is a chance, but we are talking about hundreds of methods here, while goto needs to work with only one at a time.

I wasn't able to reproduce your other problems consistently so will investigate further.

Edited by - accord on May 09 2012 3:42:30 PM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - May 10 2012 :  7:09:21 PM  Show Profile  Reply with Quote
About void CMacroInterpreter::RunSomeDialog(int ID) in the cpp file:

- Move Implementation to Source File is not available because by source file we mean cpp, and the function is already in a cpp file.
- Change Signature: yesterday I saw problem for a short amount of time, but I wasn't able to reproduce it anymore, maybe it was only a timing problem since I added new files and methods to a few files. Does this method have overloads?

Extract Method and Create from Usage: you mean it may use the wrong file, right? It was addressed above, and covered the enhancement request that I had put in.
Create Implementation (1) is also about using the wrong file, right? (2) unfortunately VA is not able to handle overloads, so cannot verify for sure if a method has already been implemented. Is this something that bothers you or just mentioned?
(0) disabled: this is odd. It should not be disabled. Do you see a pattern, which type of methods cause this? Is it possible that this is a timing issue? VA needs up to a few seconds (depending on the file size) to reparse a file after it has been modified.
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