Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Automatic #include insertion

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
znakeeye Posted - Oct 05 2007 : 06:56:27 AM
This is simply brilliant, so I hope you include this feature in build 1562

Whenever you declare an instance of a class, function or global variable defined in "SomeHeader.h", you want it to be included. Why not automate this?

How about a VAX right-click menu item: "Add necessary include-statements for the current selection"
And/or a keyboard shortcut? E.g. Alt+I
Perhaps an extra option to perform all this silently in the background?

Some things to consider:
1) Multiple header-matches -> pop up a menu with all matching files.
2) Do not include full paths, if not necessary.
3) A.h includes B.h. If A.h is included, B.h is not needed.
4) Put the #include inside file.h instead of file.cpp, if need be.
6   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jan 27 2009 : 10:28:22 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 - Oct 10 2007 : 2:41:18 PM
As far as I know we are considering doing this for C++, it is just a little difficult

I referenced C# as an example of how this might work in C++
accord Posted - Oct 09 2007 : 09:30:45 AM
I don't plan to use C#.

If someone do not use conditional include statements he/she can use this feature.

But you are considering doing something like this. (case=226)
Are you tring to resolve this problem also?
feline Posted - Oct 08 2007 : 3:15:44 PM
I like the idea, but I can also see a pile of edge cases, to do with conditional include statements, that are likely to cause problems. Specifically this relies on VA working out that the #include is not present, which is sometimes rather hard to determine.

We are working on a form of this feature in C# in the 1609 beta. I don't know if you ever use C# or not, but VA will suggest the missing namespace line while typing, and you can accept the suggestion, like any "normal" suggestion listbox to have the using statement added.

Of course this does not help with the copy / paste situation.
accord Posted - Oct 07 2007 : 06:04:16 AM
What about to underline (~~~) symbols which need include file with green. When I right click on an underlined symbol, a refactoring menu item should be occur, something like "Add necessary include file".

This solution has 2 advantage at least:
1. I will know if a symbol needs additional including without the need of compilation.
2. If will work automatically on copy-pasted code. Copying and pasting code to an another file is very common when I refactoring existing code base.

Certainly, this version can work for selections also.
(The red underline (~~~) is already VERY useful in refactoring! )

What do you think?
feline Posted - Oct 06 2007 : 12:34:19 PM
We are considering doing something like this:

case=226

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