Whole Tomato Software Support Forum
Whole Tomato Software Support Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Visual Assist X
 VA Snippets and IDE Macros
 Macro RefactorAddInclude support?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MortenSkaaning
New Member

3 Posts

Posted - Nov 17 2011 :  1:24:45 PM  Show Profile  Reply with Quote
Hi all,

I love the AddInclude feature, so much in fact that I'd like to use it for automated refactoring. I would need to call VAssistX.RefactorAddInclude from a visual studio VB.net macro, but I cannot figure out how to call the function properly. My take was

DTE.ExecuteCommand("VAssistX.RefactorAddInclude","GetCollisionManager")

to add the relevant include file for the global function "GetCollisionManager()". That doesn't work however. Can you tell me what I'm doing wrong or if it's possible to refactor in this way at all?

I'm a noob to VB.net and the internals of the visual studio environment, so help is very much appreciated :)

Thanks,
Morten

feline
Moderator

United Kingdom
12804 Posts

Posted - Nov 17 2011 :  5:25:14 PM  Show Profile  Reply with Quote
This FAQ might give you some pointers:

http://www.wholetomato.com/forum/topic.asp?TOPIC_ID=5969

the short answer is that you cannot do what you are trying to do. You should be able to trigger Add Include via an IDE macro, but you won't be able to pass it any parameters. You might be able to write a macro to paste in a call to the global function "GetCollisionManager()", reparse the file, move the caret into the function call, and then trigger Add Include.

I have not tried this, but in theory it sounds like it should work.

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

MortenSkaaning
New Member

3 Posts

Posted - Nov 18 2011 :  08:06:39 AM  Show Profile  Reply with Quote
thanks, maybe that's enough for me.

Do you know of any other methods or tools to automatically add the correct headers to a file? (i'm already aware of "Include what you use").

Thanks,
Morten
Go to Top of Page

feline
Moderator

United Kingdom
12804 Posts

Posted - Nov 18 2011 :  1:26:06 PM  Show Profile  Reply with Quote
Unfortunately no. VA's Add Include is designed to help you automatically add the correct header file while editing, but this is not designed to run through your entire solution adding header files to all code files at a later date.

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:
Whole Tomato Software Support Forum © 2013 Whole Tomato Software, Inc Go To Top Of Page
Snitz Forums 2000