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
 Technical Support
 Function declaration using macros
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jschmidt
New Member

Canada
4 Posts

Posted - Jan 27 2012 :  09:15:03 AM  Show Profile  Reply with Quote
Hi, I wonder if VA could be better to parse function prototype and declaration when they are decorated using macros.

For example we have something like this:


// .h
DNA_METHOD(DNAPtr<IHasNamePredicate>, CreateHasNamePredicate)(const String &in_Name);
// .cpp
DNA_METHOD_IMP(DNAPtr<IHasNamePredicate>) CDataModelMgr::CreateHasNamePredicate(const String &in_Name)
{
// [...]
}
// Macros definitions
#define DNA_FUNCTION(ReturnType, MethodName) ReturnType DNA_CALL MethodName
#define DNA_METHOD(ReturnType, MethodName)	virtual DNA_FUNCTION( ReturnType, MethodName )


But VA failed to parse these correctly, as an example when I type in a method and ask for parameter info I get something like this (showing the wrong parameter (return value)



Also in the .h, I can't go to the declaration from a prototype (it fails to find it in the .cpp). I also get other issues regarding this.

feline
Whole Tomato Software

United Kingdom
17027 Posts

Posted - Jan 27 2012 :  3:05:31 PM  Show Profile  Reply with Quote
I am having some difficulty working out what is going on in your code, given the information you have posted here. The macros reference a macro you have not posted, and I am not sure quite what is happening. I have reproduced the parameter info tooltip bold problem with the following simplified code sample:

With this in the header file:

#define DNA_METHOD_IMP(Return_Type) Return_Type

class testMacroReturnFunc
{
public:
	DNA_METHOD_IMP(void) classMemberFuncMacroReturn(const int &in_AppVar, const int &in_Value);
};

and this in the cpp file:
DNA_METHOD_IMP(void) testMacroReturnFunc::classMemberFuncMacroReturn( const int &in_AppVar, const int &in_Value ) { }

static void testGeneralCode()
{
	testMacroReturnFunc classMacroReturn;
	// bug - parameter info tooltip shows the return type
	// in bold for the first parameter, and nothing in bold
	// for the second parameter
	classMacroReturn.classMemberFuncMacroReturn(2, 3);
}

I am seeing the problem, and I have put in a bug report for this:

case=64310

Can you help me extend my simple example to reproduce the problems you are seeing with alt-g?

My initial attempt is, in the header file:

// Macros definitions
#define DNA_METHOD_IMP(Return_Type) Return_Type
#define DNA_CALL
#define DNA_FUNCTION(ReturnType, MethodName) ReturnType DNA_CALL MethodName
#define DNA_METHOD(ReturnType, MethodName)	virtual DNA_FUNCTION( ReturnType, MethodName )

class testMacroReturnFunc
{
public:
	DNA_METHOD_IMP(void) classMemberFuncMacroReturn(const int &in_AppVar, const int &in_Value);
	// alt-g on the function works fine here
	DNA_METHOD(void, classMethodViaMacro)(const int &in_counter);
};

and in the matching cpp file:
DNA_METHOD_IMP(void) testMacroReturnFunc::classMemberFuncMacroReturn( const int &in_AppVar, const int &in_Value ) { }
// alt-g on the function works fine here
DNA_METHOD_IMP(void) testMacroReturnFunc::classMethodViaMacro(const int &in_counter) { }

static void testGeneralCode()
{
	testMacroReturnFunc classMacroReturn;
	// bug - parameter info tooltip shows the return type
	// in bold for the first parameter, and nothing in bold
	// for the second parameter
	classMacroReturn.classMemberFuncMacroReturn(2, 3);

	// alt-g on the function works fine here
	classMacroReturn.classMethodViaMacro(2);
}

using VS2005 and VA 1862.

zen is the art of being at one with the two'ness

Edited by - feline on Jan 27 2012 3:06:25 PM
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Apr 11 2012 :  12:42:56 AM  Show Profile  Reply with Quote
case=64310 is fixed in build 1903
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000