For the last eight years I wait for Microsoft to add the basic C++ functionality of switching back and forth between .h and .cpp files, and it keeps astonishing me it is still not supported in Visual Studio 2010. Does anyone know why they refuse to add this essential feature?
|
Visual Assist does it, but also offers you to open any file in your solution which has a name that includes the substrings you give. Extremely useful in my opinion: I always use it, but very hardly use the 'jump to header/source' command... |
|||
|
|
It's easy to write a macro that does it. |
|||||||||
|
|
I've not used Visual Studio for a few years, but IIRC the "Go To Definition" and "Go To Declaration" functions do this (albeit badly, particularly when it comes to constructors) I imagine that one reason for them not implementing it on a filename basis is that there is nothing about C++ that enforces a convention on the arrangement of classes in files. e.g. The "obvious" way to arrange a class called "MyClass" in a C++ project is to put the class in MyClass.h and the methods in MyClass.cpp. Another, totally plausible way is to put the class definition in "elephant.h" and the methods in "mouse.cpp" You could put all of your classes in one "classes.h" file and define all of your methods in one method per file. I'm not saying that you should arrange your projects in this way, just that you could, and that's why jumping between .cpp and .h files is implausible, unless done in the same manner in which it is already implemented. |
|||
|
|
|
As discussions on Visual Assist shows, this feature is far from simple: which extensions are included (.c, .cpp, .cxx, .h, .hpp, .nothingatall, .inl, ...), which way you cycle through them when there are more than two, etc. I agree it's still a rather simple feature to implement, but it's not as simple as you think. |
|||
|