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
 New identifier in snippets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - Nov 08 2013 :  04:53:22 AM  Show Profile  Reply with Quote
As additon to $end$ would be fine to have a $next$ which would be used in similar cases:

SizeOf for $end$ (shortcut "so"):
sizeof($end$)

SizeOf for $next$ (shortcut "so"):
sizeof($next$)

Both could be defined in list, but when user would type "so", VA would check, if there any identifier follows - currently VAX provides Rename refactoring, so if I type "so" before identifier, VAX asks to rename references of identifier to "so"+identifier. With $next$ VAX should check first, if there any snippet containing $next$ with shortcut "so" exists, and if exists, then would provide both, snippet to apply $next$ and also refactoring to rename. If does not exist such snippet, VAX asks only about Refactoring as it is now...

To describe, let's say I have following code.

MyClass * mPtr = mCPtr;

and following snippet:
$next$ ? $next$ : new $next_type$($end$);

I will place caret in front of mCPtr (consider | as caret) as: |mCPtr
and type snippet shortcut, lets say "iff"
result would be:
MyClass * mPtr = mCPtr ? mCPtr : new MyClass(|);

How about it?



feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Nov 25 2013 :  7:26:13 PM  Show Profile  Reply with Quote
I think I understand the idea, but I have had to re-read your post about 7 times to work this out. It is an interesting shortcut, but I am not sure its really going to get much use, and its going to be tricky to explain.

Just selecting the code and using $selected$ or $clipboard$ in the snippet body will achieve the same result, and you can do this now. If you press the VA Snippet toolbar button while you have selected code, only snippets that use $selected$ will be shown, so you will only see the relevant ones.

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

Dusan
Whole Tomato Software

Slovakia
177 Posts

Posted - Nov 26 2013 :  05:55:24 AM  Show Profile  Reply with Quote
quote:
Just selecting the code and using $selected$ or $clipboard$ in the snippet body will achieve the same result

You are right, also if I type it completely, I'll get the same result.
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