Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 "Add Include" propose base instead of derived file

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
leto58 Posted - Aug 07 2019 : 09:54:06 AM
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
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Aug 07 2019 : 11:28:58 AM
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.

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