I'm probably the last person in the world to figure this out, but ever since I've been using VS 2005, I've been rather bummed that snippets never seemed to work for me.
Ever type the letter 'c' while writing C# source code and see that tempting cw snippet sitting there? It's obvious what it's for - if you can get it to expand, it'll expand to Console.WriteLine(FOO) and highlight FOO allowing you to type whatever it was you wanted to dump to stdout.
But what happens when you select the snippet you want with the mouse, or press <TAB> to do the same thing? Pretty much nothing. It completes to 'cw' and the Intellisense drop down disappears. now you're sitting there looking at a line of code that looks like this:
cw
Woohoo. Snippets are cool, aren't they?
If you didn't know that you need to hit <TAB> at this point to expand the snippet, you'd be wondering what the fuss was all about (as I was until tonight). So ultimately what you need to do is type
cw <TAB> <TAB>
...where the first <TAB> simply gets rid of the Intellisense drop down, and the second <TAB> actually performs the expansion. Well I feel stupid now, and I hope that at least one other person is as dim as me, otherwise this post will have been simply exposing my naivete :)
Is it just me, or is this somewhat unintuitive? When the intellisense feedback disappeared, I simply assumed the fireworks were over and typed out Console.WriteLine by hand. But never again!
Posted
Dec 19 2005, 06:54 PM
by
keith-brown