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
 Macro expanding & reserved string customizing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kennyl
Ketchup Master

50 Posts

Posted - Oct 30 2009 :  02:01:04 AM  Show Profile  Reply with Quote
Hi dear,

I have the following two ideas:

1. Display expanded macro result when mouse move hover a reference of macro.
Maybe can have a button on the tooltip and expanded(enlarge) the tooltip to show the result when clicked.

Example:
Suppose we have this macro defined.
#define DECLARE_MY_FUNC(funcname, TYPE) TYPE funcname()

And then when this following reference is hovered by mouse:

DECLARE_MY_FUNC(Foobar, BOOL);

Display the expanded result in the tooltip, that is:

BOOL Foobar();

By the way, it seems that VA can't display the prototype when Foobar is under the cursor, and unfortunately this same issue happen to any other symbol that declared with macro.

2. How can I add my own "reserved strings" so that I can use them in the Snippets Editor?
The reason for this is I need to share that kind of "self-defined reserved strings" in different snippets.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Oct 30 2009 :  7:44:17 PM  Show Profile  Reply with Quote
Interesting request, but I think that knowing the macro definition (which is showed in the tooltip) helps understanding what will a macro do with specific parameters. I mean, would it really help interpreting the code easier?

Regarding prototype displaying: I am seeing the same effect here:

case=34854

If you close the definition with ; it'll work:

#define DECLARE_MY_FUNC(funcname, TYPE) TYPE funcname();

Another solution is to turn off

VA Options -> Advanced -> Display -> Display comments from source files when available

and

VA Options -> Advanced -> Display -> Enable automatic Quick Info ToolTips

since it will make Visual Studio (default intellisense) display the tooltips (if you did not turned off intellisense for example by renaming feacp.dll)

2. What would you like to do exactly? Can you give me an example? You may also want to see our snippet description:

http://www.wholetomato.com/products/features/vasnippets.asp

if you didn't do it yet.

Edited by - accord on Oct 30 2009 7:48:49 PM
Go to Top of Page

kennyl
Ketchup Master

50 Posts

Posted - Oct 31 2009 :  01:51:13 AM  Show Profile  Reply with Quote
1. Yes you are right for most simple macro like DECLARE_MY_FUNC, but what about this?


#define COMPLICATED_ROUTINE(_wnd, _type, _oldvalue, _newvalue, _funget, _funset, _prop)	\	_type _oldvalue = _wnd._funget();\	if ( _wnd._funset(_newvalue) )\	{\		_wnd.ShowResult( m_node##_prop );\	}
	
#define IMPLEMENT_MY_FUNC(_func, _type)	\	_type _func()\	{\		MyWnd& _wnd = GetMyWnd();\		COMPLICATED_ROUTINE(_wnd, _type, nOldCount, nNewCount, GetCount, SetCount, Count)\		return nOldCount;
	}



IMPLEMENT_MY_FUNC(Foobar, int)


And since the macro IMPLEMENT_MY_FUNC is nested by another macro COMPLICATED_ROUTINE, once I need to figure out what the COMPLICATED_ROUTINE will do, I have to navigate to IMPLEMENT_MY_FUNC first and then point to that COMPLICATED_ROUTINE.

2. I mean I would like to defined my own "reserved string" for example $MY_CODE_MARK$, which could be done by manually edit a ini file or registry entry or use the snippets editor, then I can insert it to any one of the snippets just like it's a built-in reserved string, and when I want to change the content of $MY_CODE_MARK$, I just need to update that one entry only and that's all.

Edited by - kennyl on Oct 31 2009 02:11:33 AM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Nov 05 2009 :  4:30:18 PM  Show Profile  Reply with Quote
1. I have put in a feature request for this to see what the developers make of it:

case=35229

2. One way implementing this may be using project macro variables as requested in this recent topic:
http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=9110

What do you think?

Edited by - accord on Nov 05 2009 4:34:24 PM
Go to Top of Page

kennyl
Ketchup Master

50 Posts

Posted - Mar 09 2010 :  02:35:49 AM  Show Profile  Reply with Quote
For 2, I'm using Visual Studio 6.0, so the custom variable for snippets would still be helpful.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Mar 10 2010 :  1:57:39 PM  Show Profile  Reply with Quote
You can use Environment Variables in VA Snippets. From this page:

http://www.wholetomato.com/products/features/vasnippets.asp

quote:
You can include environment variables in your VA Snippets entries. Visual Assist X expands them as expected. Enclose environment variable names in percent signs when defining the snippet.


and then just update the Environment variable value when you want to change it.

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

kennyl
Ketchup Master

50 Posts

Posted - Mar 10 2010 :  10:14:03 PM  Show Profile  Reply with Quote
Thanks, I have just known that Environment Variables is supported in VA Snippets and it did works, but I modified the environment variables from the System Properties dialog while Visual Studio is still runing, the snippet just won't get updated at all, I have to restart the Visual Studio to "refresh" the variables, or am I doing anything wrong?

Edited by - kennyl on Mar 10 2010 10:14:44 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Mar 11 2010 :  10:38:22 AM  Show Profile  Reply with Quote
This is what I would expect. I am not an expert on environment variables, but I believe they are read / picked up when a process starts, but not while a process is running.

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