BT

Snippet Editor for Visual Studio 2005/2008

by Jonathan Allen on Nov 13, 2007 |

Snippets are code templates that can be quickly accessed from the keyboard. They are not code generators per se, but rather just short cuts for common coding patterns. They support linked fields, so altering a variable name in one place will cause it to be altered throughout the snippet. The snippet will also automatically add any project references or import statements needed.

In addition to being a productivity aid, snippets serve as a training tool in Visual Basic. Snippets include instructions for tasks ranging from creating a property or new exception type through esoteric tasks like dialing a phone number using a modem connected to a serial port. To see a complete list of code snippets in VB, type ? then press tab. (It should be noted that C# also supports code snippets, but the built-in catalog is very limited.)

With the Snippet Editor, new code snippets can be created and existing ones edited to match the tasks and coding styles of each team. The snippets can then be sent as single files or packaged in a VSI. Currently there is no support for creating a shared repository for teams, but the possibility is there.

The snippet editor was originally released on GotDotNet. For reasons that are still not understood, Microsoft effectively deleted all of the content that was on the GotDotNet site when it was decommissioned. While some code was moved to CodePlex, the source for the Snippet Editor was not.

Bill McCarthy has recently brought back the snippet editor, source code and all, and added support for Visual Studio 2008. Express editions are also included for both versions.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Snipp Dogg by Jon Rogers

I found a better editor for snippets on CodePlex at www.codeplex.com/SnippDogg. Works great and is very easy to use. Hope this helps.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT