Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 match partial snippet shortcut

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
mnicolella Posted - Aug 22 2013 : 5:17:45 PM
I have two snippets
"dsfe" and "dsfef"

when I type "dsf" I'd like the suggestion listbox to include both of these snippet suggestions. Currently it only suggests a snippet if I type the entire snippet shortcut exactly
6   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Sep 23 2013 : 11:57:19 AM
Build 2001 has a hidden option that enables a step in the direction of this request.

After you start and exit Visual Studio with VA build 2001, a new registry value named PartialSnippetShortcutMatches will be created. It is off by default. Change the 00 value to 01 to enable the following new behavior:

Once an actual snippet shortcut has been typed, other snippets will also be added to the list if their shortcut begins with what has been typed. In the examples above, if there is a snippet whose shortcut is 'dsf', then once dsf has been typed, all snippets whose shortcuts start with dsf will also be displayed (dsf, dsfe, dsfef).
feline Posted - Aug 26 2013 : 7:52:38 PM
This makes sense, and I see what you are trying to achieve here. I have put in a feature request for this, I can see how this will work for snippets with longer shortcuts:

case=76428
mnicolella Posted - Aug 26 2013 : 3:34:11 PM
I hardly use any of the builtin VAX snippets, pretty much the only snippets I use are the ones I define. If including the snippets with a partial match were an option I could turn on, that would be great
feline Posted - Aug 26 2013 : 3:24:50 PM
If you have a lot of snippets, which is common, especially since VA ships with quite a few by default, you don't want all of these always appearing in the listboxes, getting in the way when you are typing something different. Plus the snippets are designed to take focus when you type the full snippet shortcut, so you can quickly and reliably enter the snippet. So we have to balance this with helping you type other things.

You could try adding a snippet with the shortcut "dsf", and have this insert the most common expansion, and then have "dsfe" and "dsfef" as more precise and specific snippets.
mnicolella Posted - Aug 26 2013 : 1:11:26 PM
Well, the suggestions show me other things that 'partially match' what I'm typing, it seems the shortcuts are explicitly excluded for some reason.

I didn't realize I could have more than one, but if I prefix a class of shortcuts with the same prefix, with this change I would get the listbox with all of the shortcuts that start with the prefix - then as people learn the specific suffixes for the things they want, they can quickly type it and avoid needing to always switch to arrow keys to get what they want
feline Posted - Aug 23 2013 : 10:20:36 PM
Why do you want the snippet suggestions to turn up before you have finished typing the shortcut?

Are you aware you can have have more than one snippet with the same shortcut, so you could have both shortcuts with the shortcut "dsfe" if you wanted, so both would appear in the listbox together, letting you select the one you want without typing any more characters.

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