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
 H/CPP File Matching
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MrDoomMaster
Tomato Guru

251 Posts

Posted - May 21 2007 :  3:44:11 PM  Show Profile  Reply with Quote
Hi,

I have two files, "Writer.h" and "WriterWIN.cpp". The reasons why the filenames are different is due to code design and platform dependencies. However, the two files listed above are matching H/CPP files. Several functions in VAX that depend on knowing the H/CPP pair fail to function. Alt+O doesn't work and "Create Implementation" doesn't work, for example. It is completely reasonable why it doesn't work- How is VAX supposed to know that they're a match?

I'm just wondering if it would be possible to find a work-around for this, or perhaps there's a way to do it by design and I just haven't been able to figure it out yet. If there is no way to make this work, I'd like it to be a feature request. If visual assist is unable to find a matching H/CPP file, it should ask you to "find it" by opening a dialog much like the OFW dialog and allowing you to pick the matching file. It would remember this selection for all future pair matching requests between the two files.

Thanks.

Edited by - MrDoomMaster on May 21 2007 8:40:57 PM

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - May 22 2007 :  06:47:48 AM  Show Profile  Reply with Quote
Do you have a lot of these mis-matched pairs?

I understand the problem, but as soon as we try to remember "A.h matches B.cpp" we would need some way of managing the pairs, etc. Plus you then get into the question of project specific or global pairs *shudder*

I also have the horrible vision of:

Writer.h
WriterWIN.cpp
WriterMAC.cpp
WriterUNIX.cpp

becoming a "pair"

I am quite keen to avoid this idea.

Depending on the exact cause of this problem, is the following idea possible:

Rename "Writer.h" to "WriterWIN.h"
Create a new "dummy" header file called "Writer.h" and give it the content:


#include "WriterWIN.h"


?

If you have to stick with mismatched files you may want to look at this article:

http://www.codeproject.com/macro/kingstools.asp

which contains a macro to produce the same effects as VA's alt-o. You should be able to extract the macro and tell it about your mismatched pairs. Of course this only helps for alt-o, and not for refactoring.

*considers*

In theory if you change the file names to be:

Writer.h
Writer.WINcpp

and tell both the IDE and VA about the new file extension "WINcpp" then this should "just work"

http://docs.wholetomato.com?W328

However this is just theory, and I have not tried this.

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

MrDoomMaster
Tomato Guru

251 Posts

Posted - May 22 2007 :  09:56:08 AM  Show Profile  Reply with Quote
You make some very valid points. I suppose it would be impractical to expect visual assist to be able to figure these things out. However, if you Alt+O from Writer.h, it should give you a pop-up context menu with a listing of:

WriterWIN.cpp
WriterUNIX.cpp
WriterMAC.cpp

It's one extra click but at least it gets the job done. Just a thought. Going to the header from either of those files would be a one step process because each CPP knows it goes to only 1 header.

Managing pairs, however, I don't think would be that bad. It's just persisted state like any other. I wouldn't depend on the windows registry for this information, though.

No, I don't have a lot of these mismatched pairs, but I'm very anal about small things like this. In fact I'm probably expecting too much. I do apologize, as this isn't that important of an issue.

One naming convention I would like to use is:

Writer.h
Writer.win.cpp
Writer.mac.cpp
Writer.unix.cpp

I use this format with a lot of game asset files, for example sprite resources:

SomeGuy.sprite.xml

Just as an example.

In the naming convention above for the CPP files, they all start with the same name. This seems like a format that could be standardized by VAX and possibly make the job easier.

Well, like I said this probably isn't a big deal. The main point of posting about it was just to see if there was an official way of doing something about this or perhaps just a work around. You've most definitely answered that question. Thank you very much, Feline.

::EDIT::

I just thought of a kinda cool idea. Doxygen, for example, uses comments with a specific format to determine things. Since VAX parses though the code anyway, why not have it do the same? Say somewhere in the Writer.win.cpp file, you have the following comment:

///
/// @matching_header Writer.h


This would tell visual assist to override it's usual Writer.h -> Writer.cpp search with the manually assigned header. Or you could put this special comment code only in header files (this would probably be better):

///
/// @matching_source Writer.win.cpp
/// @matching_source Writer.mac.cpp
/// @matching_source Writer.unix.cpp


This would prevent visual assist from having to persist more data than it does already. Everytime the project is opened you could just reparse these small blocks, or keep this data in the data files you already create for the symbol data.

Just a thought.

Edited by - MrDoomMaster on May 22 2007 10:05:36 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - May 22 2007 :  1:42:36 PM  Show Profile  Reply with Quote
I don't like the idea of getting into parsing comments, they are free text by definition after all

The problem with Doxygen format tags themselves is that they come in various forms, and I am very wary of opening the door to "just support this Doxygen comment tag in addition..."

Given these file names... You could try adding .win.cpp, etc, to the list of C++ file extensions. Since there is a dot in the middle I have no idea if this will work or not, but for a few minutes playing with registry flags it is worth a try, especially if it works

zen is the art of being at one with the two'ness
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