Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Adding #include for selected class/type

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
drzoom Posted - Nov 07 2006 : 02:27:25 AM

Preface: (C++) I'm still working trough old code and solving a lot of #include problems...

Topic: A feature would be nice, to add the correct #include for a given class or type.

Your objections:
  • It's not easy to find the right #include file, because many libraries are using "proxy" includes forwarding to the correct one.
  • How should we decide between a #include <foo.h> and a #include "foo.h" statement.
  • Unfortunately we are an add-in, and have to sneak around behind the IDE's back, so things that are easy when you control the IDE, ... ;-)

Some solutions:
  • The file, where a class is declared is the primary choice.
  • If this file is inside the project, a relative #include "../foo.h" is the best choice
  • If the file is external, but in the regular search path, a #include <foo.h> or #include <bar/foo.h> ist the best choice.
  • If the file is neither in the project, nor in the searchpath, but another file is including the target and the filename is matching the typename, this is the right choice (e.g for Qt/boost)
  • In other cases, no #include is added - or a list of possible alternatives is shown.

2   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jan 27 2009 : 10:38:10 PM
case=226 is implemented in build 1715
Hover over an unrecognized symbol and choose "Add include xxxx" from the refactoring context menu.

feline Posted - Nov 07 2006 : 08:04:26 AM
This is already in the list You do make some interesting suggestions for how to do this, which I have added to the case.

case=226

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