Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Snippet for switch statement

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
slimfinger Posted - Jan 29 2013 : 11:44:25 AM
The default Intellisense snippet "switch statement auto-fill for enums in C#" (as detailed here: http://t-notes.blogspot.com/2008/12/switch-statement-auto-fill-for-enums-in.html) does not seem to be working in my version of VS2010 with VAX v. 10.6.1856.0.

Does VA disable these default snippets? Anyone know how to remedy this?

*moved to the general release section by feline*
5   L A T E S T    R E P L I E S    (Newest First)
slimfinger Posted - Feb 05 2013 : 4:09:14 PM
Odd; this is now working. I don't know if something was hosed, or if possibly I hadn't done the "press tab a second time to expand the snippet". Anyway, thanks.
sean Posted - Feb 01 2013 : 10:56:41 PM
I suspect this was fixed sometime after build 1856.
feline Posted - Feb 01 2013 : 9:06:06 PM
Which version of VA are you using?

This is what I am seeing, typing in a .cs file, using the following code:

class test_general
{
	public enum BodyWorkColor { Black, Red, Yellow, White, Blue };

	void testSwitchSnippet()
	{
		BodyWorkColor colorTest;
		|
	}
}

on simply typing the keyword "switch":



on selecting the IDE switch item in the listbox, which is not actually required, but is useful to make sure this item is being suggested:



On pressing Tab once to accept the listbox:



On pressing Tab a second time, to expand the IDE Snippet:



if I now type "colorTest" to replace "switch_on" and press Enter, then the entire switch statement is generated. At which point do you start to get different results to me?

Is switch for the IDE snippet ever listed in the listbox for you?
slimfinger Posted - Jan 31 2013 : 10:07:46 PM
Yes. I've pressed everything, I'm sure.

I'm not talking about the VA snippets, which do work. Did you visit the link I provided?
feline Posted - Jan 30 2013 : 6:45:56 PM
Are you pressing tab after accepting the IDE snippet from the listbox?

Using VS2010 and VA 1925 I type "switch" in a .cs file, select the IDE snippet from the listbox and press Tab to accept it. I then press Tab a second time to activate the snippet, and it is inserted and works as expected.

Testing this a bit further, it does not actually matter how you enter the word "switch", just placing the caret at the end of the word and pressing Tab is enough to trigger the IDE snippet.

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