Поделиться через


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 https://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

  • Anonymous
    October 08, 2008
    PingBack from http://www.simplynetdev.com/a-must-have-tool-vs-2008-snippet-designer/

  • Anonymous
    October 22, 2008
    I've played around with Composite Application Guidance for WPF for a while now. Yesterday I did a session

  • Anonymous
    October 22, 2008
    The comment has been removed

  • Anonymous
    October 22, 2008
    The comment has been removed

  • Anonymous
    October 22, 2008
    Is there any thing from whihc we can insert snippet in ASPX part ? I mean Html/Aspx Code snippet ?

  • Anonymous
    October 26, 2008
    The comment has been removed

  • Anonymous
    November 12, 2008
    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