| Author |
Topic  |
|
|
MortenSkaaning
New Member

3 Posts |
Posted - Nov 17 2011 : 1:24:45 PM
|
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
|
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 |
 |
|
|
MortenSkaaning
New Member

3 Posts |
Posted - Nov 18 2011 : 08:06:39 AM
|
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 |
 |
|
|
feline
Moderator
    
United Kingdom
12804 Posts |
Posted - Nov 18 2011 : 1:26:06 PM
|
| 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 |
 |
|
| |
Topic  |
|