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
 .inl files
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tom_seddon
Tomato Guru

162 Posts

Posted - Sep 22 2006 :  07:01:50 AM  Show Profile  Reply with Quote
.inl files trip up VAX's Alt+O behaviour. It would be nice if Alt+O cycled through .h, .cpp and .inl.

(On the example I currently have, Alt+O toggles between .inl and .h, and ignores the .cpp. But, if you load the .cpp, and press Alt+O, you get the .h. So clearly, VAX does know where everything is...)

Thanks.

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Sep 23 2006 :  1:43:22 PM  Show Profile  Reply with Quote
the standard answer is we don't want to expand alt-o, since people all want there own custom file extension added to the list, and everyone seems to want it to work slightly differently.

you may find the macro code in the section "Opposite (switch between C/CPP and H files)" useful, since this can be used to produce a customized alt-o replacement.

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

having said all of that, i am very surprised that alt-o is swapping between the .inl and .h files. which IDE and version of VA are you using?

are the .inl, .h and .cpp files all part of the solution?

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 24 2006 :  12:35:34 AM  Show Profile  Reply with Quote
This has come up often enough. We can make some changes to make this work better in those cases. case=2677
Go to Top of Page

Ivo
Senior Member

34 Posts

Posted - Sep 24 2006 :  12:29:12 PM  Show Profile  Reply with Quote
I have added some new functionality to the VSHelper addin listed above. Soon I'm going to update the codeproject article.

In my project I have a couple of huge classes, with 1 .h file, 1 .inl file, and a bunch of .cpp files. Alt+O only works with one of the .cpp files, because the others are named differently than the .h file.

The solution: At the top of each of the .cpp files and the .inl file I type // ## <filename>. The Alt+O command opens the current file with fopen, reads the first line, and if it starts with // ## it switches to that file. In your case you can have the .cpp link to the .inl, the .inl link to the .h, and the .h link to the .cpp.

The caveat: The file needs to be saved first. I don't know how else to get the first line without messing up the current selection. Obviously VAX can do that, so it will be easier for the wholetomato folks to implement it more elegantly.

Another caveat: VSHelper doesn't support VC6.

Ivo
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 24 2006 :  8:13:43 PM  Show Profile  Reply with Quote
quote:
Originally posted by Ivo

In my project I have a couple of huge classes, with 1 .h file, 1 .inl file, and a bunch of .cpp files. Alt+O only works with one of the .cpp files, because the others are named differently than the .h file.



Just curious - are the names of the files related? How do you differentiate between the multiple cpp file names?
Go to Top of Page

Ivo
Senior Member

34 Posts

Posted - Sep 24 2006 :  9:16:20 PM  Show Profile  Reply with Quote
quote:
Just curious - are the names of the files related? How do you differentiate between the multiple cpp file names?



I don't. From the .h file I can only go to the .cpp file with the same name. But from any of the .cpp files I can go to the same .h file (because in each of them I added "// ## myclass.h" at the top)

It is also possible to create a ring of all related files. For example:
in myclass.cpp use // ## myclass2.cpp
in myclass2.cpp use // ## myclass3.cpp
in myclass3.cpp use // ## myclass.h
in myclass.h use // myclass.cpp (this is redundant, because it is covered by the default functionality)
Then Alt+O would cycle through all of them.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 24 2006 :  11:07:08 PM  Show Profile  Reply with Quote
That's what I was getting at - you differentiate by a number appended to a common base name. I've seen other differentiations like "Priv", "_Priv", "Impl" and "_Impl" being appended to a common base name. Long term, it would be nice to handle those situations automatically.
Go to Top of Page

Ivo
Senior Member

34 Posts

Posted - Sep 24 2006 :  11:33:26 PM  Show Profile  Reply with Quote
No, that's not how it is. Each file that is not covered by the default rule .h <-> .cpp has as first line "// ## <the next file to open>". The order can be anything. For example:
AAA.h -> AAA.cpp -> BBB.cpp -> CCC.inl -> DDd.inc -> AAA.h
The rules don't have to be cyclic. For example:
AAA.h -> AAA.cpp
AAA.cpp -> AAA.h
BBB.cpp -> AAA.h
CCC.inl -> AAA.h
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 25 2006 :  12:19:03 AM  Show Profile  Reply with Quote
I understand the comment mechanism. I was just wondering if you as a developer have a system for relating multiple source files together. The first example given was just numbers, the second example obviously is totally arbitrary. Just wondering, in practice, if you had a system. I see the answer is no.
Go to Top of Page

tom_seddon
Tomato Guru

162 Posts

Posted - Sep 28 2006 :  12:24:09 PM  Show Profile  Reply with Quote
If you aren't going to support .inl files, could you stop VAX finding them? This would make my life at least a bit easier. I don't edit the .inl files so much.

If Alt+O means .h/.(c|cpp) switch, then .h/.(c|cpp) switch is what it should do :)
Go to Top of Page

tom_seddon
Tomato Guru

162 Posts

Posted - Sep 29 2006 :  2:37:18 PM  Show Profile  Reply with Quote
By the way I think the reason VAX is swapping between .inl and .h is that they are both in the same folder. The .cpp is somewhere else (but is in the solution of course).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Sep 30 2006 :  11:55:23 AM  Show Profile  Reply with Quote
could you post the full (including paths) names of a set of three files that show this problem? are they all in the same project in the solution?

I have just added a .inl file to one of my test projects, so i now have the three files:

test_parsing.cpp
test_parsing.h
test_parsing.inl

all sitting in the same directory, and all part of the same solution in VS2003, using VA 1535.

i made sure all three files were closed, then i closed and re-loaded the IDE. using solution explorer i open the .inl file and then pressed alt-o. VA opened the .cpp file and jumped to it. alt-o again, and the .h file opened and VA jumped to it. from then on alt-o simply jumped between the .cpp and .h file.

this "limited" support for .inl files seems quite reasonable and sensible, and is different to what you are seeing.

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

Ivo
Senior Member

34 Posts

Posted - Oct 11 2006 :  12:10:06 PM  Show Profile  Reply with Quote
Hi.

I just updated my VSHelper add-in on Codeproject - http://www.codeproject.com/macro/VSHelper.asp. The Opposite command is now customizable, with default switch order .h -> .inl -> .cpp -> .c -> .h. Also the // ## prefix is customizable. The latest version contains binaries for VS2003 and VS2005.

BTW, it no longer requires the file to be saved to extract the // ## prefix. It uses EditPoint::GetText to parse the opened document directly.

Edited by - Ivo on Oct 11 2006 12:13:24 PM
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Dec 19 2006 :  8:54:22 PM  Show Profile  Reply with Quote
case=2677 is addressed in build 1543
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