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
 Technical Support
 "Add Include" propose base instead of derived file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

leto58
Junior Member

17 Posts

Posted - Aug 07 2019 :  09:54:06 AM  Show Profile  Reply with Quote
Hi,
After more than 10 years using VA, here is the most annoying thing I still have (and never took time to report):

A real example I currently have:
// DatabaseObject.h
class DatabaseObject
{
	bool Drop();
}

// DatabaseColumn.h
class DatabaseColumn : public DatabaseObject
{
}

// test.h
class DatabaseColumn;// forward declaration
void f(DatabaseColumn* pDatabaseColumn);

// test.cpp
void f(DatabaseColumn* pDatabaseColumn)
{
	pDatabaseColumn->Drop();
}


What I get: If I hover "Drop()" and call VA context menu, I get proposal "Add include DatabaseObject.h", which is the file of the base object declaration. If I add it, compiler would complain with "error C2027: use of undefined type 'DatabaseColumn'"




What I expect: If I hover "Drop()" and call VA context menu, I get proposal "Add include DatabaseColumn.h", which is the file of the derived (and expected) object declaration.

By comparison, Resharper proposes the proper file




Regards,
Leto

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Aug 07 2019 :  11:28:58 AM  Show Profile  Reply with Quote
This is a good point, and is something we are aware of. I have added your request and comparison with ReSharper to the case:

case=81344

Often the variable / pointer is an instance of the base class, so in those cases this would be the correct behaviour, but here you are using the derived class, so yes, we should be noticing this.

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