Categories: VS 2008
Posted by
yeejie on
7/6/2009 8:00 PM |
Comments (0)
<Pasted from http://blogs.msdn.com/knom/archive/2008/10/09/a-must-have-tool-vs-2008-snippet-designer.aspx>
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.
- Add a new .SNIPPET file via File-New-File–Code Snippet File
- Export existing code into a snippet:
Simply right click on the selected code and press "Export as Snippet".
- 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).
- The Snippet Explorer
Go to "View - Other Windows - Snippet Explorer" to search for existing snippets.
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.
Big thanks to knom’s developer corner!