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
 Alt-O on .h for shared .cpp (C++)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

joracine
Senior Member

36 Posts

Posted - Jul 08 2008 :  09:06:05 AM  Show Profile  Reply with Quote
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()
{
}

joracine
Senior Member

36 Posts

Posted - Jul 08 2008 :  09:20:43 AM  Show Profile  Reply with Quote
I'd like to add the Refactor/Implement does not work in this case either.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Jul 08 2008 :  2:41:04 PM  Show Profile  Reply with Quote
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?

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

joracine
Senior Member

36 Posts

Posted - Jul 08 2008 :  4:04:13 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18948 Posts

Posted - Jul 10 2008 :  12:15:09 PM  Show Profile  Reply with Quote
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?

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