T O P I C R E V I E W |
tom_seddon |
Posted - Sep 22 2006 : 07:01:50 AM .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. |
13 L A T E S T R E P L I E S (Newest First) |
sean |
Posted - Dec 19 2006 : 8:54:22 PM case=2677 is addressed in build 1543 |
Ivo |
Posted - Oct 11 2006 : 12:10:06 PM 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. |
feline |
Posted - Sep 30 2006 : 11:55:23 AM 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. |
tom_seddon |
Posted - Sep 29 2006 : 2:37:18 PM 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). |
tom_seddon |
Posted - Sep 28 2006 : 12:24:09 PM 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 :) |
sean |
Posted - Sep 25 2006 : 12:19:03 AM 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. |
Ivo |
Posted - Sep 24 2006 : 11:33:26 PM 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
|
sean |
Posted - Sep 24 2006 : 11:07:08 PM 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. |
Ivo |
Posted - Sep 24 2006 : 9:16:20 PM 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.
|
sean |
Posted - Sep 24 2006 : 8:13:43 PM 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? |
Ivo |
Posted - Sep 24 2006 : 12:29:12 PM 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
|
sean |
Posted - Sep 24 2006 : 12:35:34 AM This has come up often enough. We can make some changes to make this work better in those cases. case=2677
|
feline |
Posted - Sep 23 2006 : 1:43:22 PM 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? |