Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Alt-O on .h for shared .cpp (C++)

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
joracine Posted - Jul 08 2008 : 09:06:05 AM
Hello VAX people!

Because of the structure of our classes, we have many many cases where two classes, which are declared in two header files, are defined in a single .cpp. It seems VAX's Alt-O only supports the opposite. So if, when in the .cpp, I press alt-o, I am always switched to the same .h file.

Note: The second class, which is in a different .h, is a member (in the namespace of) of the first class.

- I am not presented a menu
- I have no way of switching quickly to the other .h

This topic is probably related to topic
http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=7949 / case 18061.

Being able to switch between the two .h by pressing alt-o again would be absolutely perfect.

Thanks!


Example:

Class1.h

class Class1
{
Class1();

private:
class Class2;
Class2* m_Class2;
};



Class2.h

class Class1::Class2
{
Class2();
};


Class1_2.cpp

Class1::Class1()
{
}

Class1::Class2::Class2()
{
}
4   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 10 2008 : 12:15:09 PM
Alt-o only uses file names, which is reasonable since the command is called "Open Corresponding File"

Jumping to a declaration or implementation via alt-g should still work correctly even when these are placed in files with mismatched names.

More than one file with the same name, if the files come in pairs then VA should be able to work out the pairs and jump directly to the matching file. However if there are only three files then VA is not going to be able to pair them up, so it will list all of them. Can you post the full path names for a set of files that you are having this problem with?
joracine Posted - Jul 08 2008 : 4:04:13 PM
Because they contain at least one implementation of the declared class. What I now understand is that VA only uses filenames to browse between definitions and declarations. But I would suggest it uses declaration locations and definition locations. In other words, as soon as a method is implemented in a CPP, it is part of the "cpp file list" for that class.

This would fix another issue where when you have more than one file with the same name in unrelated projects, VA asks you which one you want: I want the one which is in the same namespace and defines the class I am declaring.

Right now VA fully resolves namespace/class members, why can't these be "tagged" with their declaration/definition locations(i.e. files)?

Obviously, I don't know how you make your magic, so it might be impossible, but from a user's perspective, it looks very do-able.
feline Posted - Jul 08 2008 : 2:41:04 PM
Given these file names there is no way for VA to know that these files are related. Alt-g should move you between the function implementation and declaration which is something.

The refactoring commands have the same problem, they have no "destination", no where to place the generated code.

You also mention moving between the two header files via alt-o. How would VA know that these two files are related?
joracine Posted - Jul 08 2008 : 09:20:43 AM
I'd like to add the Refactor/Implement does not work in this case either.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000