Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Support for Source Annotation Language
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jay.carlton
Ketchup Master

USA
65 Posts

Posted - Jan 31 2014 :  3:21:46 PM  Show Profile  Reply with Quote
Hi,

I use some Microsoft Source Annotation Language macros in C++ function signatures to allow static analysis to enforce the function contracts (especially for function and reference arguments). I ran into some trouble using the Change Signature refactoring for functions that use these macros, and I was wondering if there was a workaround or if this non-standard feature is in fact supported by VA.

http://msdn.microsoft.com/en-us/library/hh916382.aspx

So if I have a function declared like


int foo(_In_ double* pd, _Out_ bool& rb);


I have had issues using Change Signature. The expected behavior woudl be to have the macros _In_, _Out_, etc, be treated like part of the parameter. Each one would travel with the others.

Additionally, since Microsoft requires the annotations on all declarations to match, it would be handy to be able to introduce these annotations with Change Signature, so I wouldn't have to edit two or more files by hand.

Thanks,
Jay

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 31 2014 :  3:48:27 PM  Show Profile  Reply with Quote
What version of Visual Assist are you using?
What change are you trying to achieve?
I triggered change signature to swap the two parameters:



after pressing OK, and I got this:



Both the signature and the call site is updated correctly.
Am I doing the right test?

Edited by - accord on Jan 31 2014 3:52:09 PM
Go to Top of Page

jay.carlton
Ketchup Master

USA
65 Posts

Posted - Feb 03 2014 :  1:04:18 PM  Show Profile  Reply with Quote
Actually, I might have just thought it wasn't working because the OK button was disabled. Now that I try it again it seems to work. Sorry about that.

I thought I replied on Friday, but I must've lost the text.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18942 Posts

Posted - Feb 03 2014 :  7:52:31 PM  Show Profile  Reply with Quote
The Change Signature dialog checks that your new signature is valid code, and the OK button is only enabled if these checks pass, so if you were part way through an edit this might be why the OK button was disabled.

Thank you for the update, I am glad this is now working correctly for you

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:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000