Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 New identifier in snippets

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Dusan Posted - Nov 08 2013 : 04:53:22 AM
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?



2   L A T E S T    R E P L I E S    (Newest First)
Dusan Posted - Nov 26 2013 : 05:55:24 AM
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.
feline Posted - Nov 25 2013 : 7:26:13 PM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000