A Must Have Tool – VS 2008 Snippet Designer


Mathew Manela from the Online Tools Group at Microsoft has written a really cool tool, which adds a feature missing for a long time in Visual Studio: Code Snippet Creation.

The tool, which is available at http://www.codeplex.com/SnippetDesigner allows a bunch of functionality for working with custom snippets.

  1. Add a new .SNIPPET file via File-New-File–Code Snippet File
  2. Export existing code into a snippet:
    Simply right click on the selected code and press "Export as Snippet".
    image
  3. Edit snippets (set placeholders, etc..)
    The editor is opened after exporting something.
    Additionally you can later on open .snippet files out of the "Snippet Explorer" (see below).
    image
  4. The Snippet Explorer
    Go to "View – Other Windows – Snippet Explorer" to search for existing snippets.
    image

The snippets you build are stored under the path %USERPROFILE%\Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets.

You can either insert them via the context menu "Insert Code Snippet"
(Ctrl+K-X) or you can assign a short-phrase (shortcut).

With the shortcut you just need to type e.g. prop<tab><tab> to insert a property code snippet.

You can set the shortcut (and other things as well) in the property window of the snippet editor.

Comments (7)

  1. I’ve played around with Composite Application Guidance for WPF for a while now. Yesterday I did a session

  2. Here is the latest in my link-listing series .&#160; Also check out my ASP.NET Tips, Tricks and Tutorials

  3. Here is the latest in my link-listing series .&#160; Also check out my ASP.NET Tips, Tricks and Tutorials

  4. kamii47@hotmail.com says:

    Is there any thing from whihc we can insert snippet in ASPX part ?

    I mean Html/Aspx Code snippet ?

  5. Programming says:

    Here is the latest in my link-listing series .&#160; Also check out my ASP.NET Tips, Tricks and Tutorials

  6. Barbaros says:

    I have tried this great tool on vs2008 and it worked very well. But now i have installed vs2008 team system +sp1 and i tried to install this tool and it showed up an error message.

    Is it available for vs2008 team ?

    Thank you very much