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
 Same class names in different projects
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Alek86
Junior Member

Canada
20 Posts

Posted - Jul 07 2017 :  10:58:09 AM  Show Profile  Reply with Quote
Hi,

For example:
In a solution there are 2 exe projects.
Each project has a class named UserData.
They both have member functions called toString().

If I use GoTo on a call of toString() in one project I sometimes go to the implementation of the other project`s UserData::toString().

It behaves similarly to ODR violation in C++, but both projects are independent EXEs.

Could you update the GoTo algorithm so it goes to the implementation in the same project?

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Jul 07 2017 :  11:35:20 AM  Show Profile  Reply with Quote
If you turn On the setting:

VA Options -> Projects and Files -> Restrict Goto (Alt+G) to active project

does this have any effect?

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

Alek86
Junior Member

Canada
20 Posts

Posted - Jul 07 2017 :  12:14:51 PM  Show Profile  Reply with Quote
I have this setting ON
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Jul 07 2017 :  2:34:45 PM  Show Profile  Reply with Quote
Oh, that I did not expect.

Are you using namespaces for one or both classes? Or are both classes in the global namespace?

Are you being taken directly to the "ToString()" member in the wrong class, or are you getting an Alt-g menu, which happens when there is more than one possible destination, and VA is not sure which one to jump to?

Do you know if any of your code files are shared across more than one project? You can easily add the same code file to several projects if you choose to, so I am just wondering if this might be a factor here.

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

Alek86
Junior Member

Canada
20 Posts

Posted - Jul 07 2017 :  2:55:02 PM  Show Profile  Reply with Quote
1) Both classes are in the global namespace
2) I`m pressing Alt+G on the function call, so the dialog is shown with .cpp and .h (declaration and definition), but it shows the different project function.
3) Yes, I have shared files, but the classes are not there.

What might affect this behavior: the .h files for these classes are named same if you ignore case: connection.h and Connection.h.
The files are in different folders though.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Jul 07 2017 :  3:27:41 PM  Show Profile  Reply with Quote
How often does this go wrong for you? All the time? 1 in 10? 1 in 500?

I have set up a simple test case here, based on your description, and so far, I am always taken to the version of the class in the current project. I am getting the Alt-g menu every time I trigger alt-g on the "toString()" function call, which lists the declaration and implementation, and the correct case of the file names for the current project.

I have tried alt-g in both projects several times now, and I am always being taken to the correct file. But if this is more random for you, then I may not have tested enough times.

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

Alek86
Junior Member

Canada
20 Posts

Posted - Jul 07 2017 :  4:27:58 PM  Show Profile  Reply with Quote
Seems like I oversimplified the case. In real projects it involved templates :)



A close approximation. To reproduce similar behavior:
1) Create a solution with 2 empty projects.
2) Create a main.cpp in each project.
3) In each main.cpp put

class Class
{
public:
void func() const {}
};

template <typename T>
struct CT1
{
T t;
};
struct CT2 : CT1<Class>
{
CT2() { t.func(); }
};

int main()
{
Class c;
c.func();
}

4) Try Alt+G on c.func(). In my simple solution it proposes go to func in both projects. In my real solution it only proposes to go to the first project with the same class/function.
Go to Top of Page

Alek86
Junior Member

Canada
20 Posts

Posted - Jul 10 2017 :  11:22:31 AM  Show Profile  Reply with Quote
Do you want me to create a separate thread with these reproduction steps? This thread's name looks wrong now.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Jul 10 2017 :  4:21:09 PM  Show Profile  Reply with Quote
You have tried these simple steps on your system, and you are seeing the problem?

Which IDE and version of VA are you using?

I have tried this with VS2015 and VA 2223, and I am not seeing any problems. I am always taken directly to the function declaration in the current file, and the current project. Since the steps are simple, and the code is clear, I don't think I have done this any differently than you.

Can you send me a copy of your test solution, along with your VA and IDE settings please, I can then try the same solution and the same settings here, and see if I can reproduce this alt-g problem.

Settings can be exported via:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

Please submit the files via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, so we can match it up.

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

Alek86
Junior Member

Canada
20 Posts

Posted - Jul 11 2017 :  4:45:19 PM  Show Profile  Reply with Quote
Done. I didn't receive any request ID, so please just check one of latest requests (submitted 30 seconds ago)
Go to Top of Page

Alek86
Junior Member

Canada
20 Posts

Posted - Jul 11 2017 :  4:48:36 PM  Show Profile  Reply with Quote
From the email - Case 109638
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Jul 12 2017 :  11:48:05 AM  Show Profile  Reply with Quote
I have the solution and settings, many thanks for this. So far though I cannot reproduce this problem at all. I have replied via email.

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